Difference between revisions of "Lua:getModuleSize"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''function''' getModuleSize(''ModuleName'') Returns the size of a given module. Tip: Use getAddress to get the base address. === Function Parameters === {|width="85%" c…')
 
m (Reverted edits by This content is not available (Talk) to last revision by TheyCallMeTim13)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''function''' getModuleSize(''ModuleName'')
+
[[Category:Lua]]
 +
'''function''' getModuleSize(''ModuleName'') ''':''' integer
  
 
Returns the size of a given module.
 
Returns the size of a given module.
Line 21: Line 22:
 
== Examples ==
 
== Examples ==
 
Code:
 
Code:
   print(string.format('%016X', getAddress('Tutorial-x86_64.exe')))
+
  local procAddr = 'Tutorial-x86_64.exe'
   print(string.format('%08X', getModuleSize('Tutorial-x86_64.exe')))
+
   print(string.format('%016X', getAddress(procAddr)))
   print(string.format('%016X', getAddress('Tutorial-x86_64.exe') + getModuleSize('Tutorial-x86_64.exe')))
+
   print(string.format('       %08X', getModuleSize(procAddr)))
 +
   print(string.format('%016X', getAddress(procAddr) + getModuleSize(procAddr)))
 
Output:
 
Output:
 
   0000000100000000  
 
   0000000100000000  
  002D4000  
+
          002D4000  
 
   00000001002D4000  
 
   00000001002D4000  
  
Line 34: Line 36:
  
 
=== Related Functions ===
 
=== Related Functions ===
* [[getAddress]]
+
* [[Lua:getAddress|getAddress]]
* [[getSymbolInfo]]
+
* [[Lua:getSymbolInfo|getSymbolInfo]]
* [[getProcesslist]]
+
* [[Lua:getProcesslist|getProcesslist]]
* [[reinitializeSymbolhandler]]
+
* [[Lua:reinitializeSymbolhandler|reinitializeSymbolhandler]]
* [[reinitializeDotNetSymbolhandler]]
+
* [[Lua:reinitializeDotNetSymbolhandler|reinitializeDotNetSymbolhandler]]

Latest revision as of 19:09, 18 March 2019

function getModuleSize(ModuleName) : integer

Returns the size of a given module.

Tip: Use getAddress to get the base address.


Function Parameters[edit]

Parameter Type Description
ModuleName string The module name to get the size of


Examples[edit]

Code:

 local procAddr = 'Tutorial-x86_64.exe'
 print(string.format('%016X', getAddress(procAddr)))
 print(string.format('        %08X', getModuleSize(procAddr)))
 print(string.format('%016X', getAddress(procAddr) + getModuleSize(procAddr)))

Output:

 0000000100000000 
         002D4000 
 00000001002D4000 

See also[edit]

Related Functions[edit]