aboutsummaryrefslogtreecommitdiffstats
path: root/psp_out/ifwi_parse_model.py (follow)
Commit message (Collapse)AuthorAge
* Mark ifwi_parse_model as diverging from firmware; revert an attempted fixuser2026-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Differentially tested the model against the real parser under Unicorn. Over 400 mutations it disagrees with the firmware on 84, in both directions: firmware FAULTS, model rejects 42 model safer, hides the bug firmware ACCEPTS, model rejects 34 model stricter firmware REJECTS, model accepts 8 model too lenient The stricter class traces to fw_tail_scan: the model raises on the first slot's failure while the firmware marks that slot invalid and continues. I changed it to make per-slot failure non-fatal -- and measured the result rather than assuming it helped. It made things WORSE: agreement fell 316 -> 305 and the dangerous class, "model accepts, firmware rejects", jumped 8 -> 53. Reverted rather than shipped. Reading fw_tail_scan (0xE0F950) shows why a one-line fix cannot work: an error register accumulates across both slots and is never cleared, so a slot-0 failure leaves it set even when slot 1 parses cleanly, while rom_parse_directory may still succeed on the valid slot regardless. Faithful modelling needs that whole interaction. So the model now carries a prominent warning not to craft with it, with the measured divergence rates and a pointer to the harnesses that drive the real parser instead. That is more useful than a model that looks authoritative and is wrong in the lenient direction -- which is exactly the direction that would make a crafted image look valid when the firmware will reject it, or worse, look rejected when the firmware accepts it.
* Initial import: AMD PSP reverse engineering, emulator and vulnerability researchPeter Geissler2026-09-22
Split out of a tinygrad working tree, where all of this lived untracked. tinygrad remains a dependency for hardware-facing scripts only. Contents: psp_emu/ Unicorn-based PSP emulator that boots the real signed firmware from the ARM reset vector: sOS -> SYS_DRV -> HDCP/DTM/RAS TAs, with a CCP crypto device model faithful enough to run the firmware's own drivers (RSA-PSS/SHA-256 container verification passes 5/5 with 5/5 negatives rejected). A simulated host drives the real mailbox/ring path through to TA_InvokeCommandEntryPoint. psp_out/ Static analysis: six PSP modules fully named (asd 1562, sys_drv 1141, sos 527, ras 119, hdcp 109, dtm 14) plus SMU 1033, a cross-version diffing pipeline over 34+ builds, per-handler annotated analysis and ~125 findings documents. Deliberately not tracked: AMD firmware images, the Hex-Rays decompilation derived from them, and IDA databases. data/MANIFEST.sha256 pins the SHA-256 of all 301 blobs results were derived from, so findings remain traceable to their inputs without redistributing AMD code. 6 MB tracked instead of 315 MB. Verified from the new location: test_smoke 5/5, ccp_selftest 11/11, verify_real_image 5/5 + 5/5 negatives, fuzz_ta_invoke controls passing and host-driven TA invoke working (0.73s per invoke).