mirror of
https://github.com/86Box/bios-tools.git
synced 2026-02-24 10:28:20 -07:00
FATExtractor: Force 55 AA signature on images not recognized by 7-Zip
This commit is contained in:
@@ -1369,6 +1369,15 @@ class FATExtractor(ArchiveExtractor):
|
||||
|
||||
return False
|
||||
|
||||
# Inject the 55 AA signature (expected by 7-Zip) on images that don't have it.
|
||||
if file_header[0x1fe:0x200] != b'\x55\xaa':
|
||||
try:
|
||||
with open(file_path, 'r+b') as f:
|
||||
f.seek(0x1fe)
|
||||
f.write(b'\x55\xaa')
|
||||
except:
|
||||
pass
|
||||
|
||||
# Extract this as an archive.
|
||||
return self._extract_archive(file_path, dest_dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user