# HB-7300 — Icom IC-7300 firmware reverse engineering Reverse-engineering notes, tooling, and a reconstructed CI-V command reference for the **Icom IC-7300** HF/50 MHz transceiver firmware. > **No copyrighted material is distributed here.** This repo contains only original > analysis, documentation, and tools. The Icom firmware binary and the embedded > proprietary fonts (Iwata Corp.) are **not** included — you supply your own firmware > `.dat` (e.g. from Icom's official update) to reproduce any result. See > [Legal / scope](#legal--scope). ## Related work > A full side-by-side of all four projects — jeskko, zarthur, sq6emm, and this repo — with the > shared-constants table and the RZ/A1 family taxonomy is in [`docs/related-work.md`](docs/related-work.md). A far more complete, independent effort exists: **[jeskko/ic7300-homebrew](https://github.com/jeskko/ic7300-homebrew)** — it covers everything here and much more, including a full **TMS320C6745 DSP disassembly** and the SCIF5/McASP1 **DSP link protocol**, the **FPGA link**, a **custom QEMU machine** that boots real firmware to a drawn screen, and an **SDK** that runs custom C apps from the SD card. Analysis there spans all 10 firmware releases. **Prefer it as the primary reference**, especially for the DSP/FPGA side (our "layer-3 gap") and anything dynamic. This repo's value is as an **independent corroboration** reached from scratch: it agrees with theirs on the container offset math (`comp0 = size1+0x3c`), LZSS + a from-scratch compressor, no-signature/MD5-only integrity, the SPI-NOR driver at `0x3FEFA000`, dual A/B slots, the 43-entry CI-V dispatcher, the `0x20005000` base, and the hardware BOM. Their work also **corrected three items** here (now fixed): the kernel is **FreeRTOS** (not "µITRON-style"); **`SX3765`** is the front-panel RL78 MCU's version string (not the main-CPU version); and the container's post-MAIN components are **DSP Program (TI AIS) / DSP Data / FPGA** (`size2/4/6`=compressed, `size3/5/7`=decompressed). A second, independent IC-7300 effort is **[zarthur/ic-7300_firmware](https://github.com/zarthur/ic-7300_firmware)** ("100% vibe coded"), aimed at **on-device FT8**. It reaches the *same* constants from scratch — magic `3wfU`, 0x2C header, `7e` trailer, LZSS (4096 / `0xFEE` / `(hi&0xF)+3`), load base `0x20005000`, reset `0x20005050`, decompressor `0x2000425C`, and the MD5 routines (`0x2003c860/890`, `0x2003d38c`) — a near-total three-way agreement (us, zarthur, jeskko). It contributed the **fully-resolved container header model** now folded into our tooling: the 7 u32 are **four payloads** — MAIN stored, then **(stored, decoded)** pairs for DSP_PROGRAM / DSP_DATA / FPGA — which we re-verified against our own v1.42 image (all four MD5s match, each sibling LZSS-decodes to its header length: DSP_PROGRAM → `"TIPA"` AIS, FPGA → `"31601130"` bitstream; file closes exactly). zarthur also reports the **most valuable empirical datapoint in this constellation**: a *modified, MD5-resealed, unsigned* image **booted on real hardware** (display-only, label changed; stock return/recovery unproven) — turning the no-signature conclusion from analytical to observed. Its FT8 work is a **portable C prototype** (from `kgoba/ft8_lib`, host-validated vs WSJT-X), built from scratch rather than by enabling any decoder framework — the realistic template for FT8-on-7300. > **Family context** (from sq6emm's BYOF/patch repos for the IC-705/9700/905/7610): the whole Icom RZ/A1 > line shares this LZSS codec and **keyless MD5 integrity with no signature** — confirmed across 7300 / 7610 / > 705 / 9700 (the IC-905, newest, appears to add real multi-component crypto). The **7300 is the one > generation that predates the per-model "autokey" byte-obfuscation** the 7610/705/9700 wrap their on-disk > payloads in, so 7300 containers sit in the clear and are the *simplest* case to patch. --- ## What the IC-7300 runs | Property | Finding | |----------|---------| | SoC | **Renesas RZ/A1** (ARM **Cortex-A9**, ARMv7-A) | | Code storage | serial/NOR **flash @ `0x18000000`** (64 MB mapped) | | RAM | ~10 MB on-chip SRAM **@ `0x20000000`** | | Peripherals | RZ/A1 block **@ `0xFCF00000`** (device memory) | | RTOS | Renesas µITRON-style kernel (`GRP_FS` filesystem layer) | | Middleware | FAT12/16/32 SD driver, **libpng 1.6.12**, **FreeType2**, **OpenVG** | | UI graphics | **OpenVG vector** pipeline + TrueType fonts + a few 8-bpp bitmaps | | Control | **CI-V** (CAT) over serial + USB CDC | | Analyzed version | firmware **v1.42** — internal tag `SX3765 V4.96-000` | ## Firmware layout (`.dat` update file) ``` 0x000000 44-byte vendor header: "3wfU" magic + "3.112.003.16" + 7x u32 region table 0x00002C ARM image, maps to flash 0x18000000: - plaintext ARM boot stub (reset vector table, MMU/cache bring-up) - LZSS-compressed main application (-> 3.52 MB @ RAM 0x20005000) ~0x170000 0xFF erased-flash padding 0x210000+ resource section: 2 Iwata TrueType fonts + OpenVG vector art + 8-bpp bitmaps ``` ### Boot chain (fully traced) 1. **Flash stub @ `0x18000000`**: sets clocks (`0xFCFE00xx`), disables MMU/caches, sets `VBAR`, copies a 0x650-byte loader to RAM `0x20004000`, jumps to it. 2. **RAM loader @ `0x20004000`**: Cortex-A9 cache set/way maintenance, builds an MMU section table (flash / SDRAM / peripherals), then LZSS-decompresses the main app to `0x20005000` and jumps in. 3. **Decompressor** = Okumura **LZSS** — 4096-byte ring buffer, init index `0xFEE`, 12-bit offset / 3–18-byte matches. Reimplemented in [`tools/depack_lzss.py`](tools/depack_lzss.py). ### Graphics (the non-obvious part) The large high-entropy flash blobs are **not compressed bitmaps** — they are **OpenVG vector data** (paths, coordinates, paint colors) consumed by a display-list builder (`FUN_20160110`). Confirmed by the OpenVG API strings (`vgCreatePath`, `vgCreatePaint`, `vgCreateFont`, `vgCreateImage`, `TxtRender_VG_*`). Only small assets (dial, letterforms) are raw 8-bpp — see [`tools/render_assets.py`](tools/render_assets.py). Full history of the (failed) raster/compression attempts and how emulation resolved it is in the report. ## CI-V / CAT command set (reconstructed from firmware) The live CI-V engine was reversed, not copied from Icom docs: - per-port **frame assembler** (`FE FE … FD` byte state machine) → **router** `FUN_2000b258` → **interpreter** `FUN_2000b03c`; - interpreter is **table-driven**: command byte (`<0x2B`) indexes a command table `@0x2018AA2C` (8 B/entry) → subcommand list → capability table `@0x2018AB84` (16 B/entry: permission flags + min/max payload length) → **143-case handler** (`FUN_201114C8`). The complete table (33 commands, **143 command/subcommand combinations**, with payload lengths) is in [`docs/CI-V_command_table.md`](docs/CI-V_command_table.md) and can be re-dumped with [`tools/civ_extract.py`](tools/civ_extract.py). It self-validates against known CI-V (set-freq = 5 BCD bytes; read commands = length 0 + read-only flag) and reveals version detail: the dual-watch `0x25/0x26` commands are present, while `0x0C/0x0D/0x12/0x1F` are present-but-disabled (matching IC-7300 hardware: no freq-offset, single antenna, no DV). ## Reproduce ```bash # 0. obtain your own IC-7300 firmware .dat (Icom official update) -> ic7300_firmware.dat # 1. decompress the main application (LZSS) python3 tools/depack_lzss.py ic7300_firmware.dat 0x1002c main_image.bin # -> valid bytes are the first 3,524,204; load as raw ARM:LE:32:v7 at base 0x20005000 # 2. dump the CI-V command table python3 tools/civ_extract.py main_image.bin # (truncate padding is optional) # 3. render the raw 8-bpp UI bitmaps (needs Pillow) python3 tools/render_assets.py ic7300_firmware.dat # 4. load into Ghidra with flash mapped, for interactive RE (needs PyGhidra + Ghidra 12.1.x) GHIDRA_INSTALL_DIR=/path/to/ghidra python3 tools/ghidra_load.py main_image.bin ic7300_firmware.dat ``` ### Build a modified MAIN image (end-to-end, verified) The full repack chain is implemented and self-verifying — there is no signature, so a recomputed MD5 re-seals the container (see [`docs/modding-feasibility.md`](docs/modding-feasibility.md), [`docs/container-format.md`](docs/container-format.md)): ```bash python3 tools/repack_main.py extract ic7300_firmware.dat main.bin # LZSS-decompress the MAIN image # ... edit main.bin (it is the 0x20005000 ARM image) ... python3 tools/repack_main.py rebuild ic7300_firmware.dat main.bin out.dat # recompress + re-seal python3 tools/reseal.py verify out.dat # independent MD5 check ``` `rebuild` recompresses with `pack_lzss.py` (round-trip verified against the firmware's decoder), writes it back 0xFF-padded (section length unchanged), preserves fonts/other sections, and fixes section 0's MD5. **Flashing a bad image can brick the radio** — keep the original, understand the dual-image recovery path first, and keep emissions type-compliant for your licence. ## Repo contents ``` docs/IC-7300_firmware_analysis.md full analysis report (container, boot, LZSS, OpenVG, CI-V, roadmap) docs/CI-V_command_table.md reconstructed CI-V command/subcommand reference docs/menu_labels.md full menu label map (262 items; the menu-resolver output) docs/modding-feasibility.md custom-firmware feasibility: no signature, CRC32+MD5 only (GO) docs/hardware.md silicon map (R7S721000/TMS320C6745/Cyclone IV) + feature-feasibility matrix docs/dsp-interface.md MAIN<->DSP control interface: 25-param shadow table, apply/queue transport, f/w load docs/rx-signal-access.md what RX data the main CPU can see (no audio tap -> decoders belong on DSP/PC) docs/flash-driver.md SPI-NOR flash driver (W25 via SPIBSC): erase/program primitive for reflashing docs/container-format.md .dat container: 4 LZSS payloads (MAIN + DSP/FPGA stored/decoded pairs) + per-payload MD5; differential 64KB flash docs/recovery.md flash slot map, brick windows, and recovery (A/B slots, no SD recovery mode, JTAG/SPI backstop) docs/flash-backup-restore.md step-by-step SPI-NOR backup/restore (SOIC-8 clip + flashrom, or JTAG via J491); W25Q64, pinout docs/related-work.md side-by-side of the 4 projects (jeskko / zarthur / sq6emm / here) + RZ/A1 family taxonomy tools/depack_lzss.py LZSS depacker (main image extractor) tools/pack_lzss.py LZSS compressor (firmware-compatible; round-trip verified) tools/repack_main.py full chain: extract / rebuild a modified MAIN image into a .dat tools/reseal.py verify / re-seal the .dat (recompute all four payloads' MD5: MAIN, DSP_PROGRAM, DSP_DATA, FPGA) tools/civ_extract.py dump the CI-V command table from the image tools/render_assets.py render the raw 8-bpp UI bitmaps tools/ghidra_load.py PyGhidra loader (correct base + flash mapped) tools/civ_probe_radio.py on-radio dynamic probe for unresolved CI-V 0x16 subcommands ``` ## Roadmap — what's left to fully understand the firmware `[here]` = reachable from the main-CPU image alone · `[needs artifacts]` = needs a full flash dump, the DSP/FPGA images, or hardware. | # | Layer | Scope | Status | |---|-------|-------|--------| | 1 | Boot→runtime | `0x200045D0`→`main`→RTOS init→task graph→event loop; identify µITRON variant | `[here]` | | 2 | Hardware/peripherals | `0xFCFExxxx` map + drivers: VDC5 LCD, touch, I²S codec, UART, USB, SPI/SD, GPIO | `[here]` | | 3 | **DSP/FPGA signal path** | direct-sampling ADC/DDC + DSP demod/filter/AGC/NR math | **`[needs artifacts]`** | | 4 | **CI-V / CAT** | command table, params, effects | **done** (this repo) | | 5 | Radio control | band/PLL, BPF+relays, internal ATU, SWR/power metering, TX gain/ALC, scope flow | `[here]` | | 6 | Settings/cal/service | menu model, calibration data layout, ADJUST-mode entry/functions | `[here]` | | 7 | Graphics pipeline | interpret OpenVG path format / emulate renderer; map screen resource manager | `[here]` | | 8 | Update & integrity | **DONE**: no signature; header = 4 payloads (MAIN + stored/decoded pairs for DSP_PROGRAM/DSP_DATA/FPGA); per-payload MD5 **verify + reseal for all four** (verified, exact closure); differential 64KB flash; flash driver + full repack chain. Open only: DSP/FPGA payloads' *internal* formats | done | | 9 | Audio | voice memory record/playback (WAV), voice synth, RTTY/PSK decoders | `[here]` | | 10 | Dynamic analysis | QEMU RZ/A1 / full-system emulation to *run* the firmware | optional | **Bottom line:** most remaining layers are reachable from the main-CPU image with the tooling here. The irreducible gap is **layer 3** — the actual DSP/FPGA signal processing — which needs a full flash dump or Icom's DSP/FPGA update images; this file only exposes the *control* side of that interface. ## Legal / scope For interoperability, education, and security research on hardware you own. Analysis uses a firmware image **you supply**. This repository distributes no Icom firmware (copyright Icom Inc.) and no embedded fonts (proprietary, Iwata Corp.) — the `.gitignore` keeps those and all firmware-derived binaries out. Rendered UI artwork is derived from Icom's copyrighted assets; do not redistribute it. Respect your local laws on reverse engineering and Icom's licensing.