Files
reverse-engineering-anything/scripts
Ryan Sandmorluto b3f70898e4 feat(firmware): inspect and extract Android DTBO partition images (#14398)
* feat(firmware): inspect and extract Android DTBO partition images

* fix(firmware): replace fixed DTBO limits with artifact_limits

* fix(artifacts): keep saved effective_limits compatible without android_dtbo

* fix(firmware): accept shared DTBO payloads and keep unknown facts unknown

mkdtimg writes a repeated input file once and points every entry for it at
the same payload (libufdt mkdtimg_core.c search_fdt_info), so an exactly
shared range is valid; only partial overlaps are refused.

A compressed entry's inner FDT magic was not examined, so
fdt_magic_valid is now null rather than false. Bytes inside total_size
that the header, entry table and payloads do not claim are reported with
their range and make coverage unknown. dt_table_header and dt_table_entry
field offsets are named after dt_table.h.

* fix(firmware): charge every DTBO row against artifact_limits.expanded_bytes

Shared payloads are valid, but each row is hashed and can be extracted
separately, so 4096 rows naming one 16 MiB payload multiplied inventory
and extraction work to 64 GiB. Admit the declared bytes of every row
against the shared aggregate expansion allowance before reading any
payload, as PCK aliases do.

* test(firmware): throw the parser's typed error in DTBO success cases

Success cases asserted ok and returned, so a parse failure showed only a
boolean mismatch. They now throw the typed ParseFailureError, as the
testing guide requires.

* test(firmware): drop a duplicated result guard

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-27 19:41:33 +00:00
..