Lua:getAddressSafe
Jump to navigation
Jump to search
Returns the address of a symbol, or nil if the symbol could not be resolved.
This function is similar to using getAddress with errorOnLookup set to false, but returns nil instead of raising an error when the symbol is not found.
The symbol can be a registered symbol, a module name, or an exported symbol. Set local to true to query the symbol table of the Cheat Engine process instead of the currently opened target process.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| symbolname | String | The symbol, module name, or exported symbol to resolve. |
| local | Boolean (optional) | If true, queries the symbol table of the Cheat Engine process. |
| shallow | Boolean (optional) | If true, performs a shallow lookup. |
Returns
integer or nil — The resolved address of the given symbol, or nil if the symbol could not be found.
Examples
local address = getAddressSafe("KERNEL32.AddAtomA")
if address ~= nil then
print(string.format("%X", address))
else
print("Symbol could not be resolved")
end