Lua:enumModules
Jump to navigation
Jump to search
Returns a table containing information about each module in the current process, or in the specified `ProcessID`. Each entry is a table with the following fields:
- Name — String containing the module name
- Address — Integer representing the base address where the module is loaded
- Is64Bit — Boolean; true if the module is 64-bit
- PathToFile — String containing the file path of the module
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| ProcessID | Integer | Optional. The process ID to enumerate modules from. Defaults to the currently opened process. |
Example[edit]
1 local mods = enumModules()
2 for i, mod in ipairs(mods) do
3 print(string.format("%s: 0x%X - %d bytes (%s)", mod.Name, mod.Address, mod.Size or 0, mod.Is64Bit and "x64" or "x86"))
4 end
5
6 -- Output:
7 --[[
8 cheatengine-x86_64-SSE4-AVX2.exe: 0x400000 - 0 bytes (x64)
9 ntdll.dll: 0x7FF8CF150000 - 0 bytes (x64)
10 KERNEL32.DLL: 0x7FF8CE660000 - 0 bytes (x64)
11 KERNELBASE.dll: 0x7FF8CC860000 - 0 bytes (x64)
12 apphelp.dll: 0x7FF8C9CA0000 - 0 bytes (x64)
13 oleaut32.dll: 0x7FF8CE1B0000 - 0 bytes (x64)
14 msvcp_win.dll: 0x7FF8CCDB0000 - 0 bytes (x64)
15 ]]