prevnext   » SZS: Wiimms SZS Tools » wstrt: Wiimms StaticR Tool

wstrt: Wiimms StaticR Tool

Wiimms StaticR Tool : Manipulate the 'main.dol' and 'StaticR.rel' files of Mario Kart Wii.

Contents

1.   Syntax

wstrt [option]... command [option|parameter|@file]...

2.   Features of wstrt

Read »Features« for features of the whole toolset.

3.   Commands

VERSION Print program name and version and exit.
HELP H Print help for commands and options.
ARGTEST This debug command accepts all kinds of parameters and prints one line for each parameter.
TEST This debugging command accepts all options and parameters and prints a list of the internal option values. The command is designed to test the option parameters. The non option parameters are completly ignored.
COLORS Ignore all parameters and print clored text for testing.
ERROR ERR Translate an exit code to a message name. If no exit code is entered, print a table with all error messages.
FILETYPE FT Scan the header of the entered files and print file type and path for each file as list.
FILEATTRIB FA Print a table with attributes for all known file types. If at least one keyword is entered, only matching file types are printed. A keyword is either a file type (like 'BRRES' or 'BMG') or one of the printed keywords (like 'ARCHIVE' or 'EXTRACT').
DUMP Dump the structure of 'StaticR.rel' (in development) and of DOL files as text.
EXTRACT X Extract the sections of a DOL file into a directory. StaticR.rel files are ignored.
TRACKS Show track infos in the order of the 'StaticR.rel' files. If no file is entered, the standard order is used.
ARENAS Show arena infos in the order of the 'StaticR.rel' files. If no file is entered, the standard order is used.
FILES List track and arena file names in machine readable format. Use the order of the entered 'StaticR.rel' files. If no file is entered, the standard order is used.
FIND Find a track or arena by keyword and print one line for each keyword in machine readable format 'type slot' or, if not found, a simple '-'. The name is searched in the entered context (tracks or arenas). If TRACK or ARENA is prefixed by a plus, then a failed search will be continued in the other context. If at least one name is not found, the tool terminates with exit code NOT_EXISTS.
POINTS PTS Print a table with the points assigned to player after a versus or room race for each entered file. If no file is entered, the standard table is used. However, if option --points is set only the resulting table is printed.
ANALYZE ANA Open 'StaticR.rel' and DOL files and analyze them. The files will be classified using SHA1 checksums.
PATCH Patch 'main.dol and 'StaticR.rel' files of Mario Kart Wii. No backup is made.

4.   Options in alphabetic order

Options
Option Param Description
--add-ctcode If source is a original main-dol file of MKWii, then append 2 sections (T2 and D8) with CT-CODE.
--all-ranks [=mode] If set to ON (default without parameter), the server query to Nintendos servers is manipulated, so that the player will find all players in online races independent of their ranking points. Value RESTORE disables this feature and restores Nintendos original query. Value NONE disables this kind of patching (default).
--allow-all Usually commands accept only options with impact to the command. All other options fire a syntax error. But if --allow-all is set, all commands accept all options.

This makes changing the command of a long command line without removing useless options easier. It also helps to override wrong option permissions.

-A --arenas arenas Define a new arena order. A comma separated list in the format [a=]b or a:=b is expected. 'a' and 'b' are arena names or slot numbers. 'a' is the destination slot and 'b' the assigned arena. If 'a' is omitted, the next slot is used; this means [a=]b,c,d is possible.

Arenas will only be exchanged so that always all arenas are assigned. But if using ':=' the new slots are assigned without exchanging and the old values are lost.

-B --brief List only the track file names and suppress table header and footer.
--bt char Reset (str is empty) or replace the second character of 'bt' to create an own online world for battles. The file StaticR.rel will be patched at 4 places.
--chdir dir Set a new working directory for all following options, for all parameters and for the command execution. This option can be used multiple times, but for parameter parsing and for command execution only the last usage is relevant. Nevertheless, '@param' values are scanned while reading the command line.
--color Force colorized text. This is the default, if an output file is a terminal. But colorized text is only supported for a few messages.
-c --const list Define constant values, that are used by the internal encoders and by the numeric options as predefined global variables. This option allows a conditional encoding of text files. It can be used multiple times for multiple definitions.

The Parameter is a comma separated list of terms and a term is 'name=expression'. The expression is calculated by the text parser.

--ct-code Enable the CT-CODE modus.
--de Use german track and arena names.
-d --dest path Define a destination path (directory/file). The destination - means: write to standard output.

