Can someone teach me about the structure of codes? Thanks.
there are a lot of different code structures...
ask for specific ones.
How about this one?
Super Smash Bros Brawl PAL
P1 Samus' Blaster is always full - agrs700
4A000000 81000000
1425E9C6 00000007
code lines in this post from agrs700
First line:
4A000000 81000000 (http://geckocodes.org/index.php?arsenal=1&ct=4A000000%2081000000)
Second line:
1425E9C6 00000007 (http://geckocodes.org/index.php?arsenal=1&ct=1425E9C6%2000000007)
And that code should have a 3rd line:
E0000000 80008000 (http://geckocodes.org/index.php?arsenal=1&ct=E0000000%2080008000)
Or you could just do this
0525E9C6 00000007
Also true. lol
Codes are arranged in lines of two 32-bit values in hexadecimal. Thus, 0525E9C6 00000007 as wiiztec said. Each hex digit corresponds to 4 bits, 8 digits * 4 bits = 32 bits total. I will refer to these as the "first code word" (0525E9C6) and "second code word" (00000007)
The first 7 bits of the first code word determine the code type. The remaining 25 bits of the first word, and all 32 bits of the second word, will have different meanings depending on the code type. For a list of the code types, see the following page.
http://geckocodes.org/index.php?arsenal=1
Following is a diagram of the binary breakdown of the first code word, assuming the remaining 25 bits are an address (which is typical, but not always true)
Hex Digit | First | Second | Third | Fourth ...
Bit# | 0 1 2 | 3 | 4 5 6 | 7 | 8 9 10 11 | 12 ...
is | Code Type | ba/po | Code Sub Type | address or operands...................
The first 8 bits of the first word are 05. In binary, this is 0000 0101. The code type is 000, which is the Direct RAM Write Code Type. The 0 indicates this uses the ba. The 010 indicates a 32-bit Write Code Subtype. The remaining 1 is added to the address, which is why 0525E9C6 writes to the address 8125E9C6. The value written is specified by the second word.
Other code types are more complicated; they may make use of the second code word or even extra lines to specify other parameters (like the Serial Write), or the remaining 25 bits of the first word may not be an address (like Gecko Register Code Types). But the first 7 bits of the first word always determine what the other bits mean.
Ok, there are a couple of things I don't quite understand;
I couldn't find 05 in the link?
And why does 0525E9C6 become 8125E9C6? I understand the 'Add 1' part, but what makes the 05 become 8? Thanks for all the help.
Quote from: doomkaiber001 on November 18, 2010, 04:47:41 PM
Ok, there are a couple of things I don't quite understand;
I couldn't find 05 in the link?
And why does 0525E9C6 become 8125E9C6? I understand the 'Add 1' part, but what makes the 05 become 8? Thanks for all the help.
8125E9C6 is the RAM address
You didn't find an 05 code type because there isn't one. It's an 04 code type. Remember, hex digits are 4 bits, but code types only use 7 bits. That 8th bit - a 1 in the case of an 05 - is part of the address.
This is a cause of great confusion. Just remember that code types will never be odd because that last bit isn't part of the code type. If the second digit is odd, subtract 1.
By default, the ba and po are 80000000. Additionally, only the first 7 bits of the ba are used, but all 32 bits of the po are used. There are other code types that modify the ba and po, so that you can access other memory ranges like 9xxxxxxx.
Recall the colored text above. Notice how the 04 code type uses the ba, and the 14 code type uses the po. If the first digit is even it uses the ba, and if it's odd it uses the po instead.
Since you're just starting with this, if you need replies with less (potentially intimidating) technical jargon, don't hesitate to ask. ^^
lol thanks James! So by writing, you mean? I have an idea, but don't want to be humiliated if...
Not a problem!
'write' is to change something in memory
(all following numbers are hexidecimal)
For your previous question:
The 80000000 that is automatically added to calculate the address comes from one of two places..
If the first digit of the write codetype is:
* even: then you use the 'ba' to get that 80000000
* odd: then you use the 'po' to get that 80000000
This code type: http://geckocodes.org/index.php?arsenal=1&ct=42 will change the 'ba' to other values instead of the default 80000000.
This code type: http://geckocodes.org/index.php?arsenal=1&ct=4A will change the 'po' to other values instead of the default 80000000.
This code type changes them both AND breaks out of any if/then logic in the code: E0000000 80008000 (http://geckocodes.org/index.php?arsenal=1&ct=E0000000%2080008000)
When the second digit of a codetype is odd, you're adding 1000000 to the address calculation. (see dcx2's post if you really want to know why)
So:
15222220 0000000A
first digit is odd, so use 'po' (default value is 80000000)
second digit is odd, so add 1000000
Address = 81222220
Ok! That makes alot of sense. So... How is the second code word dependant on the first? How do you determine it?
The second word in a 04 codetyped code is simply the value that you write to the address!
If the code was to write how much money you had, the value would be that amount (in hexadecimal).
Make sense? Do you need a better understanding of the memory address/value relation?
Yes... I think I understand (the money part). You're probably right. I do need a better understanding of memory.
Thanks!
http://wiird.l0nk.org/forum/index.php/topic,5249.msg60636.html
Is this an example of writing values to memory, but with using ASM? I think it is.
MOD EDIT: fixed link
Memory is an ice cube tray.
Each place for a cube is numbered.
Each of these holes are filled with different flavors.
The number of the hole is the address, the flavor is the value.
80123450 is an address that holds a value of something (health, money, color, speed, etc).
I can't look at the asm example right yet; will reply later
That makes sense. :)
Just a heads up, I'm going to move this thread out of OT board to the WGHH board...because this isn't actually an off topic discussion. Not sure how it got here...
Ok.
Well, Is it an example of memory writing?
That url doesn't work for me.
Ok. Its 'An Introduction To Cpu Architecture and ASM'. I found it in The colective under Wii Game Hacking Guides.
I fixed the link for you, you left off the .org part and that's why it wouldn't work.
In that link, the ASM instruction "stw" writes to memory. Memory is represented by the box "MEM" in the pictures.
Thanks for fixing the link :) Do you follow the / a similar process in the link whenever you write a value to memory?
The link is an explanation of what happens while a game is running on the Wii. It's meant to give you an example of how data is flowing to and from memory, and how ASM instructions modify the values.
If you write an ASM code, then you will probably be using stw or some derivative (sth, stb, stwu, etc). When the CPU executes your stw instruction, it will write to memory.
You don't need ASM, though. When you use code types like the 04 code type, you are telling the code handler to do the writing for you. If you were to follow the code handler along while it executes your 04 code, you would eventually see a stw somewhere.
So, let's see if I understand this;
0525E9C6 00000007
05 = 0000 0101
0 = ba ( Because its a Positive Number)
1 = Add to address
So...
ba (add 80000000 to address)
8125E9C6 Is the address that 7 has to be written to.
I hope thats right. It seems so.
Yes, you're right. One minor correction though...it's not ba because it's positive, it's ba because it's even.
Yeah sorry! I did mean that but it was late... Anyway, if you could help me with one other thing. What about multi-lined codes?
Sorry if I'm asking too much.
Quote from: doomkaiber001 on November 20, 2010, 08:37:12 AM
Yeah sorry! I did mean that but it was late... Anyway, if you could help me with one other thing. What about multi-lined codes?
Sorry if I'm asking too much.
like this?
0525E9C6 00000007
0525E9F6 00000008
0525E9C6 00000009
0525E9A6 00000007
Yeah exactly that.
It's just doing multiple things. Writing to change multiple values.
Multi line codes can do other things too- like comparisons, so it only writes on a condition.
Ok.
Blue Shell Speed Modifier MKW
048A5BC4 43960000
048A5C24 43960000
048A5C34 43960000
Why is the speed value being stored to three addresses?
Quote from: doomkaiber001 on November 21, 2010, 08:43:31 AM
Ok.
Blue Shell Speed Modifier MKW
048A5BC4 43960000
048A5C24 43960000
048A5C34 43960000
Why is the speed value being stored to three addresses?
maybe it´s only one of them which is needed and the hacker just took the 3, because he was too lazy to find out, which one works.
However, I think that this 3 lines are all needed... could happen.
Hold on... If they aren't needed, couldn't they be changing something important? And, if each line is needed, what exactly are they needed for? Similar codes (for both red and green shells) contain only one line of coding.
That's just the way some hacks are. For instance, Okami is a game where the main character can double jump. I wrote a code that allowed you to "infinite jump" - you could keep double-jumping after the double-jump.
One would think this is as simple as nopping the stw that wrote the value that says "I have now double jumped", but it turned out I needed to modify no less than *six* places in order to make the code work without glitches. If you modify only one, then the infinite double jump only works sometimes (i.e. when rising, but not falling).
yeah, the 3 lines are needed to make it always work.
MKWii is a bit weird in this case, you need more than jut one adress to make it working in every game mode.
Actually, it also works online, should be one of the purpoises. (this one is harmless anyway, because it won´t change the game play for others when the blue shell is only slower/faster for your screen xD)
So each address is for one game type?
For this code, it *probably* has 3 addresses because:
one is modifying the X speed, one is the Y speed, and the other is the Z speed.