Difference between revisions of "Lua:autoAssemble"
Jump to navigation
Jump to search
m (moved autoAssemble to Lua:autoAssemble) |
(→Related Functions) |
||
Line 106: | Line 106: | ||
=== Related Functions === | === Related Functions === | ||
− | * [[autoAssembleCheck]] | + | * [[Lua:autoAssembleCheck|autoAssembleCheck]] |
− | * [[AOBScan]] | + | * [[Lua:AOBScan|AOBScan]] |
− | * [[disassemble]] | + | * [[Lua:disassemble|disassemble]] |
− | * [[getInstructionSize]] | + | * [[Lua:getInstructionSize|getInstructionSize]] |
− | * [[getPreviousOpcode]] | + | * [[Lua:getPreviousOpcode|getPreviousOpcode]] |
− | * [[allocateSharedMemory]] | + | * [[Lua:allocateSharedMemory|allocateSharedMemory]] |
− | * [[mapMemory]] | + | * [[Lua:mapMemory|mapMemory]] |
− | * [[unmapMemory]] | + | * [[Lua:unmapMemory|unmapMemory]] |
− | * [[readBytes]] | + | * [[Lua:readBytes|readBytes]] |
− | * [[readPointer]] | + | * [[Lua:readPointer|readPointer]] |
− | * [[writeBytes]] | + | * [[Lua:writeBytes|writeBytes]] |
− | * [[readBytesLocal]] | + | * [[Lua:readBytesLocal|readBytesLocal]] |
− | * [[readPointerLocal]] | + | * [[Lua:readPointerLocal|readPointerLocal]] |
− | * [[writeBytesLocal]] | + | * [[Lua:writeBytesLocal|writeBytesLocal]] |
− | * [[wordToByteTable]] | + | * [[Lua:wordToByteTable|wordToByteTable]] |
− | * [[dwordToByteTable]] | + | * [[Lua:dwordToByteTable|dwordToByteTable]] |
− | * [[qwordToByteTable]] | + | * [[Lua:qwordToByteTable|qwordToByteTable]] |
− | * [[floatToByteTable]] | + | * [[Lua:floatToByteTable|floatToByteTable]] |
− | * [[doubleToByteTable]] | + | * [[Lua:doubleToByteTable|doubleToByteTable]] |
− | * [[stringToByteTable]] | + | * [[Lua:stringToByteTable|stringToByteTable]] |
− | * [[wideStringToByteTable]] | + | * [[Lua:wideStringToByteTable|wideStringToByteTable]] |
− | * [[byteTableToWord]] | + | * [[Lua:byteTableToWord|byteTableToWord]] |
− | * [[byteTableToDword]] | + | * [[Lua:byteTableToDword|byteTableToDword]] |
− | * [[byteTableToQword]] | + | * [[Lua:byteTableToQword|byteTableToQword]] |
− | * [[byteTableToFloat]] | + | * [[Lua:byteTableToFloat|byteTableToFloat]] |
− | * [[byteTableToDouble]] | + | * [[Lua:byteTableToDouble|byteTableToDouble]] |
− | * [[byteTableToString]] | + | * [[Lua:byteTableToString|byteTableToString]] |
− | * [[byteTableToWideString]] | + | * [[Lua:byteTableToWideString|byteTableToWideString]] |
Revision as of 01:16, 25 January 2018
function autoAssemble(AutoAssemblerScript, TargetSelf OPTIONAL, DisableInfo OPTIONAL) : nil - boolean
function autoAssemble(AutoAssemblerScript, DisableInfo OPTIONAL) : nil - boolean
runs the auto assembler with the given text. Returns true on success, with as secondary a table you can use when disabling (if TargetSelf is set it will assemble into Cheat Engine itself). If DisableInfo is provided the [Disable] section will be handled.
Tip: Use '[[ ]]' or '[==[ ]==]' quotes for multiline script.
Function Parameters
Parameter | Type | Description |
---|---|---|
AutoAssemblerScript | string | The script to run with Cheat Engine's auto assembler |
TargetSelf | boolean | If set it will assemble into Cheat Engine itself |
DisableInfo | boolean | If provided the [Disable] section will be handled |
Examples
autoAssemble("{$lua}\n print('Printed Form Auto Assembler Script!')")
local scriptStr = [==[ alloc(memExample) label(returnHere) memExample: mov eax,123 jmp returnHere 00400500: jmp memExample returnHere: ]==] if autoAssemble(scriptStr) then print('The auto assembler script was successful.') else print('There was an error with the auto assembler script.') end
local scriptStr = [==[ alloc(memExample) label(returnHere) memExample: mov eax,123 jmp returnHere 00400500: jmp memExample returnHere: ]==] ---- Enable script local enabledOk, disableInfo = autoAssemble(scriptStr) if enabledOk then print('The auto assembler script was enabled successfully.') else print('There was an error enabling the auto assembler script.') end ---- Disable script local disabledOk = autoAssemble(scriptStr, disableInfo) if disabledOk then disableInfo = nil print('The auto assembler script was disabled successfully.') else print('There was an error disabling the auto assembler script.') end
local scriptStr = [==[ alloc(memExample2) memExample2: dd (float)364.12458729 dd (float)12.65594753 dd (float)50.75331054 dd 0 // player base dq 0 // map base dq 0 ]==] if not autoAssemble(scriptStr, true) then return 1, 'There was an error with the auto assembler script.' end
See also
Related Functions
- autoAssembleCheck
- 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