Difference between revisions of "Auto Assembler:alloc"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''Auto Assembler''' alloc(''SybolName'', ''Size'', ''AllocateNearThisAddress'' OPTIONAL) Allocates a certain amount of memory and defines the symbol name in the script. If 'Al…')
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''Auto Assembler''' alloc(''SybolName'', ''Size'', ''AllocateNearThisAddress'' OPTIONAL)
+
[[Category:Assembler]]
 +
'''Auto Assembler''' alloc(''SymbolName'', ''Size'', ''AllocateNearThisAddress'' OPTIONAL)
  
 
Allocates a certain amount of memory and defines the symbol name in the script.  
 
Allocates a certain amount of memory and defines the symbol name in the script.  
Line 7: Line 8:
 
Note: Use [[Auto Assembler:dealloc|dealloc]] to free the memory when done.
 
Note: Use [[Auto Assembler:dealloc|dealloc]] to free the memory when done.
  
=== Function Parameters ===
+
Note2: There are 2 other alloc variants. allocnx and allocxo.  allocnx will allocate memory as non-executable.  allocxo will allocate memory as execute only
 +
 
 +
=== Command Parameters ===
 
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
 
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
 
!align="left"|Parameter
 
!align="left"|Parameter
Line 35: Line 38:
  
 
  alloc(SomeSymbol, 0x4, Tutorial-x86_64.exe+164C2)
 
  alloc(SomeSymbol, 0x4, Tutorial-x86_64.exe+164C2)
 +
:From the '''SunBeam''': CE actually fetches the module and allocates close to the end of the module. Additionally specifying '''+164C2''' does not add to it in any way :D Jus' sayin' ''Tutorial-x86_64.exe'' is enough.[http://fearlessrevolution.com/threads/ce-coord-how-to-find-correct-x-z-pos-when-you-have-found-a-y-position.6431/post-42870 post]
 +
 +
alloc(SomeSymbol, 0x4, SomeAOBSymbol)
 +
 +
alloc(SomeSymbol, 0x1000, Tutorial-x86_64.exe)
  
  alloc(SomeSymbol, 0x1000, Tutorial-x86_64.exe+164C2)
+
  alloc(SomeSymbol, $1000, Tutorial-x86_64.exe)
  
  alloc(SomeSymbol, $1000, Tutorial-x86_64.exe+164C2)
+
  alloc(memloc1,4)
 +
 +
00451029:
 +
jmp 00410000
 +
nop
 +
nop
 +
nop
 +
 +
00410000:
 +
mov [alloc1],esi
 +
mov [esi+80],ebx
 +
xor eax,eax
 +
jmp 00451031
  
 
== See also ==
 
== See also ==
 
* [[Cheat_Engine:Auto Assembler|Auto Assembler]]
 
* [[Cheat_Engine:Auto Assembler|Auto Assembler]]
 +
* [[Auto_Assembler:Commands|Auto Assembler Commands]]
  
=== Related Functions ===
+
=== Related Commands ===
 
* [[Auto Assembler:aobScan|aobScan]]
 
* [[Auto Assembler:aobScan|aobScan]]
 
* [[Auto Assembler:aobScanModule|aobScanModule]]
 
* [[Auto Assembler:aobScanModule|aobScanModule]]
 
* [[Auto Assembler:dealloc|dealloc]]
 
* [[Auto Assembler:dealloc|dealloc]]
 +
* [[Auto Assembler:createThread|createThread]]
 
* [[Auto Assembler:define|define]]
 
* [[Auto Assembler:define|define]]
 
* [[Auto Assembler:fullAccess|fullAccess]]
 
* [[Auto Assembler:fullAccess|fullAccess]]
Line 57: Line 79:
 
* [[Auto Assembler:registerSymbol|registerSymbol]]
 
* [[Auto Assembler:registerSymbol|registerSymbol]]
 
* [[Auto Assembler:unregisterSymbol|unregisterSymbol]]
 
* [[Auto Assembler:unregisterSymbol|unregisterSymbol]]
* [[Auto Assembler:LUA|LUA]]
+
* [[Auto Assembler:LUA ASM|LUA ASM]]
* [[Auto Assembler:ASM|ASM]]
 

Revision as of 14:48, 25 June 2018

Auto Assembler alloc(SymbolName, Size, AllocateNearThisAddress OPTIONAL)

Allocates a certain amount of memory and defines the symbol name in the script. If 'AllocateNearThisAddress' is specified CE will try to allocate the memory near that address. This is useful for 64-bit targets where the jump distance could be bigger than 2GB otherwise.

Note: Use dealloc to free the memory when done.

Note2: There are 2 other alloc variants. allocnx and allocxo. allocnx will allocate memory as non-executable. allocxo will allocate memory as execute only

Command Parameters

Parameter Type Description
SymbolName string The symbol name to use for allocated memory
Size integer The byte size of the block of memory to allocate
AllocateNearThisAddress string The address to allocate near if given


Examples

alloc(SomeSymbol, 0x4)
alloc(SomeSymbol, 0x1000)
alloc(SomeSymbol, $1000)
alloc(SomeSymbol, 0x4, Tutorial-x86_64.exe+164C2)
From the SunBeam: CE actually fetches the module and allocates close to the end of the module. Additionally specifying +164C2 does not add to it in any way :D Jus' sayin' Tutorial-x86_64.exe is enough.post
alloc(SomeSymbol, 0x4, SomeAOBSymbol)
alloc(SomeSymbol, 0x1000, Tutorial-x86_64.exe)
alloc(SomeSymbol, $1000, Tutorial-x86_64.exe)
alloc(memloc1,4)

00451029:
jmp 00410000
nop
nop
nop

00410000:
mov [alloc1],esi
mov [esi+80],ebx
xor eax,eax
jmp 00451031

See also

Related Commands