mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 03:42:46 -05:00
patch_homeui_top_nav had grown to 667 lines because every firmware's byte patterns were declared inside the function body, related to the offsets table through a second HomeUiPatchByteSet lookup, and size-checked by 32 hand-written pairwise static_asserts. Adding a firmware meant edits in three places that had to stay index-aligned. Fold HomeUiPatchBytes into HomeUiPatchProfile and give each byte field a fixed-size array type, which drops the byte-set enum, the second lookup and every static_assert: a mistyped blob is now a compile error. Move the per firmware data to homeui_top_nav_profiles.inc so adding a firmware is a data-only change, and leave the function at 185 lines of patch logic. The offline verifier kept its own copy of the offsets and source hashes; point it at the .inc instead and derive the legacy-body special case from the profile rather than a hardcoded byte-set name. Patch data is unchanged: the table the compiler emits was diffed byte for byte against the previous layout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>