> For the complete documentation index, see [llms.txt](https://0x29a.gitbook.io/0x29a-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0x29a.gitbook.io/0x29a-docs/memory-and-analysis/disasm.md).

# disasm

**analysis · Capstone · global: `disasm`**

x86-64 disassembly via Capstone. Initializes lazily on the first call.

Every instruction returned is a table:

```lua
{
    address  = 0x7FF6...,  -- integer
    mnemonic = "mov",
    op_str   = "rax, [rbx+8]",
    size     = 7,           -- bytes
    bytes    = "\x48\x8B...", -- raw binary string
    text     = "mov rax, [rbx+8]",  -- mnemonic + op_str, already formatted
}
```

### `disasm.at(addr) -> instr | nil`

Disassembles a single instruction at `addr`.

### `disasm.range(addr, count) -> [instr]`

Disassembles `count` sequential instructions starting at `addr`.

```lua
for _, ins in ipairs(disasm.range(rip, 10)) do
    print(string.format("0x%X  %s", ins.address, ins.text))
end
```

### `disasm.func(addr [, maxBytes=0x10000]) -> [instr]`

Disassembles an entire function starting at `addr`, until it finds the end (or hits the `maxBytes` limit).

### `disasm.target(addr) -> addr | nil`

Resolves the target of a jump/call instruction, or a RIP-relative operand, at `addr` — useful for following a `call`/`jmp` without disassembling it yourself.

```lua
local call_site = sig.scan("E8 ? ? ? ?")
local target = disasm.target(call_site)
print(string.format("call goes to 0x%X", target))
```

See also the global helper [`disas(addr, n)`](/0x29a-docs/globals/helpers.md#disas-addr-n) which already prints a formatted range with resolved symbol names.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://0x29a.gitbook.io/0x29a-docs/memory-and-analysis/disasm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
