How to Port Codes to other Regions
#1
How to Port Codes to other Regions

Requirements:
- Hex Editor**
- RAM Dumps*** (you will need at least the RAM Dump of the region you are porting from and the region you are porting to)

**I recommend HxD. HxD is used in this guide. You can find it very easily on a google search for free download. If you are a Linux User, you will need Wine emulation to run HxD.

***Regarding RAM Dumps: If you have Dolphin Emulator, look at this thread HERE. If not, run this code HERE on your Wii.





Chapter 1: Introduction

We will start off with the NTSC-U Show Item Early Code, we want to port the code to PAL.

I chose the Show Item Early Code for this guide since ASM (C2 type) codes are not as simple as 32-bit (04 type) codes but still easy enough for any beginner to grasp quickly. Basically in 95% of all codes, the C2 and 04 lines are what need to be ported. All other lines remain the same. There are other codes where this isn't the case but this guide is meant for beginners.



Chapter 2: Finding Location of Code's Address in RAM

Open HxD and open your RAM Dump file for NTSC-U. We always start off with the RAM Dump version that matches the region of code we are starting with.

So our NTSC-U Show Item Early code is...
C27AB9D4 00000002
807F0020 907F001C
60000000 00000000

What we want to do is find the RAM Address (offset & column location) where the Code is at. To figure this out simply take out the first 2 digits off the first line (the C2 line) of the code. The other lines in the code are to left . If you did the conversion correctly, you should come up with a RAM address value of...

7AB9D4

On you hex editor, press CTRL+G. a prompt will appear to enter in an offset to search for, paste in that number and be sure number/data type is in Hexadecimal (Hex)

Click OK and HXD will navigate you to row address 007AB9D0 under column 4. The last digit of a code's RAM address is the column number value on the hex editor. You can also you use this conversion in reverse to change a RAM row+column location to a code address which is what we will do later in the guide.



Chapter 3: String Searching

What you need to do is highlight the first 4 bytes (8 digits) of code beginning where your cursor was navigated to. If done correctly you should have highlighted the following hex string...

90 7F 00 1C

Highlight the 90 7F 00 1C and type CTRL+C.

Now open up your PAL RAM dump file, HxD will add it as a new tab. You should automatically be in the PAL Ram dump now, if not click on the tab to view it.

Now type CTRL+F and a prompt will appear. For the "Search for" field, paste in what you just copied. Change datatype to Hex. Click OK.

If done correctly, you will be brought to offset 000F4410 under column C. Right off the bat, I will you that this is the wrong address. When comparing the address of one region to another, if the margin of difference is huge, then it's a high chance that you ported to the wrong address. If we used this 000F4410 offset column C, our PAL code's C2 line would be converted to C20F441C, which is a Huge difference compared to the USA Code which means it's obviously wrong. 

There are many instances where a 4 byte string of hex is repeated in MKWii RAM. Sometimes, you only need to use a 4 byte string to find your address, other times you may need to copy something as long as 32 bytes. It all depends on the code.

Lets go back to our NTSC-U RAM Dump file. This time highlight the first 12 bytes (24 digits of code). You should have a hex string of...

90 7F 00 1C 88 1F 00 2D 2C 00 00 00

Copy that string. Go back to PAL RAM Dump file. Hit CTRL+F, paste in the new 12 byte string. However, we want to change search direction from "Forward" to "All". Since we searched in PAL RAM earlier, we are no longer at the very beginning of the PAL RAM Dump file. So we need the "All" search direction to tell HxD to search both ways from out current spot in PAL RAM. Click OK.

You will be navigated to the row of 007BA430 under Column 04. If we convert that to a usable C2 address , we get C27BA434. As you can see, this is slightly different than the USA address. Chances are, this address is the correct one. What you want to also do is compare the surrounding random numbers of both RAM Dumps, they should be very identical (doesn't have to be exactly the same). If it is, there's a very good chance the address is correct. So now you have the C2 line for PAL, complete the rest of the code....

PAL Show Item Early
C27BA434 00000002
807F0020 907F001C
60000000 00000000



Chapter 4: Testing; Conclusion

After porting any code, always be sure to test it. If your tests fail, go back to the hex editor and try to re-port the code.
Reply
#2
Thank you very much for tihs Tutorial. Now I have a Question.

I have ported many codes of this Forum with port files from the Internet. But now I have seen that my korean dump file contains very small content. Some non-standard ports are not possible yet. Is there any other way to get RAM dumps besides dumping with the RAM viewer?

Thank you already for the Answer.
Reply
#3
Dumping with the RAM viewer as in Aldelaro's program? You must mean using Dolphin's memory viewer.

https://mkwii.com/showthread.php?tid=1141

You want your RAM Dumps to be as similar as possible. The Korean game is just different than all other regions by default so having differences per Dump should be kept to a minimum.

Delete all your Data Saves, Make new ones. Make all 4 new licenses for every data save. Use a diff mii for each license. And make sure each mii for its license slot is the same for each data save.

Make a RAM dump of each region while being idle on online after connecting for the first time on said data save. For the online connect use the same particular license each time.

And also, only have the ALTWFC code (no ssl + domain changer) applied for each region when online. No extra codes or diff codes per game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)