# wit dump pool/nsmb/main.dol
Dump of file pool/nsmb/main.dol
Real path: .../nsmb/main.dol
File size: 354b00/hex = 3492608 = 3411 KiB
File type: DOL
Memory map of DOL file:
unused : off(beg) .. off(end) : size : section
-----------------------------------------------------------------------
: 0 .. 100 : 100 : DOL header
: 100 .. 27c0 : 26c0 : text section #0
: 27c0 .. 2e9d20 : 2e7560 : text section #1
: 2e9d20 .. 2e9d80 : 60 : data section #0
: 2e9d80 .. 2e9de0 : 60 : data section #1
: 2e9de0 .. 2ea0c0 : 2e0 : data section #2
: 2ea0c0 .. 2ea0e0 : 20 : data section #3
: 2ea0e0 .. 2fa7a0 : 106c0 : data section #4
: 2fa7a0 .. 34da80 : 532e0 : data section #5
: 34da80 .. 34ffa0 : 2520 : data section #6
: 34ffa0 .. 354b00 : 4b60 : data section #7
: 354b00 .. 354b00 : 0 : --- end of file ---
Memory map of DOL image:
unused : off(beg) .. off(end) : size : section
-------------------------------------------------------------------
.! : 80004000 .. 800066c0 : 26c0 : text section #0
!. : 80004050 .. 80004050 : 0 : entry point
: 800066c0 .. 80006720 : 60 : data section #0
: 80006720 .. 80006780 : 60 : data section #1
: 80006780 .. 802edce0 : 2e7560 : text section #1
: 802edce0 .. 802edfc0 : 2e0 : data section #2
: 802edfc0 .. 802edfe0 : 20 : data section #3
: 802edfe0 .. 802fe6a0 : 106c0 : data section #4
: 802fe6a0 .. 80351980 : 532e0 : data section #5
.! : 80351980 .. 8042ff1c : de59c : bss section
!. : 80427980 .. 80429ea0 : 2520 : data section #6
: 8042b360 .. 8042fec0 : 4b60 : data section #7
# wit dump pool/nsmb/main.dol --long
....
Delta between file offset and virtual address:
unused : off(beg) .. off(end) : size : delta : section
----------------------------------------------------------------------
: 80004000 .. 800066c0 : 26c0 : 80003f00 : text #0
: 800066c0 .. 80006720 : 60 : 7fd1c9a0 : data #0
: 80006720 .. 80006780 : 60 : 7fd1c9a0 : data #1
: 80006780 .. 802edce0 : 2e7560 : 80003fc0 : text #1
: 802edce0 .. 802edfc0 : 2e0 : 80003f00 : data #2
: 802edfc0 .. 802edfe0 : 20 : 80003f00 : data #3
: 802edfe0 .. 802fe6a0 : 106c0 : 80003f00 : data #4
: 802fe6a0 .. 80351980 : 532e0 : 80003f00 : data #5
d6000 : 80427980 .. 80429ea0 : 2520 : 800d9f00 : data #6
14c0 : 8042b360 .. 8042fec0 : 4b60 : 800db3c0 : data #7
# wit help dolpatch --width 75
wit DOLPATCH : Patch a dol file. If 'riiv_xml_file' is a single point
('.'), it is ignored. Otherwise a Riivolution XML file is
expected. It is scanned for '<memory ../>' tags as patch
rules, all others are ignored.
Each sub-command is a simple 'offset=hexstring#cond'
statement and 'hexstring' are any number of hex digits. The
optional '#cond' defines a hex string condition like the
'original=' attribute in the XML file. The patch is only
applied, if the condition match the source. Bytes of the
hex strings can be separated by spaces or points.
Syntax: wit DOLPATCH dolfile riiv_xml_file [sub_commands]...
Options:
-t --test Run in test mode, modify nothing.
>>> USE THIS OPTION IF UNSURE! <<<
-d --dest path Define a destination path (directory/file). If not set,
the source file is repalced.
-D --DEST path Like --dest, but create the directory path
automatically.
# wit dolpat nsmb/main.dol -d nsmb/res.dol nsmb/NewerSMBW.xml
+Patched: [D4] addr 802f148c+07, offset 2ed58c: 77 69 69 6d 6a 32 64 -> 4e 65 72 53 4d 42 57
-Original differ: [D4] addr 802f118c+07, offset 2ed28c: 00 00 00 00 80 31 65
-Original differ: [D4] addr 802f0fac+07, offset 2ed0ac: 00 00 00 2a 00 00 00
+Patched: [D5] addr 80328478+04, offset 324578: 80 15 bc 60 -> 80 00 18 00
-Original differ: [D5] addr 80328130+04, offset 324230: 80 15 a5 b0
-Original differ: [D5] addr 80327e98+04, offset 323f98: 72 75 5f 30
+Patched: [T1] addr 800e4a84+04, offset e0ac4: 3c 60 01 20 -> 3c 60 01 40
-Original differ: [T1] addr 800e4994+04, offset e09d4: 80 84 00 4c
-Original differ: [T1] addr 800e4914+04, offset e0954: 00 00 00 00
+Patched: [T1] addr 800b64ec+04, offset b252c: 3c 80 00 30 -> 3c 80 00 32
-Original differ: [T1] addr 800b649c+04, offset b24dc: 4e 80 00 20
-Original differ: [T1] addr 800b641c+04, offset b245c: 83 e3 00 08
+Patched: [T1] addr 801b0204+04, offset 1ac244: 54 00 ff fe -> 38 00 00 00
-Original differ: [T1] addr 801b00c4+04, offset 1ac104: 39 46 00 12
-Original differ: [T1] addr 801afed4+04, offset 1abf14: 83 a1 00 44
+Patched: [T1] addr 8015d850+04, offset 159890: 38 60 00 00 -> 4e 80 00 20
-Original differ: [T1] addr 8015d710+04, offset 159750: 40 82 00 40
-Original differ: [T1] addr 8015d520+04, offset 159560: 81 9e 00 74
+Patched: [T1] addr 800e4e84+04, offset e0ec4: 38 63 33 0c -> 38 60 00 00
-Original differ: [T1] addr 800e4d70+04, offset e0db0: 90 7f 00 4c
-Original differ: [T1] addr 800e4cf0+04, offset e0d30: 41 82 00 1c
!Can't patch: Range outside dol: addr 80001800+968
* Save patched DOL to: nsmb/res.dol
@Wiimm: Why is there a "!Can't patch: Range outside dol: addr 80001800+968" in the output? Does the patched dol for sure work without it? Also, does the dolpatch function handle <memory> tags with valuefile attributes?
Anyway, thanks for developing this feature. Definitely more convenient than hex editing the files by hand.
<memory offset="0x80001800" valuefile="Loader.bin" />
wit v2.21a r4489 - 2013-06-15
- The default image format switched from WDF to WBFS. This is only relevant,
if no image type is specified by source, option or file extension, for
example for the command "wwt EXTRACT".
- wit DUMP --long: If dumping a DOL file, a third table with delta values
between the virtual address and the file offset is printed.
- New command: wit DOLPATCH: Patch a DOL file by reading a Riivolution XML
file and scanning all memory tags.
-> Read http://wit.wiimm.de/cmd/wit/dolpatch for details.
- If extracting an image, the file 'setup.txt' contains now a new parameter:
"image-type = TYPE". It shows the image type of the source image.
If cretaing an image and file 'setup.txt' contains this paramater with a
valid image type, this image type is used as default for the new created
image. The default is superseded by format options and file extensions.
This feature is dedicated to patching scripts. If an original image is
extracted with "wit extract -1n ANYID6 . WORKDIR --psel data" and then
patched, an image with identical image type as the original can be created
by the command: wit copy WORKDIR %x --id NEWID6 --name "new title of game"
- For easier script/batch support, the files "setup.sh" and "setup.bat" are
created for extracted images. They contain similar info as "setup.txt", but
can be directly included by ". ./PATH/setup.sh" or "CALL ./PATH/setup.bat"
to get the settings as script variables.
C:\Users\Desktop\wit-v2.21a-r4489-cygwin>C:\Users\Desktop\wit-v2.21a-r
4489-cygwin\Cannon_Super_Mario_Bros._Wii_v1.1\wit\wit.exe dolpatch C:\Users
\Desktop\wit-v2.21a-r4489-cygwin\Cannon_Super_Mario_Bros._Wii_v1.1\main.dol C:\U
sers\Desktop\wit-v2.21a-r4489-cygwin\Cannon_Super_Mario_Bros._Wii_v1.1\riiv
olution\CannonE.xml
cygwin warning:
MS-DOS style path detected: C:\Users\Desktop\wit-v2.21a-r4489-cygwin\Cann
on_Super_Mario_Bros._Wii_v1.1\main.dol
Preferred POSIX equivalent is: /main.dol
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
! wit: Missing '=':
! C:\Users\Desktop\wit-v2.21a-r4489-cygwin\Cannon_Super_Mario_Bros._W
! ii_v1.1\riivolution\CannonE.xml
* DOL not modified: C:\Users\Desktop\wit-v2.21a-r4489-cygwin\Cannon_Super_M
ario_Bros._Wii_v1.1\main.dol
thanksThe xml file must be prefixed by XML= to distinguish it from other commands.
xml=C:/path/to/CannonE.xml
And try to use relative pathes. YOu can use them if you "cd" to the working directory.
One point for clearness:
My tool can neither modify the loader.bin like DMM has made it nor create a new text section for the loader. This is special to NEWER SMBW and must be done by hand and knowledge.
Are the patches also the same?so cannon would be the same since it uses a loader.bin as well
Are the patches also the same?
Then use the main.dol patched by damysteryman.
<?xml version="1.0"?>
-<wiidisc log="true" root="/NewerSMBW" shiftfiles="true" version="1">-<id game="SMN"><region type="P"/><region type="E"/><region type="J"/></id>-<options>+<section name="Newer SMBW">--</options>-<patch id="newercore"><savegame clone="false" external="/save/{$__gameid}{$__region}"/><folder external="Tilesets" create="true" disc="/Stage/Texture"/><folder external="TitleReplay" create="true" disc="/Replay/title"/><folder external="BGs" create="true" disc="/Object"/><folder external="SpriteTex" create="true" disc="/Object"/><folder external="Layouts" create="true" disc="/Layout"/><folder external="Music" create="true" disc="/Sound/new"/><folder external="Music/sfx" create="true" disc="/Sound/new/sfx"/><folder external="Music/stream" create="true" disc="/Sound/stream"/><folder external="Music/rsar" disc="/Sound"/><folder external="Font" disc="/EU/EngEU/Font"/><folder external="Font" disc="/EU/FraEU/Font"/><folder external="Font" disc="/EU/SpaEU/Font"/><folder external="Font" disc="/EU/ItaEU/Font"/><folder external="Font" disc="/US/EngUS/Font"/><folder external="Font" disc="/US/FraUS/Font"/><folder external="Font" disc="/US/SpaUS/Font"/><folder external="Font" disc="/JP/Font"/><folder external="Message" disc="/EU/EngEU/Message"/><folder external="Message" disc="/EU/FraEU/Message"/><folder external="Message" disc="/EU/SpaEU/Message"/><folder external="Message" disc="/EU/ItaEU/Message"/><folder external="Message" disc="/US/EngUS/Message"/><folder external="Message" disc="/US/FraUS/Message"/><folder external="Message" disc="/US/SpaUS/Message"/><folder external="Message" disc="/JP/Message"/><folder external="NewerRes" create="true" disc="/NewerRes"/>
<!-- <folder external="CS" disc="/CS" create="true" /> -->
<folder external="LevelSamples" create="true" disc="/LevelSamples"/><folder external="Others"/><folder external="Others{$__region}"/><folder external="Maps" create="true" disc="/Maps"/><folder external="Maps/Texture" create="true" disc="/Maps"/><folder external="Stages" create="true" disc="/Stage"/>
<!-- Save name change -->
<!--PAL-->
<memory original="7769696D6A3264" value="4E6572534d4257" offset="0x802F148C"/>
<!--NTSC-->
<memory original="7769696D6A3264" value="4E6572534d4257" offset="0x802F118C"/>
<!--JPN-->
<memory original="7769696D6A3264" value="4E6572534d4257" offset="0x802F0FAC"/>
<!-- Inject Newer loader -->
<!--PAL-->
<memory original="8015BC60" value="80001800" offset="0x80328478"/>
<!--NTSC-->
<memory original="8015BB20" value="80001800" offset="0x80328130"/>
<!--JPN-->
<memory original="8015B930" value="80001800" offset="0x80327E98"/>
<!-- Expand ArchiveHeap -->
<!--PAL-->
<memory original="3C600120" value="3C600140" offset="0x800E4A84"/>
<!--NTSC-->
<memory original="3C600120" value="3C600140" offset="0x800E4994"/>
<!--JPN-->
<memory original="3C600120" value="3C600140" offset="0x800E4914"/>
<!-- Expand 2DHeap -->
<!--PAL-->
<memory original="3C800030" value="3C800032" offset="0x800B64EC"/>
<!--NTSC-->
<memory original="3C800030" value="3C800032" offset="0x800B649C"/>
<!--JPN-->
<memory original="3C800030" value="3C800032" offset="0x800B641C"/>
<!-- Force non-Japanese font -->
<!--PAL-->
<memory original="5400FFFE" value="38000000" offset="0x801B0204"/>
<!--NTSC-->
<memory original="5400FFFE" value="38000000" offset="0x801B00C4"/>
<!--JPN-->
<memory original="5400FFFE" value="38000000" offset="0x801AFED4"/>
<!-- Title screen fixes -->
<!--PAL-->
<memory original="38600000" value="4E800020" offset="0x8015D850"/>
<!--NTSC-->
<memory original="38600000" value="4E800020" offset="0x8015D710"/>
<!--JPN-->
<memory original="38600000" value="4E800020" offset="0x8015D520"/>
<!-- Disable debug key sequence -->
<!--PAL-->
<memory original="3863330C" value="38600000" offset="0x800E4E84"/>
<!--NTSC-->
<memory original="3863300C" value="38600000" offset="0x800E4D70"/>
<!--JPN-->
<memory original="38632E2C" value="38600000" offset="0x800E4CF0"/>
<!-- Common -->
<memory offset="0x80001800" valuefile="Loader.bin"/></patch></wiidisc>
<?xml version="1.0"?>
-<wiidisc log="true" shiftfiles="true" version="1">-<id game="SMN"><region type="E"/></id>-<options>-<section name="New Mario Bros Cannon">-<option name="New Mario Bros Cannon" default="1" id="Cannon">-<choice name="Enabled"><patch id="Cannon"/></choice></option></section></options>-<patch id="Cannon" root="/Cannon"><savegame clone="false" external="/Cannon/save/{$__gameid}{$__region}"/><folder external="Stage/Texture" create="true" disc="/Stage/Texture/"/><folder external="NewerRes" create="true" disc="/NewerRes/"/><folder external="Stage" create="true" disc="/Stage/"/><folder external="Lang"/><folder external="Stage"/><folder external="MessageEN"/><folder external="Sound/stream/"/><folder external="Layout/textures/"/><folder external="Layout/sequenceBG/"/><folder external="Layout/preGame/"/><folder external="Layout/staffCredit/"/><folder external="Sound"/><folder external="WorldMap"/><folder external="Env"/><folder external="MovieDemo"/><folder external="Object" create="true" disc="/Object/"/><folder external="OpeningE"/><memory original="3C600120" value="3C600140" offset="0x800E4914"/><memory original="3C600120" value="3C600140" offset="0x800E4994"/><memory original="3C600120" value="3C600140" offset="0x800E4A84"/><memory original="8015BB20" value="80001800" offset="0x80328130"/><memory original="8015BC60" value="80001800" offset="0x80328478"/><memory offset="0x80001800" valuefile="Loader.bin"/></patch></wiidisc>
wit v2.22a r4516 - 2013-06-22
- Command "wit DOLPATCH" accepts now more commands and is able to create new
TEXT and DATA sections.
-> Read http://wit.wiimm.de/cmd/wit/dolpatch for details.
- New option: --tt-id=ID: This is a short cut for `--ticket=ID --tmd=ID´.
If TICKET and TMD differ, the game will freeze after loading. So it make
sense to change only TICKET and TMD IDs together.
- Bug fix, if using "wit COPY --name discname" and the destination is %X or
similar: The new discname is now used to create the filename.