read_data
Read raw memory or typed data at an address or label. Get hexdumps, decoded integers, or structured JSON for structs, arrays, and unions.
Instructions
Read raw memory bytes or structured Ghidra data at an address or label.
Raw mode returns a hexdump/xxd-style text view that includes both hex bytes
and printable ASCII by default. Pass `format` such as `u32be` with `count`
to decode raw integer tables as JSON. Structured mode returns compact JSON
for the defined data at, or containing, the resolved address, preserving
struct fields, arrays, unions, and pointer pointees without the older
metadata wrapper. `concise` remains accepted as a legacy alias for
`structured`.
If `length` is omitted in raw mode, the tool uses the remaining size of the
selected defined data item when available, otherwise it defaults to 64
bytes. If `count` is provided for a typed raw format, `length` is ignored
and the byte count is derived from `count * item_size`. Supplying `length`,
`count`, or a non-default `format` implies raw mode, so callers do not also
need to set `mode="raw"`.
Args:
target: Address, exact label name, or exact function name to inspect.
program: Required Ghidra project path or name to target.
mode: One of `structured` or `raw`. `concise` is accepted as a legacy
alias for `structured`.
length: Optional byte count for raw mode.
format: Raw output format: `hexdump`, `u8`, `u16be`, `u16le`, `u32be`,
`u32le`, `u64be`, `u64le`.
count: Optional number of typed raw values to read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | structured | |
| count | No | ||
| format | No | hexdump | |
| length | No | ||
| target | Yes | ||
| program | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |