Lua:autoAssembleCheck
Revision as of 00:15, 25 January 2018 by TheyCallMeTim13 (talk | contribs) (moved autoAssembleCheck to Lua:autoAssembleCheck)
function autoAssembleCheck(AutoAssemblerScript, Enable OPTIONAL, TargetSelf OPTIONAL) : nil - boolean
Checks the script for syntax errors. Returns true on succes, false with an error message on failure.
Tip: Use '[[ ]]' or '[==[ ]==]' quotes for multiline script.
Function Parameters
Parameter | Type | Description |
---|---|---|
AutoAssemblerScript | string | The script to run with Cheat Engine's auto assembler. |
Enable | boolean | If true the [Enable] section will be checked, else the [Disable] section is checked. |
TargetSelf | boolean | If set it will check as if assembling into Cheat Engine itself. |
Examples
local checkOk, errMsg = autoAssembleCheck("{$lua}\n print('Checked Form Auto Assembler Script!')")
local scriptStr = [==[ alloc(memExample, 0x100) label(returnHere) memExample: mov eax,123 jmp returnHere 00400500: jmp memExample returnHere: ]==] local checkOk, errMsg = autoAssembleCheck(scriptStr) if not checkOk then print('The auto assembler script failed.') print(errMsg) else print('The auto assembler script passed.') end
local scriptStr = [==[ [Enable] alloc(memExample, 0x100) label(returnHere) memExample: mov eax,123 jmp returnHere 00400500: jmp memExample returnHere: [Disable] dealloc(memExample) ]==] local checkOk, errMsg = autoAssembleCheck(scriptStr, true) if not checkOk then print('The auto assembler script failed.') print(errMsg) else print('The auto assembler script passed.') end
local scriptStr = [==[ [Enable] alloc(memExample, 0x100) label(returnHere) memExample: mov eax,123 jmp returnHere 00400500: jmp memExample returnHere: [Disable] dealloc(memExample) ]==] local checkOk, errMsg = autoAssembleCheck(scriptStr, false, true) if not checkOk then print('The auto assembler script failed.') print(errMsg) else print('The auto assembler script passed.') end
See also
Related Functions
- autoAssemble
- AOBScan
- disassemble
- getInstructionSize
- getPreviousOpcode
- allocateSharedMemory
- mapMemory
- unmapMemory
- readBytes
- readPointer
- writeBytes
- readBytesLocal
- readPointerLocal
- writeBytesLocal
- wordToByteTable
- dwordToByteTable
- qwordToByteTable
- floatToByteTable
- doubleToByteTable
- stringToByteTable
- wideStringToByteTable
- byteTableToWord
- byteTableToDword
- byteTableToQword
- byteTableToFloat
- byteTableToDouble
- byteTableToString
- byteTableToWideString