Difference between revisions of "Lua:getModuleSize"

From Cheat Engine
Jump to navigation Jump to search
(Replaced content with '<span style="font-size:25px;color:red">Sorry! Content not available.</span>')
m (Added related function template.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span style="font-size:25px;color:red">Sorry! Content not available.</span>
+
[[Category:Lua]]
 +
{{CodeBox|'''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===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Parameter
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|modulename
 +
|String
 +
|The name of the module to get the size of.
 +
|}
 +
 
 +
===Returns===
 +
integer — The size of the given module in bytes.
 +
 
 +
===Examples===
 +
<syntaxhighlight lang="lua" line>
 +
local moduleName = "KERNEL32.dll"
 +
local moduleBase = getAddress(moduleName)
 +
local moduleSize = getModuleSize(moduleName)
 +
 
 +
printf("Module base: %X", moduleBase)
 +
printf("Module size: 0x%X", moduleSize)
 +
</syntaxhighlight>
 +
 
 +
{{LuaSeeAlso}}
 +
 
 +
{{Address}}

Latest revision as of 22:52, 26 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[edit]

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

Returns[edit]

integer — The size of the given module in bytes.

Examples[edit]

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

Symbol Related Lua Functions

Symbol lookup, address resolution, module checks, and lookup callbacks