• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Hex Format For Codes: How to Add and Get Codes from a Compiled GCT

illinialex24

Smash Hero
Joined
May 23, 2008
Messages
7,489
Location
Discovered: Sending Napalm
Note: Any person with any experience with coding will know this, I just chose to make a thread on this so the average user could do this easily. If you need a Hex Editor so you can compile your own (this is meant for Brawl), use this Hex Editor:

Note: This didn't come out as easily as I would have hoped, but people still could make use of it. Anyway, it should help people. I've know this for a while and others have known this forever, but most don't.

http://mh-nexus.de/en/hxd/

Free and good.

Introduction

This will tell you how to export codes manually even if you don't have a code compiler, how to add codes to a pre-export .gct file, and how to extract codes from a pre-export .gct file.

Basic

Now to business.

Code:
No Stale Moves [spunit262]
02FC0988 00130000
Now, the compiled Hex is:

Code:
00 D0 C0 DE 00 D0 C0 DE 02 FC 09 88 00 13 00 00 
F0 00 00 00 00 00 00 00
Pretty short code. Lets try a 2 line code:

Code:
Unrestricted pause camera [Link, original Y.S.]
040A7D60 4E800020
04109D88 38800001
Now, the compiled Hex is:

Code:
00 D0 C0 DE 00 D0 C0 DE 04 0A 7D 60 4E 80 00 20
04 10 9D 88 38 80 00 01 F0 00 00 00 00 00 00 00
Looking Deeper

Notice anything similar?? The first 8 hex values and last 8 hex values are the same.

So for the unrestricted pause camera, we have this:

Code:
[COLOR="Red"]00 D0 C0 DE 00 D0 C0 DE[/COLOR] [COLOR="Blue"]04 0A 7D 60 4E 80 00 20
04 10 9D 88 38 80 00 01[/COLOR] [COLOR="DarkOrange"]F0 00 00 00 00 00 00 00[/COLOR]
Compare the blue to the actual code of the file:

Code:
Unrestricted pause camera [Link, original Y.S.]
040A7D60 4E800020
04109D88 38800001
Notice how its the exact same.

Every Wii code is stored like this, 8 specific hex values, the codes dumped directly in, and then the last 8 hex values.

Applications

In short, it means that every code is stacked end to end one after another. For example, the two codes export together would look like this (No stale moves, unrestricted pause camera):

Code:
[COLOR="Red"]00 D0 C0 DE 00 D0 C0 DE[/COLOR] [COLOR="SeaGreen"]02 FC 09 88 00 13 00 00[/COLOR] 
[COLOR="Blue"]04 0A 7D 60 4E 80 00 20 04 10 9D 88 38 80 00 01[/COLOR]
[COLOR="DarkOrange"]F0 00 00 00 00 00 00 00[/COLOR]
Essentially, if you know what codes are in a .gct but don't know what specific values were given to them, you can easily use this to find the hex and then therefore find out what the specific code values were. This can be quite useful for large codes that deal with multiple characters that will overwrite the same code with different values so you can create a composite. For example, you could play as Doctor Mario and Roy at the same time in the 4.1B unofficial codeset.

Also, it makes it very useful to add things.

For example, lets say I had a pre-exported code with a default settings modifier, a 2.1a file replacement code, and an infinite pause camera.

Now, we need to do 2 things. First we need to modify it so the default settings modifier goes to 3 stocks instead of 4 and we also need to add a disable custom stages code because they are using Comex's exploit.

Now here is the exported Hex for the original:

