|
@@ -2,32 +2,42 @@
|
|
|
|
|
|
Extract files from Wise installers without executing them.
|
|
|
|
|
|
-The aim of this project is to extract assets from old game installers made with
|
|
|
-Wise installer without executing the PE file (.exe), so they can be used with
|
|
|
-free software implementations of the game engine.
|
|
|
+The aim of this project is to extract assets from old game installers
|
|
|
+made with Wise installer without executing the PE/NE file (.exe), so
|
|
|
+they can be used with free software implementations of the game engine.
|
|
|
|
|
|
```
|
|
|
==============================================================
|
|
|
- Welcome to REWise version 0.2.0
|
|
|
+ Welcome to REWise version 0.3.0-debug
|
|
|
==============================================================
|
|
|
|
|
|
- Usage: rewise [OPERATION] [OPTIONS] INPUT_FILE
|
|
|
+ Usage: rewise OPERATION [OPTIONS] INPUT_FILE
|
|
|
|
|
|
OPERATIONS
|
|
|
-x --extract OUTPUT_PATH Extract files.
|
|
|
- -r --raw OUTPUT_PATH Extract all files in the overlay data. This does not move/rename files!
|
|
|
+ -r --raw OUTPUT_PATH Extract all files in the overlay data. Filename format will be 'EXTRACTED_%09u'.
|
|
|
-l --list List files.
|
|
|
-V --verify Run extract without actually outputting files, crc32s will be checked.
|
|
|
+ -0 --raw-verify Run raw extract without actually outputting files, crc32s will be checked.
|
|
|
-z --script-debug Print parsed WiseScript.bin
|
|
|
-v --version Print version and exit.
|
|
|
-h --help Display this HELP.
|
|
|
|
|
|
- OPTIONS
|
|
|
- -p --preserve Don't delete TMP files.
|
|
|
+ OPTIONS (--list)
|
|
|
+ -e --extended Also print languages and components.
|
|
|
+
|
|
|
+ OPTIONS (--extract, --list, --verify)
|
|
|
+ -f --filter FILTER Filter files based on their filepath. Multiple of these filters may be set. '*' will match anything, use '\*' to escape.
|
|
|
+ -F --file-filter FILTER_FILE Path to a file that contains one filepath per line, only those that match will be processed.
|
|
|
+ -c --components NAME Filter files by components name. Note that default files are always included.
|
|
|
+ -g --language INDEX Filter files by language index. Note that default files are always included.
|
|
|
+
|
|
|
+ OPTIONS (any)
|
|
|
+ -p --preserve Don't delete WiseScript.bin from TMP_PATH.
|
|
|
-t --tmp-path TMP_PATH Set temporary path, default: /tmp/
|
|
|
-d --debug Print debug info.
|
|
|
-s --silent Be silent, don't print anything.
|
|
|
- -n --no-extract Don't extract anything. This will be ignored with -x or -r. It also will not try to remove TMP files, so -p won't do anything.
|
|
|
+ -n --no-extract Don't extract anything. Use WiseScript.bin at the given TMP_PATH, it won't delete it.
|
|
|
|
|
|
NOTES
|
|
|
- Path to directory OUTPUT_PATH and TMP_PATH should exist and be writable.
|
|
@@ -35,17 +45,32 @@ free software implementations of the game engine.
|
|
|
```
|
|
|
|
|
|
|
|
|
+# Index
|
|
|
+
|
|
|
+ - [Index](#index)
|
|
|
+ - [Acknowledgement](#acknowledgement)
|
|
|
+ - [Technical](#technical)
|
|
|
+ - .. [PE build dates](#pe-build-dates)
|
|
|
+ - [State](#state)
|
|
|
+ - .. [Known working retail installers](#known-working-retail-installers)
|
|
|
+ - .. [Known issues](#known-issues)
|
|
|
+ - .. .. [Multi-disc installers](#multi-disc-installers)
|
|
|
+ - .. [Other things that might be a problem](#other-things-that-might-be-a-problem)
|
|
|
+ - [Dependencies](#dependencies)
|
|
|
+ - [Many thanks to](#many-thanks-to)
|
|
|
+ - [Other projects](#other-projects)
|
|
|
+ - [Resources on Wise](#resources-on-wise)
|
|
|
+
|
|
|
+
|
|
|
# Acknowledgement
|
|
|
|
|
|
-The `WiseUnpacker` project helped a lot to give insight on how to unpack files
|
|
|
-from Wise installers. So a lot of thanks to
|
|
|
-[mnadareski](https://github.com/mnadareski/)!
|
|
|
+The [WiseUnpacker project](https://github.com/mnadareski/WiseUnpacker) project
|
|
|
+kick started this project by giving insight on how to inflate files from Wise
|
|
|
+installers. So a lot of thanks to [mnadareski](https://github.com/mnadareski/)!
|
|
|
|
|
|
-Unlike `WiseUnpacker` which tries to support all versions of Wise installers,
|
|
|
-REWise tries to focus on old game installers (1999-2003) in the form of PE
|
|
|
-executables. But when `REWise` fails to extract any Wise installer feel free
|
|
|
-to open an [issue](https://codeberg.org/CYBERDEV/REWise/issues) (no
|
|
|
-guarantees!).
|
|
|
+REWise is different in that it tries to understand and proper parse the
|
|
|
+`PE/NE` and `WiseScript.bin`, not everything is understood yet but it looks
|
|
|
+like most of that is relevant is.
|
|
|
|
|
|
|
|
|
# Technical
|
|
@@ -54,15 +79,16 @@ guarantees!).
|
|
|
> (or release date) since the overlay-data is just appended to a existing
|
|
|
> Wise PE32 stub on creation of the installer. The supported installer release
|
|
|
> dates seen so far are between 1999 and 2003. While the PE build dates are
|
|
|
- > between 1998 and 2001.
|
|
|
+ > between 1998 and 2001. NE files do not contain a build date.
|
|
|
|
|
|
-A Wise installer is a PE executable (NE is also possible, but not supported at
|
|
|
-this time) with extra data appended to the end of it (overlay-data at the
|
|
|
-overlay-offset). The overlay-data contains a Wise specific header which is not
|
|
|
-very important to us (it might be, but no usable values have been found yet).
|
|
|
-After the Wise header there is raw `DEFLATE`d data without file-headers, after
|
|
|
-each `DEFLATE`d data entry there is a CRC32 for the inflated data. The
|
|
|
-`DEFLATE`d data + CRC32 continues until `EOF`.
|
|
|
+A Wise installer is a PE or NE executable with extra data appended to the end of
|
|
|
+it (overlay-data at the overlay-offset). The overlay-data contains a Wise specific
|
|
|
+header. After the Wise header there is raw `DEFLATE`d data without file-headers,
|
|
|
+after each `DEFLATE`d data entry there is a CRC32 for the inflated data. The
|
|
|
+`DEFLATE`d data + CRC32 continues until `EOF`. Unless the installer is created
|
|
|
+with the `zip` support option, then before each `DEFLATE` data there is a `zip`
|
|
|
+local file header, and there is no CRC32 after the `DEFLATE` data since it is
|
|
|
+in the `zip` local file header.
|
|
|
|
|
|
The first inflated file is a `.dib` file we call `WiseColors.dib`, containing
|
|
|
colors used by the installer, it is no use for us so we skip it.
|
|
@@ -88,7 +114,7 @@ typedef struct {
|
|
|
unsigned char unknown_20[20]; // 20 * \0?
|
|
|
uint32_t crc32; // do not check when it is 0
|
|
|
char * destFile; // \0 terminated string
|
|
|
- char * fileText; // \0 terminated string
|
|
|
+ char * fileText[langCount]; // \0 terminated string(s)
|
|
|
unsigned char terminator; // always \0? terminator?
|
|
|
} WiseScriptFileHeader;
|
|
|
```
|
|
@@ -97,7 +123,7 @@ On how `REWise` handles a `WiseScript.bin` file: SEE `src/wisescript.h` and
|
|
|
`src/wisescript.c`.
|
|
|
|
|
|
|
|
|
-### Stub from different Wise Installation System versions
|
|
|
+### PE build dates
|
|
|
|
|
|
> **NOTE**: Stubs are patched on creation of the installer so we cannot do
|
|
|
a sum of `compiled` installers and compare below. `VsVersionInfo` and
|
|
@@ -106,125 +132,64 @@ On how `REWise` handles a `WiseScript.bin` file: SEE `src/wisescript.h` and
|
|
|
|
|
|
VERSION | BUILD DATE-TIME | OVERLAY OFFSET | SHA256
|
|
|
:--------- | :------------------ | :------------- | :----------------------
|
|
|
-7.01 | 09-11-1998 21:17:09 | `0x00003800` | 6a6266fc674bc61852d3e5dc2b3608de9205f518baf718880b81aa1a6179573f
|
|
|
-8.11.0.505 | 25-04-2000 16:37:12 | `0x00003A00` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
-8.12.0.508 | 25-04-2000 16:37:12 | `0x00003A00` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
-8.14.0.512 | 25-04-2000 16:37:12 | `0x00003A00` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
-9.01.202.0 | 25-10-2001 21:47:11 | `0x00003A00` | 96a173c62f632140e9d14a7eee0d42f8ef62bee4b66ed317f2077bdfaa32376a
|
|
|
-9.02.204.0 | 25-10-2001 21:47:11 | `0x00003A00` | 96a173c62f632140e9d14a7eee0d42f8ef62bee4b66ed317f2077bdfaa32376a
|
|
|
+? | 1998-10-02 22:36:51 | `0x3800` | ?
|
|
|
+? | 1998-10-23 23:23:16 | `0x3800` | ?
|
|
|
+7.01 | 1998-11-09 21:17:09 | `0x3800` | 6a6266fc674bc61852d3e5dc2b3608de9205f518baf718880b81aa1a6179573f
|
|
|
+? | 1998-12-03 23:11:32 | `0x3800` / `0x3E00` | ?
|
|
|
+? | 1999-02-05 23:07:52 | `0x3A00` | ?
|
|
|
+? | 1999-04-05 18:07:26 | `0x3A00` | ?
|
|
|
+? | 1999-04-08 22:24:47 | `.rsrc`? | ?
|
|
|
+? | 1999-05-21 22:48:48 | `0x3A00` / `0x5E00` | ?
|
|
|
+? | 1999-08-17 17:25:48 | `0x3A00` / `0x5200` | ?
|
|
|
+8.11.0.505 | 2000-04-25 16:37:12 | `0x3A00` / `0x3C00` / `0x5200` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
+8.12.0.508 | 2000-04-25 16:37:12 | `0x3A00` / `0x3C00` / `0x5200` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
+8.14.0.512 | 2000-04-25 16:37:12 | `0x3A00` / `0x3C00` / `0x5200` | 23da437bde09458cd512644a139c6ce8d180187a9cc6d32e7bfef077ed99f580
|
|
|
+? | 2001-08-13 19:13:38 | `0x3A00` / `0x3C00` | ?
|
|
|
+9.01.202.0 | 2001-10-25 21:47:11 | `0x3A00` / `0x3C00` / `0x9C00` | 96a173c62f632140e9d14a7eee0d42f8ef62bee4b66ed317f2077bdfaa32376a
|
|
|
+9.02.204.0 | 2001-10-25 21:47:11 | `0x3A00` / `0x3C00` / `0x9C00` | 96a173c62f632140e9d14a7eee0d42f8ef62bee4b66ed317f2077bdfaa32376a
|
|
|
+??? | 2031-05-20 22:54:01 | `0x4C00` | ?
|
|
|
|
|
|
|
|
|
# State
|
|
|
|
|
|
-Do you know any Wise installer that is not listed below? Please consider
|
|
|
-reporting it for completeness and for further investigation.
|
|
|
-
|
|
|
-## Known working Wise installers
|
|
|
-
|
|
|
-SHORT | SOURCE | FULL
|
|
|
-:---------- | :--------- | :--------------------------------------------
|
|
|
-HL:UL | Download | Half-Life Uplink (1999)
|
|
|
-GSPY220 | Download | GameSpy 220 std (2000)
|
|
|
-OPFOR:DEMO | Download | Half-Life:Opposing Force Demo (2000)
|
|
|
-HL:CS | Retail CD | Half-Life Counter-Strike (2000)
|
|
|
-HL:GOTY | Retail CD | Half-Life Game Of The Year Edition (1999)
|
|
|
-RTCW | Retail CD | Return to Castle Wolfenstein (2001)
|
|
|
-RTCW:MPDEMO | Download | Return to Castle Wolfenstein Multi-Player Demo (2001)
|
|
|
-RTCW:SPDEMO | Download | Return to Castle Wolfenstein Single-Player Demo (2001)
|
|
|
-CS15 | Download | Counter-Strike 1.5 (2001)
|
|
|
-GIFT | Download | Gift (PL) (2000) (aka Gifty (DE))
|
|
|
-HL1WON | Download | Half-Life 1 WON 1.1.1.0 Patch (2002)
|
|
|
-ET | Download | Wolfenstein: Enemy Territory (2001)
|
|
|
-HL23SDK | Download | Half-Life SDK 2.3 (2002)
|
|
|
-HL:STEAM | Download | Steam Client with Half-Life Cache (2003)
|
|
|
-
|
|
|
-___
|
|
|
-
|
|
|
-SHORT | FILENAME | PE BUILD | STUB
|
|
|
-:---------- | :------------------------- | :------------------ | :-----------
|
|
|
-HL:UL | hluplink.exe | 09-11-1998 21:17:09 | InstallMaster 7
|
|
|
-GSPY220 | gamespyinstaller220std.exe | 21-05-1999 22:48:48 | ?
|
|
|
-OPFOR:DEMO | opfordemofull.exe | 21-05-1999 22:48:48 | ?
|
|
|
-HL:CS | counter-strike.exe | 17-08-1999 17:25:48 | ?
|
|
|
-HL:GOTY | SETUP.EXE | 25-04-2000 16:37:12 | InstallMaster 8
|
|
|
-RTCW | Setup.exe | 25-04-2000 16:37:12 | InstallMaster 8
|
|
|
-RTCW:MPDEMO | Wolf_MPDemo.exe | 25-04-2000 16:37:12 | InstallMaster 8
|
|
|
-RTCW:SPDEMO | wolf_spdemo.exe | 25-04-2000 16:37:12 | InstallMaster 8
|
|
|
-CS15 | csv15full.exe | 13-08-2001 19:13:38 | ?
|
|
|
-GIFT | Gift.exe | 13-08-2001 19:13:38 | ?
|
|
|
-HL1WON | hl1110.exe | 13-08-2001 19:13:38 | ?
|
|
|
-ET | WolfET.exe | 25-10-2001 21:47:11 | Installation System 9
|
|
|
-HL23SDK | hl_sdk_v23.exe | 25-10-2001 21:47:11 | Installation System 9
|
|
|
-HL:STEAM | steaminstall_halflife.exe | 25-10-2001 21:47:11 | Installation System 9
|
|
|
-
|
|
|
-
|
|
|
-## Not working installers
|
|
|
-
|
|
|
- > NOTE: All multi-disc installers are currently NOT supported.
|
|
|
-
|
|
|
-SHORT | SOURCE | FULL
|
|
|
-:---------- | :--------- | :--------------------------------------------
|
|
|
-WILDWHEELS | Retail CD | Wild Wheels (2002) (aka Buzzing Cars)
|
|
|
-HM:C | Retail CD | Hitman Contracts (2004)
|
|
|
-GOTHIC II | Retail CD | Gothic II (2003)
|
|
|
-
|
|
|
-___
|
|
|
-
|
|
|
-SHORT | FILENAME | PE BUILD | STUB
|
|
|
-:---------- | :------------------------- | :------------------ | :-----------
|
|
|
-WILDWHEELS | setup.EXE | 17-08-1999 17:25:48 | ?
|
|
|
-HM:C | setup.exe | 25-04-2000 16:37:12 | InstallMaster 8
|
|
|
-GOTHIC II | Gothic2-Setup.exe | 25-10-2001 21:47:11 | Installation System 9
|
|
|
-
|
|
|
-
|
|
|
-#### `WILDWHEELS`
|
|
|
-
|
|
|
-In contrary to what we've seen before there are PK headers at inflate
|
|
|
-start which also contains the CRC32 (instead of just the CRC32 after
|
|
|
-the deflate data). It is either build with a different Wise package or
|
|
|
-maybe different configuration (maybe with the zip support option? still
|
|
|
-has to be analyzed).
|
|
|
-
|
|
|
-This game supposed to be open sourced, see [this](https://github.com/colobot/colobot/issues/896)
|
|
|
-, but have not found the source or license yet.
|
|
|
-
|
|
|
-
|
|
|
-#### `HM:C`
|
|
|
-
|
|
|
-This is a multi-disc installer which is not supported yet.
|
|
|
-
|
|
|
-Not aware of a free software implementation of this game, so it has no
|
|
|
-priority.
|
|
|
-
|
|
|
-
|
|
|
-#### `GOTHIC II`
|
|
|
-
|
|
|
-This is a multi-disc installer which is not supported yet.
|
|
|
-
|
|
|
-Would be nice to support for the use with [REGoth-bs](https://github.com/REGoth-project/REGoth-bs)
|
|
|
-or [OpenGothic](https://github.com/Try/OpenGothic).
|
|
|
-
|
|
|
-
|
|
|
-## What can be done better
|
|
|
-
|
|
|
-In general:
|
|
|
-
|
|
|
- - Option(s) to extract only given file(s), maybe with wildcards or a
|
|
|
- specified file list?
|
|
|
- - Error handling (different exit codes for different errors).
|
|
|
-
|
|
|
-Values that are currently calculated that might be in the WiseHeader,
|
|
|
-somewhere in `WiseScript.bin` or a constant defined somewhere else are:
|
|
|
-
|
|
|
- - Total inflated size.
|
|
|
- - The deflate-offset that is added to deflateStart defined in the
|
|
|
- WiseScript.bin file.
|
|
|
-
|
|
|
-Other values that are of interest but not found yet are:
|
|
|
-
|
|
|
- - Deflated/Inflated size of `WiseColors.dib` and `WiseScript.bin`.
|
|
|
+ - [x] [PE](https://en.wikipedia.org/wiki/Portable_Executable) and
|
|
|
+ [NE](https://en.wikipedia.org/wiki/New_Executable) support.
|
|
|
+ - [x] Installers build with `zip` support.
|
|
|
+ - [x] Multilingual installer support.
|
|
|
+ - [ ] Multi-file/disc installers.
|
|
|
+ - [ ] Patch support.
|
|
|
+
|
|
|
+## Known working retail installers
|
|
|
+
|
|
|
+PE BUILD | FILENAME | NAME
|
|
|
+:------------------ | :----------------- | :------------------------
|
|
|
+17-08-1999 17:25:48 | counter-strike.exe | Half-Life Counter-Strike (2000)
|
|
|
+17-08-1999 17:25:48 | SETUP.EXE | SWAT 3: Elite Edition (2000)
|
|
|
+17-08-1999 17:25:48 | setup.EXE | Wild Wheels (2002) (aka Buzzing Cars)
|
|
|
+25-04-2000 16:37:12 | SETUP.EXE | Half-Life Game Of The Year Edition (1999)
|
|
|
+25-04-2000 16:37:12 | Setup.exe | Return to Castle Wolfenstein (2001)
|
|
|
+
|
|
|
+## Shareware
|
|
|
+
|
|
|
+A large collection of Wise installers is used to test REWise, see
|
|
|
+[tests/extended/results/README.md](tests/extended/results/README.md) for
|
|
|
+the current stats. A list of all the installer sources can be found
|
|
|
+[here](tests/extended/sources/).
|
|
|
+
|
|
|
+## Known issues
|
|
|
+
|
|
|
+ - The `ScriptDeflateOffset` isn't correct on some installers, there
|
|
|
+ are still some unknowns on how to calculate this proper.
|
|
|
+ - WiseScript `OP 0x18` is not understood.
|
|
|
+ - The code used to get the language/comp per file still has unknowns,
|
|
|
+ therefore not all installers will work, but most do.
|
|
|
+ - Installers where the inflated file size is larger then advertised,
|
|
|
+ these will not work because REWise is strict about the advertised
|
|
|
+ inflate size.
|
|
|
+ - Installers that have weird extra bytes in the WiseScriptHeader.
|
|
|
+ - Multi file/disc installers are current not supported.
|
|
|
- To determine what Wise package/version was used other then the PE build
|
|
|
- date.
|
|
|
+ date. However it looks like there is none, but:
|
|
|
On [Wikipedia](https://en.wikipedia.org/wiki/Wise_installer) is a list of
|
|
|
different Wise installer releases, comparing that list to the tested
|
|
|
installers (games) their PE build date it suggests that the
|
|
@@ -238,11 +203,33 @@ Other values that are of interest but not found yet are:
|
|
|
- WISE Installation System version 9 (2001)
|
|
|
|
|
|
|
|
|
-## Things that might be a problem
|
|
|
+### Multi-disc installers
|
|
|
+
|
|
|
+All multi-disc installers are current NOT supported.
|
|
|
+
|
|
|
+A workaround is to append the `.W02`, `.W03`, etc.. to the `setup.exe`
|
|
|
+to make it work with REWise. Example:
|
|
|
+`cat setup.exe setup.W02 setup.W03 > new_setup.exe`
|
|
|
+
|
|
|
+
|
|
|
+PE BUILD | FILENAME | NAME
|
|
|
+:------------------ | :----------------- | :------------------------
|
|
|
+25-04-2000 16:37:12 | setup.exe | Hitman Contracts (2004)
|
|
|
+25-10-2001 21:47:11 | Gothic2-Setup.exe | Gothic II (2003)
|
|
|
+
|
|
|
+
|
|
|
+#### `GOTHIC II`
|
|
|
+
|
|
|
+Would be nice to support for the use with
|
|
|
+[REGoth-bs](https://github.com/REGoth-project/REGoth-bs)
|
|
|
+or [OpenGothic](https://github.com/Try/OpenGothic).
|
|
|
+
|
|
|
+
|
|
|
+## Other things that might be a problem
|
|
|
|
|
|
- REWise is only tested on Little Endian systems.
|
|
|
- Wise installers where the PE was build before 1998 or after 2001, or
|
|
|
- installers that where created/released before 1999 or after 2003.
|
|
|
+ installers that where created/released before 1999 or after 2004.
|
|
|
|
|
|
|
|
|
# Dependencies
|
|
@@ -257,6 +244,10 @@ zlib | Zlib | https://www.zlib.net/
|
|
|
- The [WiseUnpacker project](https://github.com/mnadareski/WiseUnpacker) for
|
|
|
a great source of information.
|
|
|
- The [FragNet community](https://www.frag-net.com) for testing and feedback.
|
|
|
+ - [Archive.org](https://archive.org),
|
|
|
+ [cd.textfiles.com](http://cd.textfiles.com) and
|
|
|
+ [discmaster.textfiles.com](http://discmaster.textfiles.com), without them
|
|
|
+ all the shareware installers would not have found.
|
|
|
|
|
|
|
|
|
# Other projects
|
|
@@ -264,3 +255,11 @@ zlib | Zlib | https://www.zlib.net/
|
|
|
- https://github.com/mnadareski/WiseUnpacker
|
|
|
- https://github.com/lmop/exwise
|
|
|
- https://www.angelfire.com/ego/jmeister/hwun/
|
|
|
+
|
|
|
+# Resources on Wise
|
|
|
+
|
|
|
+ - <http://fileformats.archiveteam.org/wiki/Wise_installer_package>
|
|
|
+ - <https://web.archive.org/web/19981212034130/http://www.wisesolutions.com/>
|
|
|
+ - <https://web.archive.org/web/19990218173654/http://www.wisesolutions.com/products/demo.asp>
|
|
|
+ - <https://web.archive.org/web/19990428140855/http://wisesolutions.com/products/demo.asp>
|
|
|
+ - <https://web.archive.org/web/19990428140858/http://www.wisesolutions.com/products/demo.asp>
|