Difference between revisions of "Lua:disassemble"

From Cheat Engine
Jump to navigation Jump to search
m (Minor edit...)
m (Syntax Highlighting.)
 
(2 intermediate revisions by the same user not shown)
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===
 +
<syntaxhighlight lang="lua" line>
 +
local instr = disassemble(0x401000)
 +
print(instr)
 +
-- Output: "00401000 - FF 25 FA580601  - jmp qword ptr [01466900]"
 +
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
 
{{Assembly}}
 
{{Assembly}}

Latest revision as of 19:26, 25 June 2026

<> Lua API Reference

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]

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

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