dscharrer / innoextract

A tool to unpack installers created by Inno Setup
https://constexpr.org/innoextract/
Other
1k stars 125 forks source link

"Air Setup Setup Data" modification: unable to extract #125

Open PatrykMis opened 3 years ago

PatrykMis commented 3 years ago

This is modified Inno Setup, probably v5.20.

Firstly, Tried latest GIT version:

>innoextract --debug -i "setup-hyp.exe"
found loader header resource at 0x18eac
found loader header magic version 5.1.5
loaded offsets:
- exe: @ 0xdee8d7  uncompressed: 1.58 MiB  checksum: CRC32 0xde5f5065
- header offset: 0xdc6d58
- data offset: 0x19800

unknown version: "AiR Setup Setup Data (5.2.0)"
Could not determine setup data version!
If you are sure the setup file is not corrupted, consider
filing a bug report at https://innoextract.constexpr.org/issues
Done with 1 error.

So tried to dump headers:

>innoextract --debug --dump-headers "setup-hyp.exe"
found loader header resource at 0x18eac
found loader header magic version 5.1.5
loaded offsets:
- exe: @ 0xdee8d7  uncompressed: 1.58 MiB  checksum: CRC32 0xde5f5065
- header offset: 0xdc6d58
- data offset: 0x19800

unknown version: "AiR Setup Setup Data (5.2.0)"
Not a supported Inno Setup installer!
Done with 1 error.

Ok, so added the following line to /src/setup/version.cpp:

{ "AiR Setup Setup Data (5.2.0)", INNO_VERSION_EXT(5, 2, 0, 0), 0 },

Recompiled and tried again:

>innoextract --debug -i "setup-hyp.exe"
found loader header resource at 0x18eac
found loader header magic version 5.1.5
loaded offsets:
- exe: @ 0xdee8d7  uncompressed: 1.58 MiB  checksum: CRC32 0xde5f5065
- header offset: 0xdc6d58
- data offset: 0x19800

known version: "AiR Setup Setup Data (5.2.0)"
trying to load setup headers for version 5.2.0
[block] size: 161858  compression: lzma1
loading main header
loading languages
determining encoding
loading messages
loading permissions
loading types
loading components
loading tasks
loading directories
Stream error while parsing setup headers!
 ├─ detected setup version: 5.2.0
 └─ error reason: std::bad_alloc
If you are sure the setup file is not corrupted, consider
filing a bug report at https://innoextract.constexpr.org/issues
Done with 1 error.

At least both headers can be dumped:

>innoextract --debug --dump-headers "setup-hyp.exe"
found loader header resource at 0x18eac
found loader header magic version 5.1.5
loaded offsets:
- exe: @ 0xdee8d7  uncompressed: 1.58 MiB  checksum: CRC32 0xde5f5065
- header offset: 0xdc6d58
- data offset: 0x19800

known version: "AiR Setup Setup Data (5.2.0)"
Dumping primary setup headers to "headers0.bin"
[block] size: 161858  compression: lzma1
Dumping secondary setup headers to "headers1.bin"
[block] size: 747  compression: lzma1
Done.

I am not an experienced programmer, so what can I do to successfully extract this file or to help you adding this modification/flavour to your software? I have few files made by this modification. I've included both headers. I've also tried different versions (5, 2, 3, 0) etc. but then the error was thrown straight after "loading permissions". headers.zip executable.zip (pure EXE from 0xdee8d7)