Stop parsing on invalid or trailing data#4
Conversation
Breaking out of the parsing loop when it is impossible to parse the read block as either data or spare entry allows yaffshiv to be used with images extracted using a detected start offset, e.g. using binwalk without a known length. Also adjust the brute force condition, since the user requested it and FS parsing may return zero objects for incorrect settings, making brute force impossible.
|
I also validated this change using real device NAND dumps and with generated test images, but input regarding different images would be welcome. |
|
Would it work for a NAND dump where not all blocks have been used just yet and are still filled with FF's? |
|
I could not identify a regression for this patch testing with real device dumps (reverse engineering), however the current version already fails to identify settings / find files in some cases for me. If 0xFF blocks are of concern, the patch can be easily adjusted to work around this issue with a code block like this: I would appreciate testing with different real-world images to ensure no regressions happen here 👍 Thanks for your efforts! |
|
Well, don't have much images, so I can't test thoroughly. |
Breaking out of the parsing loop when it is impossible to parse the read block as either data or spare entry allows yaffshiv to be used with images extracted using a detected start offset, e.g. using binwalk without a known length.
Also adjust the brute force condition, since the user requested it and FS parsing may return zero objects for incorrect settings, making brute force impossible.