mnadareski / UnshieldSharp

Port of Unshield to C#
MIT License
18 stars 3 forks source link

"Failed to read 2 bytes of file X" in specific archive #12

Open TheRogueArchivist opened 1 month ago

TheRogueArchivist commented 1 month ago

To reproduce:

Several files fail to extract properly, as seen in the log:

Outputting file at index 0 to /home/nyxh/DISK1/0/SDCC_D.exe...
Failed to read 2 bytes of file 0 (SDCC_D.exe) from input cabinet file 65535
Outputting file at index 1 to /home/nyxh/DISK1/0/og70as.dll...
Outputting file at index 2 to /home/nyxh/DISK1/0/sdcc_eng.dll...
Outputting file at index 3 to /home/nyxh/DISK1/0/sdcc.mdb...
Outputting file at index 4 to /home/nyxh/DISK1/0/sdcc_dem.mdb...
Outputting file at index 5 to /home/nyxh/DISK1/0/sdcc_eng.mdb...
Outputting file at index 6 to /home/nyxh/DISK1/0/Msvcrt.dll...
Outputting file at index 7 to /home/nyxh/DISK1/0/mfc42.dll...
Failed to read 2 bytes of file 7 (mfc42.dll) from input cabinet file 2
Outputting file at index 8 to /home/nyxh/DISK1/0/dao350.dll...
Outputting file at index 9 to /home/nyxh/DISK1/0/Dao2535.tlb...
Outputting file at index 10 to /home/nyxh/DISK1/0/Msvcrt40.dll...
Outputting file at index 11 to /home/nyxh/DISK1/0/msjter35.dll...
Outputting file at index 12 to /home/nyxh/DISK1/0/Msjint35.dll...
Outputting file at index 13 to /home/nyxh/DISK1/0/Oleaut32.dll...
Outputting file at index 14 to /home/nyxh/DISK1/0/Stdole2.tlb...
Outputting file at index 15 to /home/nyxh/DISK1/0/vbar332.dll...
Outputting file at index 16 to /home/nyxh/DISK1/0/vbajet32.dll...
Outputting file at index 17 to /home/nyxh/DISK1/0/msjet35.dll...
Failed to read 2 bytes of file 17 (msjet35.dll) from input cabinet file 3
Outputting file at index 18 to /home/nyxh/DISK1/0/msrd2x35.dll...
Outputting file at index 19 to /home/nyxh/DISK1/0/Sdcc.hlp...
Outputting file at index 20 to /home/nyxh/DISK1/0/sdcc.cnt...
Outputting file at index 21 to /home/nyxh/DISK1/0/Sdcc_eng.hlp...
Outputting file at index 22 to /home/nyxh/DISK1/0/sdcc_eng.cnt...
Outputting file at index 23 to /home/nyxh/DISK1/0/Guide_r.doc...
Outputting file at index 24 to /home/nyxh/DISK1/0/Guide_e.doc...

I confirmed the hash of the file that US extracts is different from the hash of the file that the installer extracts. These same files also error in the original Unshield, so this is not a bug specific to US.

mnadareski commented 1 month ago

This likely has something to do with either the boundary between cabinets (which lines up with which files are having issues) or with a specific version of zlib being used.