Post by dlevere on Jul 16, 2012 10:26:11 GMT -4
By Lazy Bastard
To get you started, and to explain how ASM hacks could prove useful, start with the simplest ASM hack, a nop.
'nop' stands for 'No Operation', and it essentially means, "don't do anything". So, if you found the ASM code that causes your character to lose health every time he gets hit, and changed the "sub" instruction (Subtract) to "nop" (No Operation), every time your character should lose health, nothing would happen. The processor would still waste its time going through the motions, and following its instructions ("OK, so when the character gets hit...do nothing. Done. OK, character got hit again...do nothing. Done"), but you wouldn't experience any decrease in health.
This concept is described in a working example for the Wii, in one of our hacking guides in the GameHacking.org Library, called Simple ASM Codes Final.
But now you're wondering..."Why not just hack a health mod, and set it to max?". First, some games utilize DMA (Dynamic Memory Allocation). Without going into detail about DMA (which you can read about in the Library and various other places online), this means that the addresses for things move around each time you start the game, change rooms, change levels, or do other things, depending on the game and its code. Therefore, you'd have to hack a new Infinite Health code each time you started the game, changed rooms, etc.
The way to solve this problem is by using breakpoints to determine what is causing health to decrease in the first place, and changing that through an ASM instruction. Generally, these pieces of code do not move around, and thus DMA isn't an issue.
Second, there are far more advanced codes that can be created using ASM instructions. Essentially, instead of setting certain values statically ("Always keep health at 255", "Always make strength 99", etc), you're re-programming the game on-the-fly, which is much more powerful. Granted, if you're clever, you can do quite a bit with simple RAM-hacks. But if there's a useful tool available, why not take advantage of it?
Incidentally, instead of changing "sub" to "nop", you could instead change it to "add". Every time your character got hurt, he would gain health
For one more example, at a high-level view, let's look at an imaginary game, and ignoring all code, just talk about theory. Just bear with me:
Event1: Character gets hit.
Event2: Character picks up Power potion.
Event3: Enemy gets hit.
Effect1: Character loses health.
Effect2: Character gets bigger.
Effect3: Enemy loses health.
Let's say that usually, Event1 causes Effect1, and so forth. With an ASM code, we could swap these around, or cause multiple events to cause the same effect. Perhaps we'd like it if every time we got hit, the enemy got hurt (that's always good for a laugh). Or perhaps every time we get hit, we get bigger, as if we've just picked up a Power potion. Or perhaps every time we hit the enemy, we get bigger. Or every time we do any of these, the enemy gets hurt. There are plenty of things to do, and this is just one set of events and effects.
I suggest you take a look at ASM-related guides in the GameHacking.org Library, and try a couple on your own. That said, feel free to ask us anything you're curious about. Have fun, and show us what you can hack.
To get you started, and to explain how ASM hacks could prove useful, start with the simplest ASM hack, a nop.
'nop' stands for 'No Operation', and it essentially means, "don't do anything". So, if you found the ASM code that causes your character to lose health every time he gets hit, and changed the "sub" instruction (Subtract) to "nop" (No Operation), every time your character should lose health, nothing would happen. The processor would still waste its time going through the motions, and following its instructions ("OK, so when the character gets hit...do nothing. Done. OK, character got hit again...do nothing. Done"), but you wouldn't experience any decrease in health.
This concept is described in a working example for the Wii, in one of our hacking guides in the GameHacking.org Library, called Simple ASM Codes Final.
But now you're wondering..."Why not just hack a health mod, and set it to max?". First, some games utilize DMA (Dynamic Memory Allocation). Without going into detail about DMA (which you can read about in the Library and various other places online), this means that the addresses for things move around each time you start the game, change rooms, change levels, or do other things, depending on the game and its code. Therefore, you'd have to hack a new Infinite Health code each time you started the game, changed rooms, etc.
The way to solve this problem is by using breakpoints to determine what is causing health to decrease in the first place, and changing that through an ASM instruction. Generally, these pieces of code do not move around, and thus DMA isn't an issue.
Second, there are far more advanced codes that can be created using ASM instructions. Essentially, instead of setting certain values statically ("Always keep health at 255", "Always make strength 99", etc), you're re-programming the game on-the-fly, which is much more powerful. Granted, if you're clever, you can do quite a bit with simple RAM-hacks. But if there's a useful tool available, why not take advantage of it?
Incidentally, instead of changing "sub" to "nop", you could instead change it to "add". Every time your character got hurt, he would gain health
For one more example, at a high-level view, let's look at an imaginary game, and ignoring all code, just talk about theory. Just bear with me:
Event1: Character gets hit.
Event2: Character picks up Power potion.
Event3: Enemy gets hit.
Effect1: Character loses health.
Effect2: Character gets bigger.
Effect3: Enemy loses health.
Let's say that usually, Event1 causes Effect1, and so forth. With an ASM code, we could swap these around, or cause multiple events to cause the same effect. Perhaps we'd like it if every time we got hit, the enemy got hurt (that's always good for a laugh). Or perhaps every time we get hit, we get bigger, as if we've just picked up a Power potion. Or perhaps every time we hit the enemy, we get bigger. Or every time we do any of these, the enemy gets hurt. There are plenty of things to do, and this is just one set of events and effects.
I suggest you take a look at ASM-related guides in the GameHacking.org Library, and try a couple on your own. That said, feel free to ask us anything you're curious about. Have fun, and show us what you can hack.