Skip to content

Commit

Permalink
fix(yaffs): extend potential page size list to include 2032 bytes
Browse files Browse the repository at this point in the history
In a sample we see a page_size with 2032 bytes and 16 bytes spare. Apparently
the sum of page+spare is 2048 bytes.

As we have many checks to see if a page_size is indeed valid and calculate
also spare size, having an additional potential page size should not cause
any problem.

As page sizes are tested in the order specified, this new and unlikely case
added to the end not to slow down other extractions.
  • Loading branch information
martonilles committed Sep 17, 2024
1 parent 3f2ec81 commit 64b827e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unblob/handlers/filesystem/yaffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# YAFFS_OBJECT_TYPE_DIRECTORY, YAFFS_OBJECT_TYPE_FILE
BIG_ENDIAN_MAGICS = [0x00_00_00_01, 0x00_00_00_03]

VALID_PAGE_SIZES = [512, 1024, 2048, 4096, 8192, 16384]
VALID_PAGE_SIZES = [512, 1024, 2048, 4096, 8192, 16384, 2032]
VALID_SPARE_SIZES = [16, 32, 64, 128, 256, 512]
YAFFS1_PAGE_SIZE = 512
YAFFS1_SPARE_SIZE = 16
Expand Down

0 comments on commit 64b827e

Please sign in to comment.