Basic C2 (ASM) [PoptartHunter]

In this tutorial I will teach you how to simply use the C2 codetype effectively, you'll need a USB gecko for this.


C2's function is to insert asm at a specified address. In order to get this assembly address, you will need to set a write breakpoint on whatever you are trying to make. Be it health, ammo, etc. Set the breakpoint, then do something to lose some of the specified item. If it's the address for health, set a write breakpoint on it, then lose some health to trigger the breakpoint. If it's ammo, set a write breakpoint on your ammo address, then lose some ammo to trigger the breakpoint.


For this tutorial, we are going to use infinite ammo as the example. Say we set the breakpoint, we get it to trigger shooting, then we get the asm address 80304820.


Look in the breakpoint tab in the little box (you'll know what i'm talking about if you have Gecko.net and a usb gecko).


Let's say the instructions for the address 80304820 are stw r0,0(r12). First you'll want to look at r0 in the little box, and look at the value in it. The value should be whatever ammo count you have after shooting the gun. So say we had 64 bullets (100 in hex) then we shoot one to trigger the breakpoint, the value at r0 in the little box should be 63 (99 in hex).


After that, look at r12 in the box. The address in r12 should be the same as your normal address to your ammo.


So, we know how this address works basically now. The stw instruction takes the value in r0 and writes it to the address in r12. Let's start writing our assembly!


first, we want to overwrite the value that is in r0 with something else, since that is the ammo count. For this, we'll need to use the li instruction, which means "load immediate". We're going to do this:


li r0,999


This instruction will put the value 999 into r0, simple right?


Next we're going to have to find a way to make 999 be written to the address in r12. This is simple, remember our instruction earlier? stw r0,0(r12)? That's exactly what we will be doing here.


li r0,999 stw r0,0(r12) nop


What this does is, it will overwrite the default value in r0 (your ammo count) with the value 999 by using the li instruction to put it there. The stw instruction will take the value in r0 (which is 999) and write it to the address in r12 (our address for ammo count).


What does the nop instruction do you ask? Nothing. Yes, nothing. We put it there because a C2 code cannot end in an even number of lines or it will freeze.


Now that we've gotten our assembly all typed up, let's put it into asm <>wiird and convert it to a code we can use.


Here's our finished code!

Infinite Ammo [HexWire]

C2304820 00000002

380003E7 900C0000

60000000 00000000