Difference between revisions of "Help File:Assembler"

From Cheat Engine
Jump to navigation Jump to search
(Created page with "==Assembler== This function allows you to pass a single assembler instruction along with the address of the location you want the script to execute. It will generate bytes...")
 
 
Line 6: Line 6:
 
  ''BOOL Assembler(ULONG address, char* instruction, BYTE *output, int maxlength, int *returnedsize);''
 
  ''BOOL Assembler(ULONG address, char* instruction, BYTE *output, int maxlength, int *returnedsize);''
  
'''address:''' The address the instruction is supposed to be written. Useful in cases of jumps and calls...
+
;'''address:'''
'''instruction:''' A pointer to a 0-terminated string that contains the assembler instruction you want to assemble.
+
:The address where the instruction is supposed to be written. Useful in cases of jumps and calls etc...
'''output:''' A pointer to the buffer the assembled bytes will be placed in.
+
;'''instruction:'''
'''maxlength:''' Maximum size of the buffer receiving the assembled bytes.
+
:A pointer to a 0-terminated string that contains the assembler instruction you want to assemble.
'''returnedsize:''' A pointer to the integer that gets how many bytes were used.
+
;'''output:'''  
 +
:A pointer to the buffer the assembled bytes will be placed in.</br>
 +
;'''maxlength:'''
 +
:Maximum size of the buffer receiving the assembled bytes.<br>
 +
;'''returnedsize:'''
 +
:A pointer to the integer that gets how many bytes were used.
 +
 
  
 
Returns ''TRUE'' if the instruction was valid and there was enough space. Doesn't return why it fails, so it is recommended to always give at least 32-bytes of space.
 
Returns ''TRUE'' if the instruction was valid and there was enough space. Doesn't return why it fails, so it is recommended to always give at least 32-bytes of space.

Latest revision as of 19:50, 29 July 2021

Assembler[edit]

This function allows you to pass a single assembler instruction along with the address of the location you want the script to execute. It will generate bytes and place it in a buffer that has the size of the amount of generated bytes and return that buffer.

Function Definition

BOOL Assembler(ULONG address, char* instruction, BYTE *output, int maxlength, int *returnedsize);
address:
The address where the instruction is supposed to be written. Useful in cases of jumps and calls etc...
instruction:
A pointer to a 0-terminated string that contains the assembler instruction you want to assemble.
output:
A pointer to the buffer the assembled bytes will be placed in.
maxlength:
Maximum size of the buffer receiving the assembled bytes.
returnedsize:
A pointer to the integer that gets how many bytes were used.


Returns TRUE if the instruction was valid and there was enough space. Doesn't return why it fails, so it is recommended to always give at least 32-bytes of space.