Code:
00 D0 C0 DE 00 D0 C0 DE 24 49 4A 98 80 00 00 00
20 52 33 00 00 00 00 00 04 52 33 00 DE AD BE EF
42 00 00 00 90 00 00 00 04 17 F3 60 00 00 01 04
04 17 F3 64 04 02 0A 00 04 17 F3 68 08 01 01 01
04 17 F3 6C 01 00 00 00 E0 00 00 00 80 00 80 00
22 56 64 EC 00 00 00 00 04 01 BF E0 48 58 BE 20
06 5A 7E 00 00 00 00 70 38 A0 00 67 38 81 00 20
3C E0 80 5A 60 E3 7C 18 4B E5 25 31 38 A0 00 7F
38 83 FF E8 38 61 00 20 4B E5 25 21 38 A0 00 68
60 E4 7C 18 38 61 00 20 94 21 FF 80 BC 41 00 08
38 61 00 88 4B A7 4D B9 7C 7C 1B 78 2C 03 00 00
40 82 00 0C 38 21 00 80 48 00 00 1C B8 41 00 08
38 21 00 80 4B E5 24 E5 38 61 00 08 4B A7 42 E1
7C 7C 1B 78 4B A7 41 E8 04 01 CD 0C 48 58 B1 F4
06 5A 7F 00 00 00 00 18 2C 03 00 00 41 82 00 0C
4B A7 DD 51 48 00 00 08 80 78 00 0C 4B A7 4D FC
04 3E E9 D8 48 00 00 14 04 3E EB D4 48 00 00 14
04 3D 8B 9C 48 00 00 18 04 3E 9B 4C 38 60 00 00
04 3E 9D 38 38 60 00 00 04 3D 8C 80 60 00 00 00
80 00 00 00 80 40 69 20 80 00 00 01 80 5A 7C 00
8A 00 10 01 00 00 00 00 04 5A 7C 10 2F 52 53 42
04 5A 7C 14 45 2F 70 66 E0 00 00 00 80 00 80 00
04 0A 7D 60 4E 80 00 20 04 10 9D 88 38 80 00 01
F0 00 00 00 00 00 00 00
First, we are going to have to locate the default settings modifier inside so we should find every code inside:


Code:
[COLOR="Red"]00 D0 C0 DE 00 D0 C0 DE[/COLOR] [COLOR="Blue"]24 49 4A 98 80 00 00 00
20 52 33 00 00 00 00 00 04 52 33 00 DE AD BE EF
42 00 00 00 90 00 00 00 04 17 F3 60 00 00 01 04
04 17 F3 64 04 02 0A 00 04 17 F3 68 08 01 01 01
04 17 F3 6C 01 00 00 00 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkRed"]22 56 64 EC 00 00 00 00 04 01 BF E0 48 58 BE 20
06 5A 7E 00 00 00 00 70 38 A0 00 67 38 81 00 20
3C E0 80 5A 60 E3 7C 18 4B E5 25 31 38 A0 00 7F
38 83 FF E8 38 61 00 20 4B E5 25 21 38 A0 00 68
60 E4 7C 18 38 61 00 20 94 21 FF 80 BC 41 00 08
38 61 00 88 4B A7 4D B9 7C 7C 1B 78 2C 03 00 00
40 82 00 0C 38 21 00 80 48 00 00 1C B8 41 00 08
38 21 00 80 4B E5 24 E5 38 61 00 08 4B A7 42 E1
7C 7C 1B 78 4B A7 41 E8 04 01 CD 0C 48 58 B1 F4
06 5A 7F 00 00 00 00 18 2C 03 00 00 41 82 00 0C
4B A7 DD 51 48 00 00 08 80 78 00 0C 4B A7 4D FC
04 3E E9 D8 48 00 00 14 04 3E EB D4 48 00 00 14
04 3D 8B 9C 48 00 00 18 04 3E 9B 4C 38 60 00 00
04 3E 9D 38 38 60 00 00 04 3D 8C 80 60 00 00 00
80 00 00 00 80 40 69 20 80 00 00 01 80 5A 7C 00
8A 00 10 01 00 00 00 00 04 5A 7C 10 2F 52 53 42
04 5A 7C 14 45 2F 70 66 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkOrange"]04 0A 7D 60 4E 80 00 20 04 10 9D 88 38 80 00 01[/COLOR]
[COLOR="Green"]F0 00 00 00 00 00 00 00[/COLOR]
So the blue is the default settings modifier, and it normally looks like this (the generic code):

