twogood / unshield

Tool and library to extract CAB files from InstallShield installers
MIT License
350 stars 75 forks source link

Failed to read ... bytes of file, Failed to read ... from input cabinet file, Failed to extract file #129

Open harrypotterIUP opened 2 years ago

harrypotterIUP commented 2 years ago

I'm getting Failed to read ... bytes of file, Failed to read ... from input cabinet file, Failed to extract file errors for 2 files. The 3000+ other files are being extracted without issues. No luck with the -O option either. When I'm using the same files to actually run the setup executable, everything gets installed without errors - including the files that unshield fails to extract. So it seems like the files themselves are fine.

I'm using the latest build from the repository:

$ ./unshield -V
Unshield version 1.4.3. MIT License. (C) 2003-2021 David Eriksson.
$ ./unshield -D 3 -d output x data1.cab >logfile 2>&1
$

Here is an excerpt from logfile:

[unshield_read_headers:227] Reading header from .hdr file 1.
[unshield_read_headers:294] Version 0x01007000 handled as major version 7
[unshield_get_cab_descriptor:77] Cabinet descriptor: 0000828e 00059631 00059631 000001a8
[unshield_get_cab_descriptor:84] Directory count: 106
[unshield_get_cab_descriptor:85] File count: 3806
[unshield_file_group_new:15] File group descriptor offset: 00000be4
[unshield_file_group_new:29] File group 00000be4 first file = 19, last file = 19
...
[unshield_reader_open_volume:417] First file offset = 00000000, last file offset = 0eb74537
[unshield_reader_open_volume:443] previous data offset = 0x080
[unshield_reader_open_volume:451] Index 1695 is last file in cabinet file 2
[unshield_reader_open_volume:477] Will read 0x00007ac9 bytes from offset 0x0eb74537
[unshield_reader_read:526] unshield_reader_read start: bytes_left = 0xf40b, volume_bytes_left = 0xf40b
[unshield_reader_read:538] Trying to read 0xf40b bytes from offset 0eb74537 in volume 2
[unshield_reader_read:549] Failed to read 0x0000f40b bytes of file 1695 (card18.p3d) from volume 2. Current offset = 0x0eb7c000
[unshield_file_save:866] Failed to read 62475 bytes from input cabinet file 2
Failed to extract file 'card18.p3d'.
[unshield_read_file_descriptor:106] File descriptor offset: 0002c696
[unshield_reader_open_volume:319] Open volume 3
[unshield_reader_open_volume:415] First file index = 1695, last file index = 3787
[unshield_reader_open_volume:417] First file offset = 00000200, last file offset = 1d57d073
[unshield_reader_read:526] unshield_reader_read start: bytes_left = 0x10000, volume_bytes_left = 0x12718
[unshield_reader_read:538] Trying to read 0x10000 bytes from offset 00007b42 in volume 3
...
[unshield_reader_read:538] Trying to read 0x10000 bytes from offset 289cd073 in volume 3
[unshield_reader_read:560] bytes_left = 0, volume_bytes_left = 39340032
[unshield_reader_read:526] unshield_reader_read start: bytes_left = 0x10000, volume_bytes_left = 0x2584800
[unshield_reader_read:538] Trying to read 0x10000 bytes from offset 289dd073 in volume 3
[unshield_reader_read:549] Failed to read 0x00010000 bytes of file 3787 (music02.rcf) from volume 3. Current offset = 0x289e7000
[unshield_file_save:866] Failed to read 65536 bytes from input cabinet file 3
Failed to extract file 'music02.rcf'.
[unshield_read_file_descriptor:106] File descriptor offset: 00058d8a
[unshield_reader_open_volume:319] Open volume 4
[unshield_reader_open_volume:415] First file index = 3787, last file index = 3805
[unshield_reader_open_volume:417] First file offset = 00000200, last file offset = 00000000
[unshield_reader_read:526] unshield_reader_read start: bytes_left = 0x10000, volume_bytes_left = 0xd7f8800
[unshield_reader_read:538] Trying to read 0x10000 bytes from offset 0257aa73 in volume 4
...

(This whole file is >8 MB.)

harrypotterIUP commented 2 years ago

You can download the CAB files in question here: myabandonware.com/game/the-simpsons-hit-run-bg6 The game is abandonware.

harrypotterIUP commented 2 years ago

It's a great tool, by the way. Thanks for doing this! :+1:

twogood commented 2 years ago

Thanks for the report! Could this be the same as #124?

harrypotterIUP commented 2 years ago

Thanks for the report! Could this be the same as #124?

Thanks for getting back to me! :+1: Yes, maybe you're right and it is the same as #124.

Is there anything I can do to help? It seems like a good idea to fix this issue. However, unfortunately, I couldn't come up with anything. Like I said, you can just run the regular setup program to extract the files, if it helps to have the two missing desired output files.

twogood commented 2 years ago

I'd love to fix this but it will take some time debugging etc and I also have paid work to do and that goes first...