This is a first idea. I have no time or interests to do it, but I 'll show you a way, how it could be done.
How to:
First we look inside main.dol, using "wit DUMP" (wit is more than an image tool):
The second table shows the virtual addresses of a loaded/running image, divided into sections. The first table shows the related offsets of the file.
Let us analyse a singe <memory> tag (PAL):
800E4E84 lays in "text section #1" at offset 800E4E84-80006780 = DE704. The first table says, the file offset is 27C0+DE704 = E0EC4. Let us look into a hexdump of main.dol:
We find the value of attribute "original=" at the offset. Replace it by 38600000, and this single patch is done.
Now do this patch with all memory tags.
Patch the loader
The only problem, I see is:
I don't know, what to do with this. it is loaded before main.dol. Is it the IMGLOADER.BIN? The file "Loader.bin" is available in the newer distrib.
How to:
- Extract image: wit extract nsmb.wbfs nsmb.d
- Replace and copy new files to nsmb.d/files/... following the instructions of the XML file.
- Patch main.dol (see below).
- Patch the loader (see below).
- Create a new image with:
wit copy nsmb.d -ovv newer-smb.wbfs --id=K --name "Newer SMB"
First we look inside main.dol, using "wit DUMP" (wit is more than an image tool):
Code:
# wit dump fst/nsmb.d/sys/main.dol
Dump of file fst/nsmb.d/sys/main.dol
File size: 354b00/hex = 3492608 = 3411 KiB
File type: DOL
Memory map of DOL file:
: off(beg) .. off(end) : size : info
----------------------------------------------------------
: 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:
: off(beg) .. off(end) : size : info
--------------------------------------------------------
: 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
Let us analyse a singe <memory> tag (PAL):
Code:
<memory offset="0x800E4E84" value="38600000" original="3863330C" />
Code:
e0ec0: 3c 60 80 2f 38 63 33 0c 48 1f 29 19 38 60 00 3f :<`./8c3.H.).8`.?:
^^^^^^^^^^^
Now do this patch with all memory tags.
Patch the loader
The only problem, I see is:
Code:
<memory offset="0x80001800" valuefile="Loader.bin" />