-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(handler): improve FAT handler by adding a fallback mechanism for …
…truncated images. Some FAT samples that we have are truncated to match exactly the size of reserved sectors + FAT sectors + active cluster sectors. It's like the initial image minus the free clusters. Another approach to compute the size of a FAT chunk is to parse the File Allocation Table (FAT) and consider that the FAT chunk size is equal to the amount of active clusters multiplied by cluster size + size of reserved sectors + size of FAT sectors. This approach works great with truncated images but not so much with valid images as it triggers 'Unexpected end of archive' in 7z, even if the aforementioned end of archive that got stripped is full of null bytes. Therefore, we only apply it as a fallback mechanism when the chunk size overflows the file.
- Loading branch information
Showing
1 changed file
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters