How to Create Activators & Deactivators for Codes
#1
How to Create Activators & Deactivators for Codes

Requirements:
- Hex Editor**
- RAM Dump for whatever version of MKWii you play on***

**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 as HxD is natively for Windows.

***If you don't have RAM Dumps, contact me via discord (zakmkw#8365)



For this guide we will use the NTSC-U Instant Item Boxes Code (048153C8 60000000). We want the ability to turn the code on/off at will. There must be some extra lines of code added to make this possible. 

First thing's first. We need an activator. The activator (controller) line for all versions of MKWii (except NTSC-K/RMCK01) is 2834XXXX YYYYZZZZ. NTSC-K uses 2833XXXX YYYYZZZZ. The activator line (for most codes) goes on the very top. Currently our unfinished code looks like this ---

2834XXXX YYYYZZZZ
048153C8 60000000

This code will not work at all. We could add what is known as a 'Final Terminator' which would then allow us to turn on the code, but we need a way to turn off the code too. To achieve this we now need to add a 'Halfway Terminator'. The code line for that is E0000000 00000000. After that, add another 2834XXXX YYYYZZZZ controller line. Let's look at our current progress ---

2834XXXX YYYYZZZZ
048153C8 60000000
E0000000 00000000
2834XXXX YYYYZZZZ

You're probably thinking we can now add the Instant Item Box code again then finish it off with a Final Terminator. That won't work. We need to create and add a new line of code. This new line of code will contain the default instruction of the Instant Item Box Code. This is done with a few steps. First we need to get the code's RAM (memory) address. The new line of code will be a 32 bit RAM Write. So the first half of this new line will be 048153C8. To find out what the second half (default instruction) of code is, let's open up the hex editor.

Open your hex editor and open the RAM Dump file that matches your version of your MKWii Code. Since our code is for NTSC-U, we will obviously open the NTSC-U RAM dump.bin file. Now we will convert the first half of the Instant Item Box Code into its code RAM (memory) address. This is simple, just take off the first two numbers. You should have the following hex number---

8153C8

Press CTRL+G, this will make a prompt appear to search for an address, enter in the 8153C8. Make sure value type is in Hex. Your cursor will be navigated down to the address of 8153C8 (row 8153C0 on column 8). 

Starting where your cursor is, the very first 4 bytes (8 digits) is the default instruction.

If you did everything correctly, your default instruction value should be 901B00B0. Alright now add the '048153C8 901B00B0' after the second 2834XXXX YYYYZZZZ line. And finish it off with a Final Terminator (E0000000 80008000). The finished code looks like this...

2834XXXX YYYYZZZZ <-- Controller Line to Activate Code
048153C8 60000000 <-- The Code Itself
E0000000 00000000 <-- Halfway Terminator
2834XXXX YYYYZZZZ <-- Second Controller Line to Deactivate Code
048153C8 901B00B0 <-- Default Instruction of Code
E0000000 80008000 <-- Final Terminator

If you are wondering how to configure the code to use the same button for the activator and deactivator, this is simple. Simply Remove the Halfway Terminator & Second Controller Line. Then replace that with 'CC000000 00000000'. Code looks like this ---

2834XXXX YYYYZZZZ
048153C8 60000000
CC000000 00000000
048153C8 901B00B0
E0000000 80008000

If you don't know what those XYZ values are and/or need to learn how to fill them out, please visit this thread - HERE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)