Difference between revisions of "Lua:getAddress"
Jump to navigation
Jump to search
m |
|||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | '''function''' getAddress('' | + | [[Category:Lua]] |
− | + | '''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 (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}} | |
− | |||
− | |||
=== Related Functions === | === Related Functions === | ||
− | * [[getNameFromAddress]] | + | * [[Lua:getAddressSafe|getAddressSafe]] |
− | * [[getCommonModuleList]] | + | * [[Lua:getNameFromAddress|getNameFromAddress]] |
− | * [[inModule]] | + | * [[Lua:getCommonModuleList|getCommonModuleList]] |
− | * [[inSystemModule]] | + | * [[Lua:inModule|inModule]] |
− | * [[targetIs64Bit]] | + | * [[Lua:inSystemModule|inSystemModule]] |
− | * [[enumModules]] | + | * [[Lua:targetIs64Bit|targetIs64Bit]] |
+ | * [[Lua:enumModules|enumModules]] |
Latest 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[edit]
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[edit]
Integer — The resolved address, or nil if not found.
Examples[edit]
-- 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))