Bioruebe / cicdec

An unpacker for Clickteam Install Creator installers
BSD 3-Clause "New" or "Revised" License
33 stars 5 forks source link

Version detection sometimes fails on Linux #10

Open memo33 opened 6 months ago

memo33 commented 6 months ago

On Linux, I use Mono to run the cicdec.exe. It works fine for some installers, but fails to detect the version 35 of this one (it works correctly on Windows):

This is probably due to the use of Path.GetInvalidPathChars at https://github.com/Bioruebe/Bio.cs/blob/716ebe500a4b69839bd5383baa97d57ba7f21335/Bio.cs/Bio.cs#L257.

From the documentation:

The full set of invalid characters can vary by file system.

My file system is ext4. Some characters seem to be valid which aren't valid on Windows.

The relevant logs:

  1. simulation
    mono cicdec.exe -si 'Install NYBT 2639 And 2641 Jerome Avenue (Maxis Nite).exe'
cicdec - A Clickteam Install Creator unpacker by Bioruebe (https://bioruebe.com), 2019-2021, Version 3.0.1, Released under a BSD 3-Clause style license

Extracts files from installers made with Clickteam Install Creator

Usage: cicdec [<options>...] <installer> [<output_directory>]

<options>:
  -v <version>  Extract as installer version <version>. Auto-detection might not always work correctly, so it is possible to explicitly set the installer version.

  -db   Dump blocks. Save additional installer data like registry changes, license files and the uninstaller. This is considered raw data and might not be readable or usable.

  -dfb  Dump file block. This is raw binary data containing all files in compressed form and only useful for debugging purposes.

  -si   Simulate extraction without writing files to disk.

---------------------------------------------------------------------
Starting extraction at offset 188422

Reading block 0x1435 UNKNOWN_FONT     with size 652
Reading block 0x1436 UNKNOWN_DATA     with size 102183
Reading block 0x143E STRINGS          with size 1850
Reading block 0x1445 REGISTRY_CHANGES with size 140
Reading block 0x143A FILE_LIST        with size 765
Reading block 0x143E STRINGS          with size 1862
Reading block 0x1445 REGISTRY_CHANGES with size 139
Reading block 0x143A FILE_LIST        with size 761
Reading block 0x7F7F FILE_DATA        with size 2853389
Reading block 0x8A0D 35341            with size 3050993665

13 files in installer

Starting extraction as installer version 40

1/13    ��S�CS$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
2/13    ���S�CS$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
3/13    T��S�NYBT 2639 And 2641 Jerome Avenue01.SC4Model
4/13    C��S�NYBT 2639 And 2641 Jerome Avenue02.SC4Model
5/13    g��S�NYBT 2639 And 2641 Jerome Avenue03.SC4Model
6/13    ^��S�NYBT 2639 And 2641 Jerome Avenue04.SC4Model
7/13    *|�S�R$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
8/13    )�S�R$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
9/13    �0�S�images\Dark Night.jpg
10/13   �׻S�images\Day.jpg
11/13   8B�S�images\Maxis Night.jpg
12/13   ��S�NYBT 2639 And 2641 Jerome Avenue Read Me.html
13/13   �/<�NYBT Banner03.png
All OK
  1. extraction
    mono cicdec.exe 'Install NYBT 2639 And 2641 Jerome Avenue (Maxis Nite).exe'
cicdec - A Clickteam Install Creator unpacker by Bioruebe (https://bioruebe.com), 2019-2021, Version 3.0.1, Released under a BSD 3-Clause style license

Extracts files from installers made with Clickteam Install Creator

Usage: cicdec [<options>...] <installer> [<output_directory>]

<options>:
  -v <version>  Extract as installer version <version>. Auto-detection might not always work correctly, so it is possible to explicitly set the installer version.

  -db   Dump blocks. Save additional installer data like registry changes, license files and the uninstaller. This is considered raw data and might not be readable or usable.

  -dfb  Dump file block. This is raw binary data containing all files in compressed form and only useful for debugging purposes.

  -si   Simulate extraction without writing files to disk.

---------------------------------------------------------------------
Starting extraction at offset 188422

Reading block 0x1435 UNKNOWN_FONT     with size 652
Reading block 0x1436 UNKNOWN_DATA     with size 102183
Reading block 0x143E STRINGS          with size 1850
Reading block 0x1445 REGISTRY_CHANGES with size 140
Reading block 0x143A FILE_LIST        with size 765
Reading block 0x143E STRINGS          with size 1862
Reading block 0x1445 REGISTRY_CHANGES with size 139
Reading block 0x143A FILE_LIST        with size 761
Reading block 0x7F7F FILE_DATA        with size 2853389
Reading block 0x8A0D 35341            with size 3050993665

13 files in installer

Starting extraction as installer version 40

1/13    ��S�CS$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
2/13    ���S�CS$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
3/13    T��S�NYBT 2639 And 2641 Jerome Avenue01.SC4Model
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
4/13    C��S�NYBT 2639 And 2641 Jerome Avenue02.SC4Model
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
5/13    g��S�NYBT 2639 And 2641 Jerome Avenue03.SC4Model
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
6/13    ^��S�NYBT 2639 And 2641 Jerome Avenue04.SC4Model
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
7/13    *|�S�R$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
8/13    )�S�R$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
9/13    �0�S�images\Dark Night.jpg
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
10/13   �׻S�images\Day.jpg
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
11/13   8B�S�images\Maxis Night.jpg
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
12/13   ��S�NYBT 2639 And 2641 Jerome Avenue Read Me.html
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
13/13   �/<�NYBT Banner03.png
[WARNING] Failed to decompress file, exception was The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
[ERROR] Extraction failed. The installer is either encrypted or a version, which is currently not supported.

The first command exits 0. The second one exits non-zero, but leaves the following files on my file system:

Install NYBT 2639 And 2641 Jerome Avenue (Maxis Nite)
├── 8B�S�images
│   └── Maxis Night.jpg
├── C��S�NYBT 2639 And 2641 Jerome Avenue02.SC4Model
├── g��S�NYBT 2639 And 2641 Jerome Avenue03.SC4Model
├── T��S�NYBT 2639 And 2641 Jerome Avenue01.SC4Model
├── �
│   └── <�NYBT Banner03.png
├── �0�S�images
│   └── Dark Night.jpg
├── �\2773S�images
│   └── Day.jpg
├── *|�S�R$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
├── )�S�R$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
├── ��S�CS$$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat
├── ^��S�NYBT 2639 And 2641 Jerome Avenue04.SC4Model
├── ��S�NYBT 2639 And 2641 Jerome Avenue Read Me.html
└── ���S�CS$7_2x2_NYBT 2639 And 2641 Jerome Avenue.dat

Forcing the version to 35, extraction works fine though.