The path may contain escape sequences: %Q is replaced by the fully qualified source name. %P and %F are replaced by the source path or by the filename. %N and %E are replaced by source filename without extension or by the source extension. Finally, %T is replaced by the default extension of the destination format.

A '?' direct behind '%' in %E and %T conversions avoid that the same extension is used twice in row.

-D --DEST path Like --dest, but create the directory path automatically.
--domain dom Define a domain for option --https. The default is 'wiimmfi.de'.
-E --esc char Define an alternative escape character for destination files. The default is '%'. For Windows batch files it is a good choice to set '-E$'.
--force The tools analyse input files and reject files with invalid data structures. If --force is set, little repairable issues are ignored and a warning is printed.

Option »--kmp force« does the same, but only for KMP files.

>>> THE RESULT MAY BE INVALID OUTPUT FILES! <<<

-h --help Stop parsing the command line, print a help message and exit.
--https mode Patch the https strings of REL and DOL files. 'mode' is one of the following keywords:

RESTORE restores the original URLs and domains.

HTTP replaces HTTPS requests by HTTP and sub-domain 'naswii.' by 'nas.'.

DOMAIN replace HTTPS requests by HTTP and the domain 'nintendowifi.net' by a domain specified by option --domain.

SAKE0 same as DOMAIN, but don't replace URLs with SAKE domain.

SAKE1 same as SAKE0, but replace HTTPS of SAKE domains.

PORT1 sets the domain specified by option --domain in combination with ports 90-93 (old test mode).

PORT2 is like PORT1, but it uses 'mariokartwii.DOMAIN' to replace the 'mariokartwii.race.gs.nintendowifi.net' domain.

-i --ignore Ignore non existing source files without warning.
-l --long Print long numeric message IDs instead of alternative message names like Txx, Uxx or Mxx.
--no-color Deactive colorized text. This is the default, if an output file is not a terminal.
-H --no-header Suppress the syntax information section in BMG text files.
--number If a file already exist, append a number directly before the file extension to make the filename unique. If other numbered files already exist (ignoring case), use the maximal existing index+1. --num is a short cut.
-o --overwrite Overwrite already existing files without warning and ignore option --number.
--points list This patch option defines a new table for the points assigned to players after a versus or room race. The parameter is a blank or comma and slash (next row) separated list with numbers (points) between 0 and 255 and the following keywords: NINTENDO, LINEAR, WIN, WIN15, WIN25 to select a predefined table; NO-BONUS, BONUS, NULL, ONE as options; N1..N12 to select the row for N players.
-p --preserve Preserve file times (atime+mtime) while converting or copying files.
-q --quiet Be quiet and print only error messages. Multiple usage is possible. The impact is command dependent.
-R --region region If 'region' is an unsigned number, the region for online versus play is patched to the entered number. Otherwise a keyword is expected. Official regions are: JAPAN(0), AMERICA(1), EUROPE(2), AUSTRALIA(OCEANIA,3), KOREA(4), TAIWAN(5) and CHINA(6). RESTORE restores the original Nintendo values and NONE disables region patching (default).

See http://wiimm.de/r/ctw/Custom_Track_Regions for other regions.

-r --remove-dest Remove already existing files before creating it. If set, --overwrite is ignored. --rm-dest is a short cut.
--sections Print in machine readable sections and parameter lines.
-t --test Run in test mode, modify nothing.

>>> USE THIS OPTION IF UNSURE! <<<

-T --tracks tracks Define a new track order. A comma separated list in the format [a=]b or a:=b is expected. 'a' and 'b' are track names or slot numbers. 'a' is the destination slot and 'b' the assigned track. If 'a' is omitted, the next slot is used; this means [a=]b,c,d is possible.

Tracks will only be exchanged so that always all tracks are assigned. But if using ':=' the new slots are assigned without exchanging and the old values are lost.

-u --update Create only files that do not exist. Already existing files are ignored without warning. If set, --overwrite and --remove-dest are ignored.
-v --verbose Be verbose and print more progress information. Multiple usage is possible. The impact is command dependent.
-V --version Stop parsing the command line, print a version info and exit.
--vs char Reset (str is empty) or replace the second character of 'vs' to create an own online world for versus races. The file StaticR.rel will be patched at 4 places.
--width width Define the width (number of columns) for help and some other messages and disable the automatic detection of the terminal width.
--wiimmfi Patch the files for the new custom server. It is a short cut for »--https domain --domain wiimmfi.de«.
--xhelp Stop parsing the command line and print a help message with all commands included. Exit after printing.