Code:
Default Settings Modifier[Igglyboo, Brkirch, and FMK]
24494A98 80000000
20523300 00000000
04523300 DEADBEEF
42000000 90000000
0417F360 0000XXYY
0417F364 FFGGZZNN
0417F368 KKTTPPSS
0417F36C JJ000000
E0000000 80008000

YY = Time counter(Infinite time is 00)
FF= Stock counter
KK = Stock Time Limit(Infinite Time is 00)
Notice that FF is the stock counter. Now we have to find the following so we can have FF and then edit it to make it 3 stock instead of 4 stock. To do so, we shall find:

Code:
04 17 F3 64 04
The 04 is the FF, and we want to make that into 03, so make that:

Code:
04 17 F3 64 03
Its on the start of the 4th line and we edit it to this:

Code:
[COLOR="Red"]00 D0 C0 DE 00 D0 C0 DE[/COLOR] [COLOR="Blue"]24 49 4A 98 80 00 00 00
20 52 33 00 00 00 00 00 04 52 33 00 DE AD BE EF
42 00 00 00 90 00 00 00 04 17 F3 60 00 00 01 04
04 17 F3 64 03 02 0A 00 04 17 F3 68 08 01 01 01
04 17 F3 6C 01 00 00 00 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkRed"]22 56 64 EC 00 00 00 00 04 01 BF E0 48 58 BE 20
06 5A 7E 00 00 00 00 70 38 A0 00 67 38 81 00 20
3C E0 80 5A 60 E3 7C 18 4B E5 25 31 38 A0 00 7F
38 83 FF E8 38 61 00 20 4B E5 25 21 38 A0 00 68
60 E4 7C 18 38 61 00 20 94 21 FF 80 BC 41 00 08
38 61 00 88 4B A7 4D B9 7C 7C 1B 78 2C 03 00 00
40 82 00 0C 38 21 00 80 48 00 00 1C B8 41 00 08
38 21 00 80 4B E5 24 E5 38 61 00 08 4B A7 42 E1
7C 7C 1B 78 4B A7 41 E8 04 01 CD 0C 48 58 B1 F4
06 5A 7F 00 00 00 00 18 2C 03 00 00 41 82 00 0C
4B A7 DD 51 48 00 00 08 80 78 00 0C 4B A7 4D FC
04 3E E9 D8 48 00 00 14 04 3E EB D4 48 00 00 14
04 3D 8B 9C 48 00 00 18 04 3E 9B 4C 38 60 00 00
04 3E 9D 38 38 60 00 00 04 3D 8C 80 60 00 00 00
80 00 00 00 80 40 69 20 80 00 00 01 80 5A 7C 00
8A 00 10 01 00 00 00 00 04 5A 7C 10 2F 52 53 42
04 5A 7C 14 45 2F 70 66 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkOrange"]04 0A 7D 60 4E 80 00 20 04 10 9D 88 38 80 00 01[/COLOR]
[COLOR="Green"]F0 00 00 00 00 00 00 00[/COLOR]
Notice the difference in the 4th line. Now, we need to add this code:

Code:
Disable Custom Stages v1.1:
046AFD68 48000040
We have to add it in the Hex anywhere after the first 8 digits and anywhere before the last 8 and make sure it is not in the middle of another code. The easiest way to do this is to add it at the end, right before the last 8 digits.

