Difference between revisions of "Lua:splitDisassembledString"

From Cheat Engine
Jump to navigation Jump to search
m (Added CodeBox Template.)
m (Syntax Highlighting.)
 
Line 17: Line 17:
  
 
===Example===
 
===Example===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local disStr = disassemble(0x00403E0B)
 
local disStr = disassemble(0x00403E0B)
 
local address, opcode, bytes, extra = splitDisassembledString(disStr)
 
local address, opcode, bytes, extra = splitDisassembledString(disStr)
Line 24: Line 24:
 
print(bytes)    -- e.g., "48 8D 0D FEB17B00"
 
print(bytes)    -- e.g., "48 8D 0D FEB17B00"
 
print(extra)    -- e.g., "00403E0B"
 
print(extra)    -- e.g., "00403E0B"
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
 
{{Assembly}}
 
{{Assembly}}

Latest revision as of 19:27, 25 June 2026

<> Lua API Reference

function splitDisassembledString(disassembledString) : String, String, String, String

Splits a disassembled instruction string (typically returned from disassemble) into four separate strings: the address, opcode, bytes, and extra field (comment).

Function Parameters[edit]

Parameter Type Description
disassembledString String The disassembled instruction string to parse.

Example[edit]

1 local disStr = disassemble(0x00403E0B)
2 local address, opcode, bytes, extra = splitDisassembledString(disStr)
3 print(address)  -- e.g., "[cheatengine-x86_64-SSE4-AVX2.exe+7BF0A0]"
4 print(opcode)   -- e.g., "lea rcx,[00BBF010]"
5 print(bytes)    -- e.g., "48 8D 0D FEB17B00"
6 print(extra)    -- e.g., "00403E0B"

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Assembler and Disassembler Related Lua Functions

Auto assembler, disassembly helpers, instruction size lookup, and assembler callbacks