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…')
 
Line 21: Line 21:
 
== 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  
  

Revision as of 05:43, 10 March 2017

function getModuleSize(ModuleName)

Returns the size of a given module.

Tip: Use getAddress to get the base address.


Function Parameters

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


Examples

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

Related Functions