Difference between revisions of "Lua:getModuleSize"

From Cheat Engine
Jump to navigation Jump to search
m (Syntax Highlighting.)
Line 21: Line 21:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local moduleName = "KERNEL32.dll"
 
local moduleName = "KERNEL32.dll"
 
local moduleBase = getAddress(moduleName)
 
local moduleBase = getAddress(moduleName)
Line 28: Line 28:
 
printf("Module base: %X", moduleBase)
 
printf("Module base: %X", moduleBase)
 
printf("Module size: 0x%X", moduleSize)
 
printf("Module size: 0x%X", moduleSize)
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Revision as of 16:30, 25 June 2026

<> Lua API Reference

function getModuleSize(modulename) : integer

Returns the size of the given module.

Use getAddress with the module name to retrieve the module's base address.

Function Parameters

Parameter Type Description
modulename String The name of the module to get the size of.

Returns

integer — The size of the given module in bytes.

Examples

1 local moduleName = "KERNEL32.dll"
2 local moduleBase = getAddress(moduleName)
3 local moduleSize = getModuleSize(moduleName)
4 
5 printf("Module base: %X", moduleBase)
6 printf("Module size: 0x%X", moduleSize)

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Related Functions