Azahar 3DS emulator
v0.1.0Test 3DS homebrew in the Azahar emulator: input, screenshots, memory, symbols, save states
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
azahar_attach
Register an Azahar started by hand (RPC server enabled, app loaded) as a session.
| Parameter | Type | Description |
|---|---|---|
address | string | RPC address host:port (default 127.0.0.1:45987) |
elf | string | ELF with symbols |
log | string | Azahar's log file, for azahar_logs |
session | string | session name (default: the server's default session) |
azahar_circle_pad
Move the circle pad to x, y in -154..154 each (0, 0 is centered; x right, y up): for for_ms (default 100 ms) or held until azahar_release.
| Parameter | Type | Description |
|---|---|---|
x * | integer | x coordinate (range in the tool description) |
y * | integer | y coordinate (range in the tool description) |
for_ms | integer | duration in milliseconds without hold (default 100) |
hold | boolean | keep it until azahar_release |
session | string | session name (default: the server's default session) |
azahar_hold
Hold buttons until azahar_release; press, touch and circle pad apply on top. Buttons: A B X Y L R ZL ZR START SELECT UP DOWN LEFT RIGHT HOME POWER (case-insensitive).
| Parameter | Type | Description |
|---|---|---|
buttons * | null | array | button names |
session | string | session name (default: the server's default session) |
azahar_launch
Start Azahar headless with an app in a new session and wait until its RPC server answers (up to 2 minutes). Fails if the session exists or another emulator holds the RPC port. Linux/macOS only. The emulator keeps running until azahar_stop.
| Parameter | Type | Description |
|---|---|---|
app * | string | path of the homebrew to boot (.3dsx .cci .3ds .cxi .app .elf) |
display | string | existing X display (e.g. :0) instead of a private Xvfb |
elf | string | matching ELF with symbols, for azahar_read_symbol, azahar_wait_for and azahar_symbols |
session | string | session name (default: the server's default session) |
azahar_load_state
Load the state in slot 0-10 (it must exist). Held input is applied again afterwards.
| Parameter | Type | Description |
|---|---|---|
slot * | integer | save state slot 0-10 |
session | string | session name (default: the server's default session) |
azahar_logs
Return the last matching lines of Azahar's log (complete lines only) and the byte offset to pass as from next time, to get only lines written since.
| Parameter | Type | Description |
|---|---|---|
contains | string | only lines containing this text |
from | integer | byte offset to start at: the offset of a previous call, to get only newer lines |
session | string | session name (default: the server's default session) |
tail | integer | only the last N matching lines (default 200, at most 1000) |
azahar_press
Press buttons for for_ms (default 100 ms), then return to the held input. Buttons: A B X Y L R ZL ZR START SELECT UP DOWN LEFT RIGHT HOME POWER (case-insensitive).
| Parameter | Type | Description |
|---|---|---|
buttons * | null | array | button names |
for_ms | integer | how long to press in milliseconds (default 100) |
session | string | session name (default: the server's default session) |
azahar_read_memory
Read bytes of the app's memory; returns them as hex. Prefer azahar_read_symbol when the app's ELF is known.
| Parameter | Type | Description |
|---|---|---|
address * | string | virtual address, hex 0x... or decimal |
length * | integer | number of bytes, at most 4096 (unmapped memory reads as zeros) |
session | string | session name (default: the server's default session) |
azahar_read_symbol
Read a variable (or address) and decode it by its C type: numbers, bools, enums by name, plain char arrays as text, structs and arrays as JSON. Values over 16 KiB are refused: read a field or element. target is a variable of the app's ELF: a name, then .field and [index] parts ("test_state.touch.x", "table[2]"); C++ "ns::name", static locals "func::name", a static sharing its name "file.c:name". Or an address (hex 0x... or decimal) with type (default u32). Types: u8 u16 u32 u64 s8 s16 s32 s64 f32 f64 bool string bytes (string/bytes need len for addresses).
| Parameter | Type | Description |
|---|---|---|
target * | string | variable expression or address |
elf | string | ELF file instead of the session's |
len | integer | byte count for type string/bytes |
session | string | session name (default: the server's default session) |
type | string | decode as this type instead of the DWARF type |
azahar_release
Release held buttons, the held touch or circle pad; with nothing named, everything. Buttons: A B X Y L R ZL ZR START SELECT UP DOWN LEFT RIGHT HOME POWER (case-insensitive).
| Parameter | Type | Description |
|---|---|---|
buttons | null | array | buttons to release; with nothing named everything is released |
circle_pad | boolean | center the held circle pad |
session | string | session name (default: the server's default session) |
touch | boolean | release the held touch |
azahar_save_state
Save the emulator state to slot 0-10 (overwrites it). For launched sessions it waits until the file is written.
| Parameter | Type | Description |
|---|---|---|
slot * | integer | save state slot 0-10 |
session | string | session name (default: the server's default session) |
azahar_screenshot
Capture the next rendered frame of the top, bottom or both screens and return it as PNG image content. With output the PNG is also written to that file (overwritten).
| Parameter | Type | Description |
|---|---|---|
output | string | also save the PNG to this file path |
scale | null | integer | resolution scale 1-4 (default 1); 0 is Azahar's internal resolution |
screen | string | top (default, 400x240), bottom (320x240) or both (two consecutive frames, in 3DS arrangement) |
session | string | session name (default: the server's default session) |
split | boolean | with screen both: one image per screen |
azahar_sequence
Run a scripted test: steps, each with exactly one action and an optional name: press (buttons, with for: 300ms), hold, release (buttons or "all"), touch {x, y, for|hold}, circle_pad {x, y, for|hold}, wait (duration), screenshot {screen, output, scale, split}, write {address, bytes}, assert {target, op, value, type, len}, wait_for {target, op, value, timeout, interval}, save_state (slot), load_state (slot), log_contains {text, timeout}. Durations like 100ms or 2s. The whole sequence is checked before the first step runs; it stops at the first failure. log_contains only matches lines logged duri…
| Parameter | Type | Description |
|---|---|---|
elf | string | ELF for symbol steps instead of the sequence's or session's |
file | string | sequence file (YAML or JSON); its paths are relative to it |
script | string | sequence as YAML or JSON text instead of file; its paths are relative to the server's first allowed directory |
session | string | session name (default: the server's default session) |
azahar_sessions
List sessions (stale ones are removed).
azahar_status
Show the session: whether the emulator runs and answers RPC, its processes, app, log file and held input. A session that is not running is reported, not an error.
| Parameter | Type | Description |
|---|---|---|
session | string | session name (default: the server's default session) |
azahar_stop
Stop the session's emulator (launched sessions) or forget it (attached sessions). Deletes the session directory unless keep_files.
| Parameter | Type | Description |
|---|---|---|
keep_files | boolean | keep the session directory (logs, save states) |
session | string | session name (default: the server's default session) |
azahar_symbols
List variables and functions of the app's ELF (address, size, kind, C type), sorted by name; at most 500, use filter to narrow.
| Parameter | Type | Description |
|---|---|---|
elf | string | ELF file instead of the session's |
filter | string | only names containing this text (case-insensitive) |
session | string | session name (default: the server's default session) |
azahar_touch
Touch the bottom screen at x 0-319, y 0-239 (pixels, origin top left): for for_ms (default 100 ms) or held until azahar_release.
| Parameter | Type | Description |
|---|---|---|
x * | integer | x coordinate (range in the tool description) |
y * | integer | y coordinate (range in the tool description) |
for_ms | integer | duration in milliseconds without hold (default 100) |
hold | boolean | keep it until azahar_release |
session | string | session name (default: the server's default session) |
azahar_wait_for
Poll a variable (or address) until it compares true with value, or until timeout_ms (a check failure with the last value). Numbers compare numerically; bools, strings and enum names with eq/ne; changed waits for any change from the first read. target is a variable of the app's ELF: a name, then .field and [index] parts ("test_state.touch.x", "table[2]"); C++ "ns::name", static locals "func::name", a static sharing its name "file.c:name". Or an address (hex 0x... or decimal) with type (default u32). Types: u8 u16 u32 u64 s8 s16 s32 s64 f32 f64 bool string bytes (string/bytes need len for addres…
| Parameter | Type | Description |
|---|---|---|
target * | string | variable expression or address |
elf | string | ELF file instead of the session's |
interval_ms | integer | poll interval in milliseconds (default 50) |
len | integer | byte count for type string/bytes |
op | string | eq (default), ne, lt, le, gt, ge, or changed (no value) |
session | string | session name (default: the server's default session) |
timeout_ms | integer | how long to wait in milliseconds (default 10000) |
type | string | decode as this type instead of the DWARF type |
value | string | literal: number (decimal or 0x), true/false, string or enum name |
azahar_write_memory
Write bytes to the app's memory and verify by reading back. Writes outside the app's image and heaps are ignored by Azahar and reported as an error.
| Parameter | Type | Description |
|---|---|---|
address * | string | virtual address, hex 0x... or decimal |
bytes * | string | hex bytes in memory order, e.g. "de ad be ef" (0x1234 means bytes 12 34) |
session | string | session name (default: the server's default session) |