ppsspp_read_memory
Read PPSSPP emulator memory or scan for byte patterns to debug PSP games. Supports reading raw bytes, 32-bit integers, strings, and hex/ASCII pattern searches.
Instructions
PURPOSE: Read memory (read_bytes / read_u32 / read_string) or scan a region for a byte pattern.
USAGE: action; session_id optional when exactly one session is active; address as '0x' hex string; read_bytes ≤65536 per call (split larger reads); scan takes pattern (hex/ascii, ≤4096B) + start_addr/end_addr (≤256MiB) + chunk_size.
BEHAVIOR: READ-ONLY. Unreadable scan blocks are skipped silently. read_u32 on JIT-IR code returns IR encoding (IR_ENCODING_DETECTED) — disassemble code instead. read_string is ASCII-only (use read_bytes + Shift-JIS decode for game text).
RETURNS: {action, address, value, size, text, file} — value is the match list for scan. 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). | |
| 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). - 'scan': scan memory for a pattern (requires pattern + start_addr + end_addr). Optional max_results (default 100). | |
| 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 | Starting address for read_bytes/read_u32/read_string, as a hex string (e.g. '0x08804000'). Ignored for scan (use start_addr). | 0x0 |
| max_len | No | Maximum string length in bytes for read_string (0 = default cap 4096). Always uses read_bytes + local NUL scan — PPSSPP memory.readString is never called (its strnlen scans to memory end and a giant response can kill the WebSocket). Values are clamped to 65536. Ignored for other actions. | |
| pattern | No | Pattern to scan for (scan only). Interpreted according to `pattern_type`: 'hex' (default) expects even-length hex digits like 'AABBCCDD'; 'ascii' treats the string as literal ASCII bytes like 'hello'. | |
| end_addr | No | Scan end address, exclusive (scan only), hex string (same format as `address`). | 0x0 |
| chunk_size | No | Bytes per read request during scan (scan only, default 4096). Larger values reduce round-trips but increase per-read latency. | |
| session_id | No | Active session ID; omit to auto-resolve when exactly one session is active. | |
| start_addr | No | Scan start address, inclusive (scan only), hex string (same format as `address`). | 0x0 |
| max_results | No | Maximum number of matches to return (scan only, default 100). | |
| pattern_type | No | How to interpret `pattern` (scan only). 'hex' (default) decodes as hex string; 'ascii' encodes the pattern string as literal ASCII bytes. | hex |
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, 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'). |