2 Incheckningar f921650601 ... 7c2171b108

Upphovsman SHA1 Meddelande Datum
  CYBERDEV 7c2171b108 Bump version to v0.3.0 1 månad sedan
  CYBERDEV 3f986b9d17 Small debug print fix 1 månad sedan
5 ändrade filer med 263 tillägg och 169 borttagningar
  1. 34 0
      CHANGELOG.md
  2. 142 143
      README.md
  3. 85 24
      rewise.1
  4. 1 1
      src/version.h
  5. 1 1
      src/wiseoverlay.c

+ 34 - 0
CHANGELOG.md

@@ -1,3 +1,37 @@
+# REWise v0.3.0
+
+ > Codename SHAREWARE
+
+ - Multi lingual installer support.
+ - PK installer support (installers created with the zip support option).
+ - NE support.
+ - File filters by wildcard string(s) and experimental by language
+   and/or components.
+ - Improved WiseScript.bin parsing (new/adjusted OP's).
+ - New operation `--raw-verify`, to verify raw extract.
+ - REWise will now exit with a different exit code for different errors.
+ - Strings will be interpreted as `CP1252` and converted to `UTF-8`, non
+   convertable characters will be escaped, example `0x0D` will become
+   `'_x0D'`.
+ - Debug code removed from 'normal' build, build with 'make debug' for
+   debug build.
+ - Fix segfaults due to uninitialized stuff (ouch..)
+ - The `.dib` file is fully skipped now, no extract to `/tmp` anymore.
+ - More values have been found in the overlay header, many deflated/inflated
+   file sizes. So the advertised inflate size for  `WiseScript.bin` will
+   be honored now, the extra sanity check that the inflated size should
+   not be larger then `1 MiB` is still there.
+
+There are still some issues as can seen below, to list some:
+
+ - WiseScript `OP 0x18` is not understood.
+ - The code used to get the language/comp per file still has unknowns,
+   therefore not all installer will work, but most do.
+ - 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.
+
+
 # REWise v0.2.0
 
  > Codename ZLIB

+ 142 - 143
README.md

@@ -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>

+ 85 - 24
rewise.1

@@ -1,4 +1,4 @@
-.TH rewise 1 "20 May 2023" "version 0.1.0" 
+.TH rewise 1 "16 October 2024" "version 0.3.0" 
 
 .SH NAME
 .B rewise
@@ -15,13 +15,15 @@
 .SH DESCRIPTION
 .B rewise
 Reverse Engineering Wise - The aim of this project is to extract assets from
-old game installers made with Wise installer without executing the PE file
+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.
 
-The known working Wise installers are released from 1999 to 2003, the PE build
+The known working Wise installers are released from 1999 to 2004, the PE build
 date of those installers are between 1998 and 2001.
 
+Filtering files by language or components is still experimental.
+
 
 .SH OPERATION
 Specifying an OPERATION is mandatory. Exactly one operation is allowed per
@@ -35,10 +37,10 @@ Extract files. Existing files in the OUTPUT_PATH will be overwritten!
 
 .TP
 .B -r --raw <OUTPUT_PATH>
-Extract all files in the overlay data. This does not move/rename files! The
-extra files are files only used by the installer and would not be installed
-normally. This operation is for debugging purposes. Existing files in the
-OUTPUT_PATH will be overwritten!
+Extract all files in the overlay data. Filename format will be
+`EXTRACTED_%09u`. The extra files are files only used by the installer
+and would not be installed normally. This operation is for debugging
+purposes. Existing files in the OUTPUT_PATH will be overwritten!
 
 .TP
 .B -l --list
@@ -51,8 +53,13 @@ files at the end.
 Run extract without actually outputting files, CRC32s will be checked.
 
 .TP
+.B -0 --raw-verify
+Run raw extract without actually outputting files, CRC32s will be checked.
+
+.TP
 .B -Z --script-debug
-Print parsed WiseScript.bin
+Print parsed WiseScript.bin, this is only available when compiled with
+REWISE_DEBUG.
 
 .TP
 .B -v --version
@@ -63,10 +70,50 @@ Print version and exit.
 Print help and exit.
 
 
-.SH OPTIONS
+.SH OPTIONS (--list)
+.TP
+.B -e --extended
+Also print language and component per file. Use this to see what
+language indexes and components names are available.
+
+.SH OPTIONS (--extract, --list, --verify)
+.TP
+.B -f --filter <FILTER>
+Filter files based on their filepath. Multiple of these filters may
+be set. '*' will match anything, use '\*' to escape. The matching will
+be case sensitive and non greedy.
+
+.TP
+.B -F --file-filter <FILTER_FILE>
+Read file filters from a file. One filter per line, the format is the
+same as `--filter` so the match all character '*' is also allowed.
+Line should end with only '\\n'. The maximum line length is `WIN_PATH_MAX
+* 2`, where `WIN_PATH_MAX` is `260`. The `* 2` is to support `UTF-8`,
+so in most cases the line would be no longer then `260`. When FILTER_FILE
+is a empty file, it won't do any filtering!
+
+.TP
+.B -g --language <INDEX>
+Filter files by language index, files that have not set a language will
+be included nonetheless.
+
+.TP
+.B -c --components <NAME>
+Filter files by components name, files that are not part of a component
+will be included nonetheless.
+
+
+.SH OPTIONS (--list, --script-debug)
+.TP
+.B -n --no-extract
+Don't extract anything. Use WiseScript.bin at the given TMP_PATH, it
+won't delete it.
+
+
+.SH OPTIONS (any)
 .TP
 .B -p --preserve
-Don't try to delete TMP files at TMP_PATH.
+Don't delete WiseScript.bin from TMP_PATH
 
 .TP
 .B -t --tmp-path <TMP_PATH>
@@ -75,37 +122,29 @@ be in the description of -t --tmp-path).
 
 .TP
 .B -d --debug
