prevnext   » SZS: Wiimms SZS Toolset » wstrt: Wiimms StaticR Tool » wstrt where

wstrt where

A list of addresses in hex format is expected as input. The segments in which the specified addresses are located is calculated for each region. The result is output as a human and machine readable table.

This command is well suited to converting addresses into file offsets and vice versa.


1.   Syntax

wstrt WHERE address...

2.   Options

Option Param Description
--order pujk The parameter is scanned for the first appearance of letters P (for PAL), U (USA), J (JAPAN) and K (KOREA) to define the order of the output. Case is ignored. Missing letters are added automatically. The default is 'PUJK'.
-0 --no-0x Suppress 0x prefix of hex numbers. This is the default for cheat codes.
-U --upper Print digits A-F of hex numbers in upper case. This is the default for cheat codes.
-H --no-header Suppress the table header and footer and output exactly 1 line for each specified address. This makes the output more machine-readable.
-B --brief Same as --no-header.
-l --long Print file offsets too.

3.   Description

The command expects a list of keywords and addresses in hexadecimal notation with or without 0x prefix.

Keywords are PAL, USA, JAPAN, KOREA, or any abbreviation of them. The case of the keywords is not relevant. They select the region for following file offsets. The region can be changed in the middle of the command line. If the region is not specified, PAL is used.

The hex numbers are interpreted as addresses independent of the active region, or as file offsets dependent of the active region. If the number begins with M or m, then it is interpreted as an offset for file main.dol. If the number begins with S or s, then it is interpreted as an offset for file staticr.rel. If a number with exactly 6 digits and without the 0x prefix is entered, the value 0x80000000 is added. This makes it easier to check cheat codes, where often only 6 digits are used for the address.

In addition, a single minus sign is accepted to display a separating line.

The result is output as a human and machine readable table. Option --no-header (short: -H) improves machine-readability. Option --no-0x (short: -0) suppresses the output of the 0x prefix. Option --upper (short: -U) forces upper case letters in hex numbers. If option --long (short: -l) is set, the file offsets are printed too.


$ wstrt where -l0 0 1234 - 80004000 80006460 80006a20 800072c0 \
	80244de0 - 805102e0   s0x3cd000 usa s0x3cd000 - \
	817fffff 91234567 d1000000 cd000100

# Address   PAL  offset : USA  offset : JAP  offset : KOR  offset
	0:  null      - : null      - : null      - : null      -
     1234:  inva      - : inva      - : inva      - : inva      -
 80004000:  T0      100 : T0      100 : T0      100 : T0      100
 80006460:  D0   240080 : D0   23ffe0 : D0   23ffa0 : D0   240400
 80006a20:  D1   240640 : D1   2405a0 : D1   240560 : D1   2409c0
 800072c0:  T1     2560 : T1     2560 : T1     2560 : T1     2560
 80244de0:  D2   240ee0 : D2   240ee0 : MEM1      - : T1   240080
 805102e0:  RELH      0 : REL1   4380 : REL1    680 : REL1  11fe0
 808dd2e0:  REL5 3cd000 : RELX 3d1380 : RELX 3cd680 : RELX 3defe0
 808d8f60:  REL5 3c8c80 : RELX 3cd000 : REL5 3c9300 : RELX 3dac60
 817fffff:  MEM1      - : MEM1      - : MEM1      - : MEM1      -
 91234567:  MEM2      - : MEM2      - : MEM2      - : MEM2      -
 d1000000:  mem2      - : mem2      - : mem2      - : mem2      -
 cd000100:  GPU       - : GPU       - : GPU       - : GPU       -
Sections T1–T2, D0–D7 and BSS are defined by file main.dol and RELH, REL1–REL5 and RELX by file StaticR.rel. HEAD, MEM1, MEM2 and GPU are part of memory outside from main.dol and StaticR.rel. Sections in uncached mirrored memory are printed in lower case. inva means invalid and null what it says.

Screenshot of above with colors:

Colorized output example

4.   Memory Map

Name Begin End Size Description
HEAD 80000000 80003fff 4000 16 KiB Memory 1: Management data before main.dol.
MEM1 80004000 817fffff 17fc000 24 MiB Memory 1: main.dol (T0–T1, D0–D7 and BSS) is loaded to the beginning and StaticR.rel (RELH, REL1–REL5 and RELX) somewhere behind.
MEM2 90000000 93ffffff 4000000 64 MiB Memory 2
c0000000 c17fffff 1800000 24 MiB Uncached mirror of Memory 1.
mem2 d0000000 d3ffffff 4000000 64 MiB Uncached mirror of Memory 2.
GPU cd000000 cd007fff 8000 32 KiB Hollywood (GPU and more) registers.