Wiimms SZS Tools

From Custom Mario Kart
Revision as of 16:20, 31 March 2011 by Wiimm (talk | contribs) (→‎Links)
Jump to navigation Jump to search

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 interative tools with GUI support.

wszst (Wiimms SZS Tool)

wszst is a command driven tool. Only a few commands are implemented yet; other will follow.

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 : Wiimms SZS Tool : It can list, analyze, extract and compose
        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.
  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'.

  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.

wszst LIST

The command LIST list the sub files of SZS Files.

wszst LIST|LS : List all sub files of SZS and U8 files.

Syntax: wszst LIST [source]...

Options:

  -l --long       If set, the size of each file is printed. If set
                  twice, offset and size are printed.
  -H --no-header  Suppress printing of header and footer.

wszst DECOMPRESS

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

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.

wszst COMPRESS

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

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.

wszst EXTRACT

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

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.

wszst CREATE

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

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

Tests

I have made several tests with the following files:

  • All files of Scene/UI/, but not Title.szs (does not work).
  • Some (custom) tracks of Race/Course/

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 Beta Version 0.01a of Wiimms SZS Tools':

Links