Difference between revisions of "Wiimms SZS Tools"

From Custom Mario Kart
Jump to navigation Jump to search
Line 11: Line 11:
 
== History ==
 
== History ==
  
 +
'''Last changes:'''
 
<pre>
 
<pre>
 
szs v0.01a.beta r2385 - 2011-03-31
 
szs v0.01a.beta r2385 - 2011-03-31
Line 28: Line 29:
 
   on file level and report mismatches for each sub file.
 
   on file level and report mismatches for each sub file.
 
</pre>
 
</pre>
 +
* [http://szs.wiimm.de/changelog.html Complete History]
  
 
== wszst (Wiimms SZS Tool) ==
 
== wszst (Wiimms SZS Tool) ==
  
 
'''wszst''' is a command driven tool.
 
'''wszst''' is a command driven tool.
Only a few commands are implemented yet; other will follow.
 
  
 
=== wszst HELP ===
 
=== wszst HELP ===
  
 
The HELP command print the built in help. Type <tt>wszst HELP</tt> for a general help. Add a command to print command specific help:
 
The HELP command print the built in help. Type <tt>wszst HELP</tt> for a general help. Add a command to print command specific help:
 
+
* [http://szs.wiimm.de/cmd/wszst/help wszst HELP]
<pre>
 
wszst : Wiimms SZS Tool : List, (de-)compress, extract and create SZS
 
        files.
 
 
 
Syntax: wszst [option]... command [option|parameter|file]...
 
 
 
Commands:
 
 
 
  VERSION          : Print program name and version and exit.
 
  HELP      | H    : Print help and exit. If the first non option is
 
                      a valid command name, then a help for the given
 
                      command is printed.
 
  TEST              : Test options: All options are allowed, some are
 
                      printed.
 
  ERROR      | ERR  : Translate exit code to message or print a table
 
                      with all error messages if not exit code is
 
                      given.
 
 
 
  LIST      | LS  : List all sub files of SZS and U8 files. If
 
                      listing a directory, then a virtual SZS file is
 
                      created (like CREATE do it) and listed.
 
  LIST-L    | LL  : List all sub files with size. 'LIST-L' is a
 
                      shortcut for 'LIST --long.
 
  LIST-LL    | LLL  : List all sub files with offset and size.
 
                      'LIST-LL' is a shortcut for 'LIST --long
 
                      --long'.
 
  LIST-LLL  | LLLL : List all sub files with offset and size in
 
                      debugging mode. 'LIST-LLL' is a shortcut for
 
                      'LIST --long --long --long'.
 
 
 
  DIFF      | CMP  : Compare two sources (each SZS, U8 or directory)
 
                      on file level and report mismatches for each
 
                      sub file.
 
  DECOMPRESS | DEC  : Decompress SZS files. The default destination
 
                      is '%P/%N.u8'.
 
  COMPRESS  | COM  : Create compressed SZS files. The default
 
                      destination is '%P/%N.szs'.
 
  EXTRACT    | X    : Extract all sub files of SZS and U8 files. The
 
                      default destination is '%P/%N.d/'.
 
  CREATE    | C    : Create SZS files by adding all files of the
 
                      directory structure. The default destination is
 
                      '%P/%N.szs'.
 
 
 
Type 'wszst HELP command' to get command specific help.
 
</pre>
 
  
 
=== wszst LIST ===
 
=== wszst LIST ===
  
 
The command '''LIST''' list the sub files of [[SZS File]]s.
 
The command '''LIST''' list the sub files of [[SZS File]]s.
 +
* [http://szs.wiimm.de/cmd/wszst/list wszst LIST]
  
 +
'''Example:'''
 
<pre>
 
<pre>
wszst LIST|LS : List all sub files of SZS and U8 files.
+
# wszst lll pool/ref/szs/Award_G.szs
  
Syntax: wszst LIST [source]...
+
* Files of pool/ref/szs/Award_G.szs
  
Options:
+
off/hex siz/hex size/dec  file or directory/
 
+
-------------------------------------------------------------------------------
  -l --long       If set, the size of each file is printed. If set
+
      -      -        -  ./
                  twice, offset and size are printed.
+
      -      -        -  ./award/
   -H --no-header Suppress printing of header and footer.
+
      -      -       - ./dpd_pointer/
 +
      -      -        -  ./message/
 +
    120    2580    9600  ./message/Common.bmg
 +
  26a0  18300    99072  ./message/Menu.bmg
 +
   1a9a0    1fc0    8128  ./message/Race.bmg
 +
      -       -       -  ./message_window/
 +
      -      -        -  ./pad_recognize/
 +
      -      -       -  ./winning_run/
 
</pre>
 
</pre>
  
 
=== wszst DIFF ===
 
=== wszst DIFF ===
  
The command '''DIFF''' compares two sources (each SZS, U8 or directory) on file level and report mismatches for each sub file.
+
The command '''DIFF''' compares two sources (each SZS, U8 or directory)
 +
on file level and report mismatches for each sub file.
 +
* [http://szs.wiimm.de/cmd/wszst/diff wszst DIFF]
  
 +
'''Example:'''
 
<pre>
 
<pre>
wszst DIFF|CMP : Compare two sources (each SZS, U8 or directory) on
+
# wszst diff pool/ref/szs/Award_G.szs pool/ref/szs/MenuMulti_G.szs
                file level and report mismatches for each sub file.
+
* Only in source #1: ./award/
 
+
* Only in source #2: ./bg/
Syntax: wszst DIFF source1 source2
+
* Only in source #2: ./button/
 
+
* Only in source #2: ./control/
Options:
+
* Only in source #2: ./globe/
 
+
* Only in source #1: ./message/Race.bmg
  -q --quiet  If set once, only a summary status is printed. If set
+
* Only in source #2: ./model/
              twice, the status is only reported as exit status.
+
Content differ: pool/ref/szs/Award_G.szs : pool/ref/szs/MenuMulti_G.szs
 
</pre>
 
</pre>
  
 
=== wszst DECOMPRESS ===
 
=== wszst DECOMPRESS ===
  
The command '''DECOMPRESS''' decompresses a [[SZS File]] and stores the decompressed data into file.
+
The command '''DECOMPRESS''' decompresses a [[SZS File]]
 
+
and stores the decompressed data into file.
<pre>
+
* [http://szs.wiimm.de/cmd/wszst/decompress wszst DECOMPRESS]
wszst DECOMPRESS|DEC : Decompress SZS files. The default destination
 
                      is '%P/%N.u8'.
 
 
 
Syntax: wszst DECOMPRESS [szs]...
 
 
 
Options:
 
 
 
  -d --dest path    Define a destination path (directory/file).
 
                      The path may contain escape sequences: %Q is
 
                    replaced by the fully qualified source name. %P
 
                    and %F are replaced by the path or by the
 
                    filename. %N and %E are replaced by filename
 
                    without extension or by the extension.
 
  -D --DEST path    Like --dest, but create the directory path
 
                    automatically.
 
  -E --esc char    Define an alternative escape character for
 
                    destination files. The default is '%'. For
 
                    Windows (CYGWIN) it is a good choice to set
 
                    '-E$'.
 
 
 
  -o --overwrite    Overwrite already existing files without warning.
 
  -r --remove-dest  Remove already existing files before creating it.
 
                    If set, --overwrite is ignored.
 
  -u --update      Create only files that do not exist. Already
 
                    existing files are ignored without warning. If
 
                    set, --overwrite and --remove-dest are ignored.
 
</pre>
 
  
 
=== wszst COMPRESS ===
 
=== wszst COMPRESS ===
  
 
The command '''COMPRESS''' compresses a binary file and creates [[SZS File]].
 
The command '''COMPRESS''' compresses a binary file and creates [[SZS File]].
 
+
* [http://szs.wiimm.de/cmd/wszst/compress wszst COMPRESS]
<pre>
 
wszst COMPRESS|COM : Create compressed SZS files. The default
 
                    destination is '%P/%N.szs'.
 
 
 
Syntax: wszst COMPRESS [source]...
 
 
 
Options:
 
 
 
  -d --dest path    Define a destination path (directory/file).
 
                      The path may contain escape sequences: %Q is
 
                    replaced by the fully qualified source name. %P
 
                    and %F are replaced by the path or by the
 
                    filename. %N and %E are replaced by filename
 
                    without extension or by the extension.
 
  -D --DEST path    Like --dest, but create the directory path
 
                    automatically.
 
  -E --esc char    Define an alternative escape character for
 
                    destination files. The default is '%'. For
 
                    Windows (CYGWIN) it is a good choice to set
 
                    '-E$'.
 
 
 
  -o --overwrite    Overwrite already existing files without warning.
 
  -r --remove-dest  Remove already existing files before creating it.
 
                    If set, --overwrite is ignored.
 
  -u --update      Create only files that do not exist. Already
 
                    existing files are ignored without warning. If
 
                    set, --overwrite and --remove-dest are ignored.
 
 
 
</pre>
 
  
 
=== wszst EXTRACT ===
 
=== wszst EXTRACT ===
  
The command '''EXTRACT''' extracts the sub file of source files and copy the files into a directory structure.
+
The command '''EXTRACT''' extracts the sub file of source files
 
+
and copy the files into a directory structure.
<pre>
+
* [http://szs.wiimm.de/cmd/wszst/extract wszst EXTRACT]
wszst EXTRACT|X : Extract all sub files of SZS and U8 files. The
 
                  default destination is '%P/%N.d/'.
 
 
 
Syntax: wszst EXTRACT [source]...
 
 
 
Options:
 
 
 
  -d --dest path    Define a destination path (directory/file).
 
                      The path may contain escape sequences: %Q is
 
                    replaced by the fully qualified source name. %P
 
                    and %F are replaced by the path or by the
 
                    filename. %N and %E are replaced by filename
 
                    without extension or by the extension.
 
  -D --DEST path    Like --dest, but create the directory path
 
                    automatically.
 
  -E --esc char    Define an alternative escape character for
 
                    destination files. The default is '%'. For
 
                    Windows (CYGWIN) it is a good choice to set
 
                    '-E$'.
 
 
 
  -o --overwrite    Overwrite already existing files without warning.
 
  -r --remove-dest  Remove already existing files before creating it.
 
                    If set, --overwrite is ignored.
 
  -u --update      Create only files that do not exist. Already
 
                    existing files are ignored without warning. If
 
                    set, --overwrite and --remove-dest are ignored.
 
</pre>
 
  
 
=== wszst CREATE ===
 
=== wszst CREATE ===
  
The command '''CREATE''' creates a [[SZS file]] by adding all files of the directory structure.  
+
The command '''CREATE''' creates a [[SZS file]]
 
+
by adding all files of the directory structure.  
<pre>
+
* [http://szs.wiimm.de/cmd/wszst/create wszst CREATE]
wszst CREATE|C : Create SZS files by adding all files of the
 
                directory structure. The default destination is
 
                '%P/%N.szs'.
 
 
 
Syntax: wszst CREATE [source_dir]...
 
 
 
Options:
 
 
 
  -d --dest path    Define a destination path (directory/file).
 
                      The path may contain escape sequences: %Q is
 
                    replaced by the fully qualified source name. %P
 
                    and %F are replaced by the path or by the
 
                    filename. %N and %E are replaced by filename
 
                    without extension or by the extension.
 
  -D --DEST path    Like --dest, but create the directory path
 
                    automatically.
 
  -E --esc char    Define an alternative escape character for
 
                    destination files. The default is '%'. For
 
                    Windows (CYGWIN) it is a good choice to set
 
                    '-E$'.
 
 
 
  -o --overwrite    Overwrite already existing files without warning.
 
  -r --remove-dest  Remove already existing files before creating it.
 
                    If set, --overwrite is ignored.
 
  -u --update      Create only files that do not exist. Already
 
                    existing files are ignored without warning. If
 
                    set, --overwrite and --remove-dest are ignored.
 
    --align size  Define an align value for the sub files in the
 
                    archive. The value must be a power of 2, the
 
                    default valus is 32 (0x20)
 
  -8 --u8          Create an uncompressed U8 file instead of a
 
                    compressed SZS file. The default destination
 
                    changes to '%P/%N.u8'.
 
  -L --logging      Print the internal file list like command
 
                    LIST-LLL.
 
</pre>
 
  
 
== Tests ==
 
== Tests ==
Line 287: Line 136:
  
 
== Links ==
 
== Links ==
 +
* [http://szs.wiimm.de/ Wiimms SZS Tools]
 
* [http://www.mariokartwii.com/f72/wiimms-szs-tools-75689.html Discussion at MarioKartWii.com]
 
* [http://www.mariokartwii.com/f72/wiimms-szs-tools-75689.html Discussion at MarioKartWii.com]
 
* [http://gbatemp.net/t286476-wiimms-szs-tools?view=findpost&p=3559819 Discussion at GBAtemp.net]
 
* [http://gbatemp.net/t286476-wiimms-szs-tools?view=findpost&p=3559819 Discussion at GBAtemp.net]

Revision as of 08:51, 2 April 2011

Introduction

Wiimms SZS Tools should be a set of different tools to manipulate SZS files. All tools are command line tools and run without any interaction. The main goal is to run them in batch files and scripts to automate recurring jobs. At this moment there is only one tool:

  • wszst : Wiimms SZS Tool

A second tool to change the content of message files is planned. Both tools together can be used to change the track names of all message files of all languages without interaction.

This toolset will not replace the SZS Modifier or SZS Explorer, because they are interactive tools with GUI support and can work directly with many sub file formats.

History

Last changes:

szs v0.01a.beta r2385 - 2011-03-31

 - new Tool: wszst (Wiimms SZS Tool)
   The following main commands are supported:
     LIST, COMPRESS, DECOMPRESS, EXTRACT, CREATE.

szs v0.01a r2392 - 2011-04-01

 - Bug fix for "wstsz CREATE": Wrong calculation of parent directory link.
 - New option: wstsz CREATE --align: Overwrite the default aligment (32=0x20).
 - wstsz LIST: If --long is set three times debugging mode is enabled.
 - wstsz LIST: If listing a directory, then a virtual SZS file is created
   (like CREATE do it) and listed.
 - New command: wszst DIFF: Compare two sources (each SZS, U8 or directory)
   on file level and report mismatches for each sub file.

wszst (Wiimms SZS Tool)

wszst is a command driven tool.

wszst HELP

The HELP command print the built in help. Type wszst HELP for a general help. Add a command to print command specific help:

wszst LIST

The command LIST list the sub files of SZS Files.

Example:

# wszst lll pool/ref/szs/Award_G.szs

* Files of pool/ref/szs/Award_G.szs

off/hex siz/hex size/dec  file or directory/
-------------------------------------------------------------------------------
      -       -        -  ./
      -       -        -  ./award/
      -       -        -  ./dpd_pointer/
      -       -        -  ./message/
    120    2580     9600  ./message/Common.bmg
   26a0   18300    99072  ./message/Menu.bmg
  1a9a0    1fc0     8128  ./message/Race.bmg
      -       -        -  ./message_window/
      -       -        -  ./pad_recognize/
      -       -        -  ./winning_run/

wszst DIFF

The command DIFF compares two sources (each SZS, U8 or directory) on file level and report mismatches for each sub file.

Example:

# wszst diff pool/ref/szs/Award_G.szs pool/ref/szs/MenuMulti_G.szs
* Only in source #1: ./award/
* Only in source #2: ./bg/
* Only in source #2: ./button/
* Only in source #2: ./control/
* Only in source #2: ./globe/
* Only in source #1: ./message/Race.bmg
* Only in source #2: ./model/
Content differ: pool/ref/szs/Award_G.szs : pool/ref/szs/MenuMulti_G.szs

wszst DECOMPRESS

The command DECOMPRESS decompresses a SZS File and stores the decompressed data into file.

wszst COMPRESS

The command COMPRESS compresses a binary file and creates SZS File.

wszst EXTRACT

The command EXTRACT extracts the sub file of source files and copy the files into a directory structure.

wszst CREATE

The command CREATE creates a SZS file by adding all files of the directory structure.

Tests

I have made several tests with the following files:

  • All files of Scene/UI/.
  • All files of Race/Course/, some of the tracks have been replaced by custom tracks before.

The tests:

  • Decompress and compress and decompress again SZS files and compare the results.
  • Extract all files, create SZS and extract again. The both extracted file system are equal.
  • Extract some of the files with SZS Explorer and compare them to my extracted files.
  • Extract all files and create a new SZS files. Then create a new ISO image with the new SZS files and play it.

Download

Download Release v0.01a of Wiimms SZS Tools:

Source / public beta:

Source / last release:

Links