# ADSP-219x Analysis Workflow (Air-Gapped 🛡️)

## Phase 1: Preparation (Online)
1. **Download and Copy**: Ensure the entire `adsp219x-re/` folder is on the air-gapped machine.
2. **Setup Dependencies**: Ensure Python 3.8+ is installed. Radare2 must be on $PATH.
3. **Verify Python**: `python3 -m pip install r2pipe` (if not already part of your r2 install).

## Phase 2: Loading ROMs
Use raw loading for ADSP-2191 ROMs:
`r2 -a adsp2 -b 24 -m 0x0 my_rom.bin` 
(Note: `-a` and `-b` are placeholders until a native plugin exists. We use raw mode.)

## Phase 3: Automated Disassembly
Run the standalone disassembler first to get a quick overview:
`python3 disassembler/adsp219x_disasm.py my_rom.bin 3 > disassembly.txt`

## Phase 4: Radare2 + Iaito Integration
To use our custom Python disassembly inside radare2:
1. Open the ROM in radare2.
2. Run the analysis script via r2pipe:
   `#!python analysis/analyze_rom.py` (Inside r2: `#!pipe python3 ...`)
3. Use `iaito` to browse the memory with the comments generated by the script.

## Phase 5: Debugging/Validation
Compare your proprietary ROM against our test ROMs in `testrom/test_roms/`.
If you find a new instruction type, add it to `disassembler/adsp219x_disasm.py` and submit!
