Lua:getNameFromAddress

From Cheat Engine
Revision as of 19:38, 11 July 2025 by Leunsel (talk | contribs)
Jump to navigation Jump to search

function getNameFromAddress(Address, [ModuleNames], [Symbols], [Sections]) : String

Returns the given address as a string representation. Depending on the address and the options, this may return a registered symbol name, modulename+offset, or just a hexadecimal string.

Function Parameters

Parameter Type Description
Address Integer or CEAddressString The address to convert to a string.
ModuleNames Boolean (optional) If true (default), allows returning modulename+offset if possible.
Symbols Boolean (optional) If true (default), allows returning registered symbol names if available.
Sections Boolean (optional) If true, allows returning section names. Default is false.

Returns

String — The string representation of the address.

Examples

-- Get the name for an address, preferring symbols and module names
local name = getNameFromAddress(0x401000)
print(name)

-- Only return hexadecimal if no symbol or module name is available
local hexOnly = getNameFromAddress(0x401000, false, false)
print(hexOnly)
-- cheatengine-x86_64-SSE4-AVX2.exe+1000
-- 00401000

See also

Related Functions