Code:
[COLOR="Red"]00 D0 C0 DE 00 D0 C0 DE[/COLOR] [COLOR="Blue"]24 49 4A 98 80 00 00 00
20 52 33 00 00 00 00 00 04 52 33 00 DE AD BE EF
42 00 00 00 90 00 00 00 04 17 F3 60 00 00 01 04
04 17 F3 64 03 02 0A 00 04 17 F3 68 08 01 01 01
04 17 F3 6C 01 00 00 00 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkRed"]22 56 64 EC 00 00 00 00 04 01 BF E0 48 58 BE 20
06 5A 7E 00 00 00 00 70 38 A0 00 67 38 81 00 20
3C E0 80 5A 60 E3 7C 18 4B E5 25 31 38 A0 00 7F
38 83 FF E8 38 61 00 20 4B E5 25 21 38 A0 00 68
60 E4 7C 18 38 61 00 20 94 21 FF 80 BC 41 00 08
38 61 00 88 4B A7 4D B9 7C 7C 1B 78 2C 03 00 00
40 82 00 0C 38 21 00 80 48 00 00 1C B8 41 00 08
38 21 00 80 4B E5 24 E5 38 61 00 08 4B A7 42 E1
7C 7C 1B 78 4B A7 41 E8 04 01 CD 0C 48 58 B1 F4
06 5A 7F 00 00 00 00 18 2C 03 00 00 41 82 00 0C
4B A7 DD 51 48 00 00 08 80 78 00 0C 4B A7 4D FC
04 3E E9 D8 48 00 00 14 04 3E EB D4 48 00 00 14
04 3D 8B 9C 48 00 00 18 04 3E 9B 4C 38 60 00 00
04 3E 9D 38 38 60 00 00 04 3D 8C 80 60 00 00 00
80 00 00 00 80 40 69 20 80 00 00 01 80 5A 7C 00
8A 00 10 01 00 00 00 00 04 5A 7C 10 2F 52 53 42
04 5A 7C 14 45 2F 70 66 E0 00 00 00 80 00 80 00[/COLOR]
[COLOR="DarkOrange"]04 0A 7D 60 4E 80 00 20 04 10 9D 88 38 80 00 01[/COLOR]
[COLOR="Purple"]04 6A FD 68 48 00 00 40 [/COLOR][COLOR="Green"]F0 00 00 00 00 00 00 00[/COLOR]
We have now added that code in and we have a complete .gct, just save this Hex as RSBE01.gct and we will have a Brawl+ default settings with 3 stocks instead of 4, textures, and an unrestricted pause camera that will work on Comex's Stack smash exploit.

Enjoy :)

Sorry for the wall of text.
 

illinialex24

Smash Hero
Joined
May 23, 2008
Messages
7,489
Location
Discovered: Sending Napalm
Oh and I have no experience programming but I can try to make a code compiler/added/decompiler for windows using Python or something. Will need help and for the decompiler it would search for popular codes. May need someone else with experience to do it lol.
 

CT Chia

Smash Obsessed
Joined
Sep 4, 2007
Messages
24,416
Location
Philadelphia
i might make a program to do this

does anyone know a library for java that supports IO for hex files?
 

Isatis

If specified, this will repl[0x00000000]ce the
Premium
BRoomer
Joined
Dec 18, 2008
Messages
10,253
Location
San Francisco, CA
NNID
reverite
May I volunteer to do this, except in PHP?

Edit: I also realize there was a Hex to ASCII converter online somewhere, but I forgot the location of where it was.
 

nealdt

BRoomer
BRoomer
Joined
Jun 12, 2005
Messages
3,189
Location
Long Beach CA
Chibo: there's no such thing as a "hex file," it's just a sequence of bytes that isn't interpreted as text. java.io should have a BinaryStreamWriter or something like that for writing individual bytes to a file (instead of writing character data like you might be used to).
 

CT Chia

Smash Obsessed
Joined
Sep 4, 2007
Messages
24,416
Location
Philadelphia
The programs coming along really well. I can already open up GCT files and edit them. I have to add the ability to save them soon. That link you posted will help neal, thx.

It has support for opening a GCT, adding codes to it, then saving it back as a GCT or as a TXT file (so you can decompile GCT files which people have been requesting for a while).
You can also make GCT files from scratch, add some codes, then save it. No need to open a file first to start.

Since many of you are probably wondering how the **** im gonna decompile GCT into standard code txt files since gct files contain no heading for code names and info, I'll explain it all in more detail later :)
I've got a neat method for doing it in the works.

edit: if all goes well itl be done tonight

edit2: iv finished adding codes, opening gcts, and saving gcts.

edit3: read this: http://www.smashboards.com/showthread.php?p=8242444
 
Top Bottom