Difference between revisions of "Lua:disassemble"

From Cheat Engine
Jump to navigation Jump to search
m
m (Added CodeBox Template.)
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' disassemble(''Address'') ''':''' string
+
{{CodeBox|'''function''' disassemble(''address'') ''':''' String}}
  
Disassembles the given address and returns a string in the format of "address - bytes - opcode : extra".
+
Disassembles the instruction at the given memory address and returns a string in the format
 +
<code>"address - bytes - opcode : extra"</code>.
  
=== Function Parameters ===
+
===Function Parameters===
 
+
{|width="85%" cellpadding="5%" cellspacing="0" border="0"
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
 
 
!align="left"|Parameter
 
!align="left"|Parameter
 
!align="left"|Type
 
!align="left"|Type
 
!style="width: 80%;background-color:white;" align="left"|Description
 
!style="width: 80%;background-color:white;" align="left"|Description
 
|-
 
|-
|Address
+
|address
|[[CEAddressString]] or Integer
+
|Integer
|The address to disassembled
+
|The memory address of the instruction to disassemble.
 
|}
 
|}
 +
 +
===Example===
 +
<pre>
 +
local instr = disassemble(0x401000)
 +
print(instr)
 +
-- Output: "00401000 - FF 25 FA580601  - jmp qword ptr [01466900]"
 +
</pre>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
 
{{Assembly}}
 
{{Assembly}}

Latest revision as of 00:28, 5 December 2025

<> Function

function disassemble(address) : String

Disassembles the instruction at the given memory address and returns a string in the format: "address - bytes - opcode : extra".

Function Parameters[edit]

Parameter Type Description
address Integer The memory address of the instruction to disassemble.

Example[edit]

local instr = disassemble(0x401000)
print(instr)
-- Output: "00401000 - FF 25 FA580601  - jmp qword ptr [01466900]"

See also[edit]

Lua
Script Engine

Related Functions[edit]

autoAssemble
autoAssembleCheck
disassemble
splitDisassembledString
getInstructionSize
getPreviousOpcode
registerAssembler
unregisterAssembler