You may have wondered when looking at an assembly code C0 or C2, how to port it. You might know how to port a C2 code, same as a direct RAM write, but did you know there are sometimes hidden addresses within the code?
Let's begin!
Infinite Health Campaign [Seth@WiiPlaza]
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
Here we have Seth@WiiPlaza's code, Infinite Health Campaign (SM8E52). So, where's the address? It is different than direct RAM write codes and the F2 codetype where the address is shown in red below.
No Flash White [Bully@Wiiplaza]
F2355964 FCCB2801
38000000 00000000
In Seth's code, the address is in the assembly itself.
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
Whenever you see an 8080, most often after 3D, it is an address. Depending on whether it is on the right side or left side of the code will determine where the second half of the address is.
If you see it on the left, it will be the last 4 digits on the right.
3D808012 XXXXYYYY
Where Y is the second half of the address.
If it is on the right, it will exactly as shown above.
Now, let's put together the address:
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
3D606A6A 3D8080B3
>>80B3<<
The start of the address is on the right side, so go to the next line.
398C7999 61B6A6A
It was on the right, so this will be on the left, the last 4 digits.
>>7999<<
80B37999
Great! Now we have our address.
Open up HxD and the dump of the region of the game this code is for, and the dump of the region you want to port to.
Go to this address. Copy a bit of bytes, and search for them in the dump you are porting to. Once you find a good comparison, it is most likely a correct port. Now, all there is to it is to put the new address back into the code.
Let's say the new address is 123456.
Infinite Health Campaign [Seth@WiiPlaza]
C0000000 00000004
3D606A6A 3D808012
398C3456 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
It's as simple as that.
Thanks to Bully telling me this, you can use ASM->WiiRD, which is included with Gecko dotNET, to see if there is an address within an ASM code by seeing if there is a large number. A simple look at the code can tell you this though, as I have shown you above. This is a neat trick though, which does come in handy if you aren't too sure.
And that's pretty much all there is to it.
Sorry, if the tutorial is not really written good. I've had very little sleep the past week, 2 hours at most a night.
Anyways, hope you enjoyed! Get porting, bud!
Let's begin!
Infinite Health Campaign [Seth@WiiPlaza]
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
Here we have Seth@WiiPlaza's code, Infinite Health Campaign (SM8E52). So, where's the address? It is different than direct RAM write codes and the F2 codetype where the address is shown in red below.
No Flash White [Bully@Wiiplaza]
F2355964 FCCB2801
38000000 00000000
In Seth's code, the address is in the assembly itself.
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
Whenever you see an 8080, most often after 3D, it is an address. Depending on whether it is on the right side or left side of the code will determine where the second half of the address is.
If you see it on the left, it will be the last 4 digits on the right.
3D808012 XXXXYYYY
Where Y is the second half of the address.
If it is on the right, it will exactly as shown above.
Now, let's put together the address:
C0000000 00000004
3D606A6A 3D8080B3
398C7999 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
3D606A6A 3D8080B3
>>80B3<<
The start of the address is on the right side, so go to the next line.
398C7999 61B6A6A
It was on the right, so this will be on the left, the last 4 digits.
>>7999<<
80B37999
Great! Now we have our address.
Open up HxD and the dump of the region of the game this code is for, and the dump of the region you want to port to.
Go to this address. Copy a bit of bytes, and search for them in the dump you are porting to. Once you find a good comparison, it is most likely a correct port. Now, all there is to it is to put the new address back into the code.
Let's say the new address is 123456.
Infinite Health Campaign [Seth@WiiPlaza]
C0000000 00000004
3D606A6A 3D808012
398C3456 616B6A6A
916C54C3 4E800020
4E800020 00000000
E0000000 80008000
It's as simple as that.
Thanks to Bully telling me this, you can use ASM->WiiRD, which is included with Gecko dotNET, to see if there is an address within an ASM code by seeing if there is a large number. A simple look at the code can tell you this though, as I have shown you above. This is a neat trick though, which does come in handy if you aren't too sure.
And that's pretty much all there is to it.
Sorry, if the tutorial is not really written good. I've had very little sleep the past week, 2 hours at most a night.
Anyways, hope you enjoyed! Get porting, bud!