Browse Source

Add preliminary support for Inno Setup 6.4.0

master
Daniel Scharrer 1 year ago
parent
commit
1de78e5927
  1. 1
      CHANGELOG
  2. 9
      src/setup/data.cpp
  3. 20
      src/setup/header.cpp
  4. 2
      src/setup/header.hpp
  5. 2
      src/setup/info.cpp
  6. 1
      src/setup/version.cpp

1
CHANGELOG

@ -1,6 +1,7 @@
innoextract 1.10 (TBD)
- Added support for Inno Setup 6.3.x installers
- Added preliminary support for Inno Setup 6.4.0
- Added support for a modified Inno Setup 5.3.10 variant
- Added unit tests
- Replaced USE_ARC4 build option with BUILD_DECRYPTION

9
src/setup/data.cpp

@ -73,7 +73,10 @@ void data_entry::load(std::istream & is, const info & i) {
}
uncompressed_size = file.size;
if(i.version >= INNO_VERSION(5, 3, 9)) {
if(i.version >= INNO_VERSION(6, 4, 0)) {
is.read(file.checksum.sha256, std::streamsize(sizeof(file.checksum.sha256)));
file.checksum.type = crypto::SHA256;
} else if(i.version >= INNO_VERSION(5, 3, 9)) {
is.read(file.checksum.sha1, std::streamsize(sizeof(file.checksum.sha1)));
file.checksum.type = crypto::SHA1;
} else if(i.version >= INNO_VERSION(4, 2, 0)) {
@ -189,7 +192,9 @@ void data_entry::load(std::istream & is, const info & i) {
}
if(options & ChunkEncrypted) {
if(i.version >= INNO_VERSION(5, 3, 9)) {
if(i.version >= INNO_VERSION(6, 4, 0)) {
chunk.encryption = stream::XChaCha20;
} else if(i.version >= INNO_VERSION(5, 3, 9)) {
chunk.encryption = stream::ARC4_SHA1;
} else {
chunk.encryption = stream::ARC4_MD5;

20
src/setup/header.cpp

@ -373,17 +373,23 @@ void header::load(std::istream & is, const version & version) {
image_alpha_format = AlphaIgnored;
}
if(version < INNO_VERSION(4, 2, 0)) {
password.crc32 = util::load<boost::uint32_t>(is);
password.type = crypto::CRC32;
} else if(version < INNO_VERSION(5, 3, 9)) {
if(version >= INNO_VERSION(6, 4, 0)) {
is.read(password.sha256, 4);
password.type = crypto::PBKDF2_SHA256_XChaCha20;
} else if(version >= INNO_VERSION(5, 3, 9)) {
is.read(password.sha1, std::streamsize(sizeof(password.sha1)));
password.type = crypto::SHA1;
} else if(version >= INNO_VERSION(4, 2, 0)) {
is.read(password.md5, std::streamsize(sizeof(password.md5)));
password.type = crypto::MD5;
} else {
is.read(password.sha1, std::streamsize(sizeof(password.sha1)));
password.type = crypto::SHA1;
password.crc32 = util::load<boost::uint32_t>(is);
password.type = crypto::CRC32;
}
if(version >= INNO_VERSION(4, 2, 2)) {
if(version >= INNO_VERSION(6, 4, 0)) {
password_salt.resize(44); // PBKDF2 salt + iteration count + ChaCha2 base nonce
is.read(&password_salt[0], std::streamsize(password_salt.length()));
} else if(version >= INNO_VERSION(4, 2, 2)) {
password_salt.resize(8);
is.read(&password_salt[0], std::streamsize(password_salt.length()));
password_salt.insert(0, "PasswordCheckHash");

2
src/setup/header.hpp

@ -44,8 +44,6 @@ namespace setup {
struct version;
typedef char salt[8];
struct header {
// Setup data header.

2
src/setup/info.cpp

@ -124,7 +124,7 @@ void load_wizard_and_decompressor(std::istream & is, const setup::version & vers
}
info.decrypt_dll.clear();
if(header.options & header::EncryptionUsed) {
if((header.options & header::EncryptionUsed) && version < INNO_VERSION(6, 4, 0)) {
if(entries & (info::DecryptDll | info::NoSkip)) {
is >> util::binary_string(info.decrypt_dll);
} else {

1
src/setup/version.cpp

@ -184,6 +184,7 @@ const known_version versions[] = {
{ "Inno Setup Setup Data (6.0.0) (u)", INNO_VERSION_EXT(6, 0, 0, 0), version::Unicode },
{ "Inno Setup Setup Data (6.1.0) (u)", INNO_VERSION_EXT(6, 1, 0, 0), version::Unicode },
{ "Inno Setup Setup Data (6.3.0)", INNO_VERSION_EXT(6, 3, 0, 0), version::Unicode },
{ "Inno Setup Setup Data (6.4.0)", INNO_VERSION_EXT(6, 4, 0, 0), version::Unicode },
};
} // anonymous namespace

Loading…
Cancel
Save