ppsspp_read_memory
Read PSP emulator memory at any address to inspect raw bytes, 32-bit integers, or ASCII strings during live debugging sessions.
Instructions
PURPOSE: Read memory (read_bytes / read_u32 / read_string).
USAGE: action; session_id optional when exactly one session is active; address as '0x' hex string; read_bytes ≤65536 per call (split larger reads); Memory scanning has moved to ppsspp_scan.
BEHAVIOR: READ-ONLY. read_string is ASCII-only (use read_bytes + Shift-JIS decode for game text). Reading code segments: use ppsspp_disassemble — MCP provides no IR-encoding detection (a read_u32 over JIT-IR bytes just returns the raw value).
RETURNS: {action, address, value, size, text, file} — read_bytes has output=value (default; byte list + hex text) / hex (text only, value=null) / file (paths + 64-byte preview; payload saved under .ppsspp-dfx/output/memory_reads/).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Number of bytes to read (read_bytes only). Max 65536 per call (MAX_SINGLE_READ_BYTES); larger reads are rejected with ARGS_INVALID -- chunk them instead. | |
| action | Yes | Read action. Valid values: - 'read_bytes': read raw bytes (requires address + size). - 'read_u32': read a 32-bit unsigned int (requires address). - 'read_string': read a string (requires address). | |
| length | No | (deprecated, ignored) PPSSPP memory.readString does not accept a length parameter. Kept for backward schema compatibility. | |
| output | No | Payload channel for read_bytes (ignored by other actions). 'value' (default) returns the byte list inline plus a hex dump in `text`. 'hex' keeps only the hex dump in `text` (value=null) — roughly half the characters. 'file' saves raw bytes + hex dump under .ppsspp-dfx/output/memory_reads/ and returns the paths plus a 64-byte preview — use for reads near the 65536-byte cap. | value |
| address | No | Required for every action. Starting address for read_bytes/read_u32/read_string, as a hex string (e.g. '0x08804000'). The schema default of '0x0' exists for legacy callers -- do NOT rely on it. | 0x0 |
| max_len | No | Maximum string length in bytes for read_string (0 = default cap 4096). Values are clamped to 65536. | |
| session_id | No | Active session ID; omit to auto-resolve when exactly one session is active. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute path of the saved raw-byte file when read_bytes ran with output='file' (hex dump sits beside it as <file>.hex.txt); empty string otherwise. | |
| size | Yes | Number of bytes read (read_bytes), or number of matches (scan). Unused for read_u32 / read_string. | |
| text | Yes | Unified text representation following spec conventions: '0xADDR: VAL (0xVAL_HEX)' for read_u32 (8-digit zero-padded hex), hex dump for read_bytes, repr for read_string, 'scan: N matches at 0xA1, 0xA2, ...' for scan. | |
| value | Yes | Read value (int/str/list[int]/list[dict] depending on action). | |
| action | Yes | Read action performed ('read_bytes'/'read_u32'/'read_string'/'scan'). | |
| address | Yes | Starting address, hex string (e.g. '0x08804000'). |