Files
reverse-engineering-anything/src/domain/androidBootImageFormat.ts
T
Matt Van Hornandgensokyo-dev a88c0a5554 feat(artifacts): inspect Android boot image components
Inventory Android boot and vendor_boot images through shared artifact workflows. Preserve parser failure kinds and bounded stored-component extraction.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-17 12:08:42 +00:00

12 lines
582 B
TypeScript

/** Android boot image magic values; the header parser lives with its reader. */
export const ANDROID_BOOT_MAGIC = "ANDROID!";
export const VENDOR_BOOT_MAGIC = "VNDRBOOT";
const ANDROID_BOOT_MAGIC_BYTES = Buffer.from(ANDROID_BOOT_MAGIC);
const VENDOR_BOOT_MAGIC_BYTES = Buffer.from(VENDOR_BOOT_MAGIC);
/** True when the first eight bytes are ANDROID! or VNDRBOOT. */
export const hasAndroidBootImageMagic = (prefix: Buffer): boolean =>
prefix.length >= 8 &&
(prefix.subarray(0, 8).equals(ANDROID_BOOT_MAGIC_BYTES) ||
prefix.subarray(0, 8).equals(VENDOR_BOOT_MAGIC_BYTES));