Skip to content

Latest commit

 

History

History
265 lines (199 loc) · 8.34 KB

File metadata and controls

265 lines (199 loc) · 8.34 KB

Phase A - Final Summary and Corrections

Date: 2026-01-07
Status: Phase A Complete - All Major Corrections Applied


Critical Corrections from Volume Analysis

❌ PREVIOUS INCORRECT ASSUMPTIONS:

  1. "Volume 3 contains firmware files"

    • WRONG: Volume 3 is empty (only 88 bytes Windows metadata)
  2. "BOOT/APP bins extracted from Volume 3"

    • WRONG: They were DELETED files in Volume 2 (recovered by TestDisk)
  3. "Volume 3 has firmware copies for updates"

    • WRONG: Volume 3 is the UPDATE INPUT (where users place files), not storage

✅ VERIFIED FACTS (Ground Truth)

Boot Chain:

  • IBR loads from SD offset 0x200
  • 32-byte IBR header structure: 0xA5 [ZBW...WBZ] 0xA5 + Fields A/B
  • ARM code starts at 0x220 (12,736 bytes)
  • APP.bin at offset 0x100000 with ARM vector table

FAT Volumes:

Volume Offset Size Label Content Status
1 0x04000000 512 MB - Fonts/Resources (28 files, 168 MB) Populated
2 0x24007E00 256 MB - UI Binary + deleted firmware Populated
3 0x2A61BE00 64 MB MINI EMPTY (88 bytes metadata) Empty

Firmware File Locations:

Active Boot Code:

  • 0x200: BOOT.bin with IBR header (12,768 bytes total)
  • 0x100000: APP.bin with ARM vector table

Deleted Copies (Volume 2, TestDisk recovered):

  • ZK-INKJET-NANO-BOOT.bin (12,736 bytes, deleted 9-Dec-2022)
  • ZK-INKJET-NANO-APP.bin (2.6 MB, deleted 9-Dec-2022)
  • Status: Marked with X = deleted but recoverable

User Update Area (Volume 3 "MINI"):

  • Empty during imaging
  • This is where users PLACE update files (input)
  • Update system reads from here, then deletes after flashing

Update Workflow - CORRECTED

User Perspective:

  1. Connect printer to PC via USB
  2. See "MINI" drive (64 MB, Volume 3)
  3. Copy firmware files to MINI drive
  4. Disconnect USB
  5. Device detects files, updates, deletes files
  6. MINI drive becomes empty again

System Perspective:

  1. Scan Volume 3 (3:/) for update files
  2. Read files from Volume 3 (no IBR header)
  3. Prepend 32-byte IBR header to BOOT.bin
  4. Write to raw offsets (0x200, 0x100000)
  5. Optional: Copy to Volume 2 as backup
  6. Delete files from Volume 3
  7. Reboot into new firmware

Why Volume 2 has deleted firmware:

  • Volume 2 likely serves as staging/backup
  • Update system may copy files here before flashing
  • Files deleted after successful update
  • Explains TestDisk finding them as recoverable

Six Boot Headers - Purpose REVISED

Header Locations:

  1. 0x200 - Active BOOT.bin (with code)
  2. 0x179dcc - Firmware filename list
  3. 0x247aa68 - Firmware filename list
  4. 0x306cfa8 - Firmware filename list
  5. 0x3c7bd70 - Firmware filename list
  6. 0x24098fa8 - Firmware filename list (in Volume 2)

Filename Lists Found:

  • 3:/ZK-INKJET-BOOT.bin
  • 3:/ZK-INKJET-NANO-BOOT.bin
  • 3:/ZK-INKJET-CUTE-BOOT.bin
  • 3:/ZK-INKJET-UI.bin
  • etc.

Purpose: Headers 2-6 serve as update file lookup tables:

  • Update system scans these headers
  • Determines which files to look for on 3:/ (Volume 3)
  • Supports multiple firmware variants (NANO, CUTE, TINY, PUNY)
  • May provide redundancy/recovery if main header corrupted

Volume Mount Mapping - HYPOTHESIS

Expected in firmware:

  • 0:/Volume 2 @ 0x24007E00 (system/staging) [HYPOTHESIS]
  • 3:/Volume 3 "MINI" @ 0x2A61BE00 (user updates) [HIGH CONFIDENCE]

Volume 1 Access:

  • May be mounted without drive letter (raw access)
  • Or accessed via different index
  • Fonts loaded directly by address?

Phase B Priority:

  • Find f_mount("0:/", ...) - confirm Volume 2
  • Find f_mount("3:/", ...) - confirm Volume 3
  • Understand how Volume 1 is accessed

Evidence Quality Assessment

TIER 1: VERIFIED (Hardware Ground Truth)

