Difference between revisions of "Lua:getAddress"
Jump to navigation
Jump to search
m |
|||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' getAddress('' | + | '''function''' getAddress(''String'', [''Local'']) ''':''' Integer |
| − | |||
| − | |||
| − | |||
| − | |||
| + | Returns the address of a symbol, module, or export. | ||
| + | If <code>Local</code> is true, queries the symbol table of the Cheat Engine process itself. | ||
===Function Parameters=== | ===Function Parameters=== | ||
| − | {|width="85%" cellpadding="10 | + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" |
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
!style="width: 80%;background-color:white;" align="left"|Description | !style="width: 80%;background-color:white;" align="left"|Description | ||
|- | |- | ||
| − | | | + | |String |
| − | | | + | |String |
| − | |The | + | |The symbol, module name, or export to resolve to an address. |
|- | |- | ||
| − | | | + | |Local |
| − | |Boolean | + | |Boolean (optional) |
| − | | | + | |If true, queries the symbol table of the Cheat Engine process. Default is false (target process). |
|} | |} | ||
| + | ===Returns=== | ||
| + | Integer — The resolved address, or nil if not found. | ||
| + | |||
| + | ===Examples=== | ||
| + | <pre> | ||
| + | -- Get the address of a registered symbol in the target process | ||
| + | registerSymbol("MySymbol", 0x401000) | ||
| + | local symAddr = getAddress("MySymbol") | ||
| + | print(string.format("MySymbol = 0x%X", symAddr)) | ||
| + | |||
| + | -- Get the address of a symbol in the target process | ||
| + | local ceAddr = getAddress("cheatengine-x86_64-SSE4-AVX2.exe+5000") | ||
| + | print(string.format("CE process address = 0x%X", ceAddr)) | ||
| + | </pre> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Revision as of 19:46, 11 July 2025
function getAddress(String, [Local]) : Integer
Returns the address of a symbol, module, or export.
If Local is true, queries the symbol table of the Cheat Engine process itself.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| String | String | The symbol, module name, or export to resolve to an address. |
| Local | Boolean (optional) | If true, queries the symbol table of the Cheat Engine process. Default is false (target process). |
Returns
Integer — The resolved address, or nil if not found.
Examples
-- Get the address of a registered symbol in the target process
registerSymbol("MySymbol", 0x401000)
local symAddr = getAddress("MySymbol")
print(string.format("MySymbol = 0x%X", symAddr))
-- Get the address of a symbol in the target process
local ceAddr = getAddress("cheatengine-x86_64-SSE4-AVX2.exe+5000")
print(string.format("CE process address = 0x%X", ceAddr))