Difference between revisions of "Lua:reinitializeSymbolhandler"
Jump to navigation
Jump to search
m (Added related function template.) |
m (Syntax Highlighting.) |
||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' reinitializeSymbolhandler() | + | {{CodeBox|'''function''' reinitializeSymbolhandler(''waittilldone'' OPTIONAL) ''':''' void}} |
| − | + | Reinitializes the symbol handler. | |
| − | {{ | + | This is useful when new modules have been loaded and Cheat Engine should refresh its symbol information. |
| + | |||
| + | ===Function Parameters=== | ||
| + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" | ||
| + | !align="left"|Parameter | ||
| + | !align="left"|Type | ||
| + | !style="width: 80%;background-color:white;" align="left"|Description | ||
| + | |- | ||
| + | |waittilldone | ||
| + | |Boolean OPTIONAL | ||
| + | |If true, waits until the symbol handler has finished reinitializing. Defaults to true. | ||
| + | |} | ||
| + | |||
| + | ===Returns=== | ||
| + | This function does not return a value. | ||
| + | |||
| + | ===Examples=== | ||
| + | |||
| + | ====Reinitialize the symbol handler==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | reinitializeSymbolhandler() | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Wait until reinitialization is done==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | reinitializeSymbolhandler(true) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Start reinitialization without waiting==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | reinitializeSymbolhandler(false) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Reinitialize after opening a process==== | ||
| + | <syntaxhighlight lang="lua" line highlight="4"> | ||
| + | openProcess("game.exe") | ||
| + | |||
| + | -- Refresh symbols after opening the target process | ||
| + | reinitializeSymbolhandler() | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Reinitialize after loading a module==== | ||
| + | <syntaxhighlight lang="lua" line highlight="6"> | ||
| + | local loaded = executeCodeEx(0, nil, getAddress("LoadLibraryA"), { | ||
| + | type = 3, | ||
| + | value = "example.dll" | ||
| + | }) | ||
| + | |||
| + | reinitializeSymbolhandler(true) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Resolve a symbol after refreshing==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | reinitializeSymbolhandler(true) | ||
| + | |||
| + | local address = getAddressSafe("example.dll+1234") | ||
| + | |||
| + | if address ~= nil then | ||
| + | print(string.format("%X", address)) | ||
| + | end | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Use with errorOnLookupFailure==== | ||
| + | <syntaxhighlight lang="lua" line highlight="3"> | ||
| + | errorOnLookupFailure(false) | ||
| + | |||
| + | reinitializeSymbolhandler(true) | ||
| + | |||
| + | local address = getAddressSafe("SomeSymbol") | ||
| + | |||
| + | if address == nil then | ||
| + | print("Symbol not found") | ||
| + | end | ||
| + | </syntaxhighlight> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
{{Address}} | {{Address}} | ||
Latest revision as of 22:51, 26 June 2026
Reinitializes the symbol handler.
This is useful when new modules have been loaded and Cheat Engine should refresh its symbol information.
Contents
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| waittilldone | Boolean OPTIONAL | If true, waits until the symbol handler has finished reinitializing. Defaults to true. |
Returns[edit]
This function does not return a value.
Examples[edit]
Reinitialize the symbol handler[edit]
1 reinitializeSymbolhandler()
Wait until reinitialization is done[edit]
1 reinitializeSymbolhandler(true)
Start reinitialization without waiting[edit]
1 reinitializeSymbolhandler(false)
Reinitialize after opening a process[edit]
1 openProcess("game.exe")
2
3 -- Refresh symbols after opening the target process
4 reinitializeSymbolhandler()
Reinitialize after loading a module[edit]
1 local loaded = executeCodeEx(0, nil, getAddress("LoadLibraryA"), {
2 type = 3,
3 value = "example.dll"
4 })
5
6 reinitializeSymbolhandler(true)
Resolve a symbol after refreshing[edit]
1 reinitializeSymbolhandler(true)
2
3 local address = getAddressSafe("example.dll+1234")
4
5 if address ~= nil then
6 print(string.format("%X", address))
7 end
Use with errorOnLookupFailure[edit]
1 errorOnLookupFailure(false)
2
3 reinitializeSymbolhandler(true)
4
5 local address = getAddressSafe("SomeSymbol")
6
7 if address == nil then
8 print("Symbol not found")
9 end