✅ IBR header structure @ 0x200
✅ Three FAT volumes @ known offsets
✅ Volume 3 = "MINI" label (confirmed via mtools)
✅ Volume 3 empty (88 bytes = metadata only)
✅ BOOT/APP bins are deleted files in Volume 2
✅ ARM code @ 0x220 matches deleted BOOT.bin

TIER 2: HIGH CONFIDENCE

✅ Volume 3 = user update input (3:/ in firmware)
✅ Update system deletes files after flashing
⚠️ Volume 2 = staging/backup area
⚠️ Headers 2-6 = update file lookup tables

TIER 3: HYPOTHESIS (Phase B Required)

⚠️ Volume 2 = 0:/ mount point
⚠️ Update system copies to Volume 2 before flashing
⚠️ IBR header Field A/B meanings
⚠️ Volume 1 access mechanism


Documents Requiring Updates

1. system_understanding.md

Section: "Boot Process and Storage"

  • Remove "ZBWp1WBZ" signature reference
  • Add correct IBR header structure
  • Update Volume 3 description (empty, not populated)

Section: "Known Limitations"

  • Remove "Volume 3 Location" from unknowns
  • Add: "Volume 3 identified and verified"
  • Update: "Volume 0:/ mapping still unknown"

Section: "Confidence Assessment"

  • Move Volume 3 from "Low" to "High" confidence
  • Add FAT volume structure to "High" confidence
  • Add volume mount mapping to "Hypothesis"

2. boot_locations_verified.md

Section: "FAT Volume Copy"

  • Clarify this is Volume 2, not Volume 3
  • Mark as DELETED file status
  • Explain Volume 2 vs Volume 3 difference

Section: "Update Mechanism Implications"

  • Update workflow with Volume 2 staging hypothesis
  • Clarify Volume 3 is INPUT, not storage
  • Explain deleted file status

3. system_understanding_updates_phase_a.md

  • Already created with corrections
  • Ready to apply to system_understanding.md

4. NEW: volume_identification_corrected.md

  • ✅ Created with full volume analysis
  • Complete verification of all three volumes
  • Correct update workflow description

Phase B Priorities - UPDATED

P0: Critical for USB-CDC

  1. Volume 3 location - COMPLETED (0x2A61BE00, label "MINI")
  2. ⚠️ Volume mount code - Find f_mount("3:/") to verify LBA mapping
  3. ⚠️ USB controller usage - Verify USBD_BA (0xB1008000) in firmware

P1: Boot/Update Understanding

  1. ⚠️ Volume 0:/ mapping - Find f_mount("0:/") and identify volume
  2. ⚠️ Update system code - Trace file detection and header injection
  3. ⚠️ Header purpose - Understand headers 2-6 usage

P2: Completion Items

  1. ⚠️ IBR header fields - Determine Field A/B meanings
  2. ⚠️ Volume 1 access - How firmware accesses fonts
  3. ⚠️ Deleted file cleanup - Why files deleted from Volume 2

Key Learnings

What We Got Wrong Initially:

  1. Assumed Volume 3 contained firmware (it's empty)
  2. Didn't recognize TestDisk X marker meaning (deleted)
  3. Conflated update INPUT (Volume 3) with staging (Volume 2)

What Corrected Our Understanding:

  1. Direct volume mounting via mtools
  2. Careful reading of TestDisk output (X = deleted)
  3. Volume label inspection ("MINI" confirmed)
  4. Used space analysis (88 bytes = effectively empty)

Best Practices Applied:

  1. Never trust documentation without verification
  2. Multiple evidence sources (TestDisk + mtools)
  3. Question assumptions when data doesn't align
  4. Distinguish between "recoverable" and "active" files

Next Steps

  1. Review Phase A documentation (this summary + detailed files)
  2. Apply corrections to system_understanding.md (use system_understanding_updates_phase_a.md)
  3. Begin Phase B (Ghidra firmware analysis)
  4. Verify volume mount mapping (f_mount calls for "0:/" and "3:/")

Phase A Status: ✅ COMPLETE with all major corrections applied
Evidence Quality: High (hardware-verified via multiple methods)
Ready for: Phase B firmware analysis


Reference Documents

Created During Phase A:

  • methods_phase_a_sd_analysis.md - Analysis methodology
  • boot_header_structure.md - IBR header details
  • boot_headers_analysis.md - Multiple header analysis
  • boot_locations_verified.md - BOOT.bin location verification
  • fat_volumes_contents.txt - Volume inspection results (mtools)
  • volume_identification_corrected.md - Complete volume analysis
  • system_understanding_updates_phase_a.md - Update instructions
  • phase_a_final_summary.md - This document

Artifacts Generated:

  • firmware/image/BOOT.extracted.bin - BOOT from SD @ 0x200
  • firmware/image/APP.header.bin - APP header from SD @ 0x100000
  • research/sd_fat_volumes.txt - FAT boot sector analysis

Document Complete