Difference between revisions of "Lua:getSymbolInfo"
Jump to navigation
Jump to search
(Created page with "Category:Lua {{CodeBox|'''function''' getSymbolInfo(''symbolname'') ''':''' table}} Returns information about the specified symbol. The returned table is defined by the...") |
m (Added related function template.) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 46: | Line 46: | ||
===Examples=== | ===Examples=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
local info = getSymbolInfo("KERNEL32.AddAtomA") | local info = getSymbolInfo("KERNEL32.AddAtomA") | ||
| Line 61: | Line 61: | ||
print("Size: " .. tostring(info.size)) | print("Size: " .. tostring(info.size)) | ||
end | end | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
| + | |||
| + | {{Address}} | ||
Latest revision as of 22:49, 26 June 2026
Returns information about the specified symbol.
The returned table is defined by the SymbolList class object and can contain information such as the module name, search key, address, and size.
Some fields, such as size, may be nil depending on the resolved symbol.
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| symbolname | String | The name of the symbol to retrieve information for. |
Returns[edit]
table — A table containing information about the specified symbol.
Return Table Fields[edit]
| Field | Type | Description |
|---|---|---|
| modulename | String | The name of the module the symbol belongs to. |
| searchkey | String | The search key associated with the symbol. |
| address | Integer | The resolved address of the symbol. |
| size | Integer or nil | The size associated with the symbol. This field may be nil if no size is available. |
Examples[edit]
1 local info = getSymbolInfo("KERNEL32.AddAtomA")
2
3 if info ~= nil then
4 print("Module name: " .. tostring(info.modulename))
5 print("Search key: " .. tostring(info.searchkey))
6
7 if info.address ~= nil then
8 print("Address: " .. string.format("%X", info.address))
9 else
10 print("Address: nil")
11 end
12
13 print("Size: " .. tostring(info.size))
14 end