Let's actually perform a hack, to get a preview of what can be done.
1. Open up Cavestory with your OllyDbg. Then press Ctrl+G. Type in the number 404CD2 and press OK. This will take you to address 404CD2 and it will highlight the relevant instruction at that location. This address also happens to be inside the code for the fireball. 2. Double-Click on that instruction. Now, at the very end of that instruction, change the number -5FF to -2000. Make sure "keep size" is checked (otherwise you might erase part of the next instruction if you make a typo). -5FF is the normal upward speed of the fireball. So, changing that value to -2000 will make the fireball move faster when shot upward. 3. Click Assemble. 4. The instruction you changed should be highlighted in red. Right click that, go to Edit > Copy to Executable. 5. After doing that, a new window will come up. Close that window. It will ask you if you want to save. Say Yes, then click Open. Then click Yes again to put the new modification into Doukutsu.exe. Finally, close the whole OllyDbg and test out your new ASM hack. Again, to make it REALLY OBVIOUS on what to do on your first ASM hack, here's a picture: The Result Okay, so the fireball now shoots upward a lot faster. Notice that there is a fundamental problem with this lesson. I told you exactly what to do, but it was sort of a blind tutorial. It does not explain why or how the number negative 2000 is currently used as the upward speed of the fireball bullet. This was simply a demonstration of doing a single ASM hack using OllyDbg. In later lessons, we will analyze the code in much further detail, so you will actually know what's happening inside large chunks of code when we start modifications. Previous Lesson: Converting Hex and Decimal Next Lesson: Data and Registers Table of Contents |