-Print debug info.
+Print debug info. This is only available when compiled with REWISE_DEBUG.
 
 .TP
 .B -s --silent
 Be silent, don't print anything.
 
-.TP
-.B -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. WiseScript.bin should exist
-at the TMP_PATH. The use case for this is to use a WiseScript.bin at given
-TMP_PATH with the use of -Z --script-debug or to test extracting with a custom
-WiseScript.bin.
-
 
 .SH INPUT_FILE
-The Wise installer file (.exe), this is is mandatory. A relative path is
-allowed and will be resolved.
+The Wise installer file (.exe), this is is mandatory.
 
 
 .SH EXIT STATUS
 The exit status is 0 on success, greater then zero on error.
 
+See `/src/errors.h` for specifics.
+
 
 .SH NOTES
 .IP \[bu] 2
 Path to directory OUTPUT_PATH and TMP_PATH should exist, be writable and
 of-course there should be enough free-space. There should be at-least 1 MiB of
-free-space at the TMP_PATH, for the OUTPUT_PATH with the use of --extract you
-can use --list fist to determine the required free-space. Relative paths are
-allowed and will be resolved.
+free-space at the TMP_PATH, for the OUTPUT_PATH with the use of --extract, you
+can use --list fist to determine the required free-space.
 
 .IP \[bu]
 REWise is only tested on Little Endian systems. Did you try REWise on a Big-
@@ -128,6 +167,28 @@ rewise -x /path/to/extract/files/to/ /path/to/Setup.exe
 rewise -l /path/to/Setup.exe
 .RE
 
+.B Extended list files:
+.RS 2
+rewise -le /path/to/Setup.exe
+.RE
+
+.B Extended list files with only the first language and components 'A',
+note that default files (without language or components set) will
+always be included:
+.RS 2
+rewise -le -g0 -c"A" /path/to/Setup.exe
+.RE
+
+.B List only *.pk3 for the first language:
+.RS 2
+rewise -g0 -f"*.pk3" -l /path/to/Setup.exe
+.RE
+
+.B Extracting files for language index `1`:
+.RS 2
+rewise -g1 -x /path/to/extract/files/to/ /path/to/Setup.exe
+.RE
+
 
 .SH LICENSE
 REWise is free software: you can redistribute it and/or modify

+ 1 - 1
src/version.h

@@ -18,7 +18,7 @@
 #define H_REWISE_VERSION
 
 #define REWISE_VERSION_MAJOR 0
-#define REWISE_VERSION_MINOR 2
+#define REWISE_VERSION_MINOR 3
 #define REWISE_VERSION_PATCH 0
 
 #define _STRINGIFY(x) #x

+ 1 - 1
src/wiseoverlay.c

@@ -205,7 +205,7 @@ void printOverlayHeader(WiseOverlayHeader *header)
   fprintf(stderr, "OverlayHeader.dllNameLen             : %u\n", header->dllNameLen);
   fprintf(stderr, "OverlayHeader.flags                  : ");
   printBin(&header->flags, sizeof(header->flags), "\n", stderr);
-  fprintf(stderr, "OverlayHeader.unknown_20             :");
+  fprintf(stderr, "OverlayHeader.unknown_20             : ");
   printHex(header->unknown_20, 20, "\n", stderr);
   fprintf(stderr, "OverlayHeader.inflatedSizeWiseScript : %u\n", header->inflatedSizeWiseScript);
   fprintf(stderr, "OverlayHeader.deflatedSizeWiseScript : %u\n", header->deflatedSizeWiseScript);