In this tutorial I will be teaching you how to make a file patcher for AssaultCube. I started to rush the tutorial towards the end so if i have made a mistake or left something out just reply and I will add/fix it.
Also If someone could make a video tutorial out of this (with voice not notepad) as it is very long and would be easier to watch.
Table of Contents:
1. Step 1 (Preperation)
2. Step 2 (Attaching OllyDBG to AssaultCube)
3. Step 3 (Finding Addresses)
4. Step 4 (Saving The modified file)
5. Step 5 (Finding The Differences)
6. Step 6 (Making The Patch)
7. Step 7 (Patching AssaultCube)
Files Required:
HxD
Visual Basic 2010 Express (Or a later version of the software)
OllyDBG
AssaultCube
Step 1 (Preparation):
Before we start to do anything you must first download and install all of the programs listed above as well as a backup of the un-modified 'ac_client.exe'.
Installing Visual Basic 2010
To install visual basic 2010 express simply download the web installer above and go through the install dialog as you would with any other program.
Installing HxD
To install HxD, click on the link above and select which language you would like, after downloading run the installer and go thought the install dialog as you would with any other program.
Installing OllyDBG
Unlike the other two files, OllyDBG Does not need to be installed, instead it comes inside a .zip file which you simply extract to a folder on your computer.
Installing AssaultCube
To install AssaultCube, click on the link above and select windows at the right side, after downloading run the installer and go thought the install dialog as you would with any other program.
Backing Up 'ac_client.exe'
In the method used in this tutorial you will need a back up of the original file to compare to a modifies version, to do this simply go to the installation folder for AssaultCube (Default: C:\Program Files (x86)\AssaultCube_v1.1.0.4) and double click the 'bin_win32' folder, once inside this folder copy the file 'ac_client' to your desktop.
Step 2(Attaching OllyDBG To AssaultCube):
To attach OllyDBG to AssaultCube you will first need to run AssaultCube and OllyDBG.
After both programs are running, in OllyDBG click on File>Attach
After you click 'Attach' a new window (below) will pop-up
As you can see in the image above you must select 'ac_client' and then click 'Attach'.
After OllyDBG has 'Attached' to ac_client, click the play button (below)
Step 3 (Finding Addresses):
The next step is to find the addresses of the assembly code we want to change.
Finding the ammo address:
The first step is to press 'Ctrl+G', a window will pop-up (Below).
After the window pops-up, paste the address '0045B75F' into the textbox and click 'OK'.
After you click 'OK' you will be taken to the address (Below), from here write the bytes (FF0E) into notepad.
Next double click the address and a new window will pop-up (below).
In the image above you can see 'DEC' in the textbox, change this to 'INC' and click 'Assemble'.
Now if you look at the bytes again you will notice that they have changed and the new byte is highlighted red (below).
Finally write down the new bytes (FF06) into notepad.
Finding the recoil address:
Like with finding the ammo address the first step is to press 'Ctrl+G' but his time pasting the address '0045B70A'
After you click 'OK' you will be taken to the address below in OllyDBG.
Next write the bytes highlighted above into notepad e.g.:
The format above is the easiest for the next steps.
Now that you have wrote all the addresses into notepad, double click the first address, a window will once again pop-up but instead of changing one of the commands, this time just replace all the text with 'NOP' (below).
After pasting 'NOP' into the textbox click 'Assemble' until all of the addresses highlighted above have their bytes changed to '90' (below).
Now after each of the bytes you wrote into notepad earlier add '-> 90' e.g.:
Step 4 (Saving the modified file):
The final step for the modifications is to save the file as a .exe.
Saving the modified file:
Now that you have made all the modifications, simply right-click the address window in OllyDBG go down to 'Copy to executable' and then to 'All modifications' (below).
After you click 'All modifications' a new window will pop-up, simply click 'Copy all' (below).
Another window will pop-up after clicking 'Copy all', just exit this window by clicking 'X' (below).
After exiting this window another will pop-up, on this window just click yes (below).
Finally after click yes in the window above a final window will pop-up (below) asking where you want to save the .exe and what you want to call it, I recommend saving the file to your desktop and naming it 'COMP'.
After you have saved the modified file you can close OllyDBG and AssaultCube.
Also If someone could make a video tutorial out of this (with voice not notepad) as it is very long and would be easier to watch.
Table of Contents:
1. Step 1 (Preperation)
2. Step 2 (Attaching OllyDBG to AssaultCube)
3. Step 3 (Finding Addresses)
4. Step 4 (Saving The modified file)
5. Step 5 (Finding The Differences)
6. Step 6 (Making The Patch)
7. Step 7 (Patching AssaultCube)
Files Required:
HxD
Visual Basic 2010 Express (Or a later version of the software)
OllyDBG
AssaultCube
Step 1 (Preparation):
Before we start to do anything you must first download and install all of the programs listed above as well as a backup of the un-modified 'ac_client.exe'.
Installing Visual Basic 2010
To install visual basic 2010 express simply download the web installer above and go through the install dialog as you would with any other program.
Installing HxD
To install HxD, click on the link above and select which language you would like, after downloading run the installer and go thought the install dialog as you would with any other program.
Installing OllyDBG
Unlike the other two files, OllyDBG Does not need to be installed, instead it comes inside a .zip file which you simply extract to a folder on your computer.
Installing AssaultCube
To install AssaultCube, click on the link above and select windows at the right side, after downloading run the installer and go thought the install dialog as you would with any other program.
Backing Up 'ac_client.exe'
In the method used in this tutorial you will need a back up of the original file to compare to a modifies version, to do this simply go to the installation folder for AssaultCube (Default: C:\Program Files (x86)\AssaultCube_v1.1.0.4) and double click the 'bin_win32' folder, once inside this folder copy the file 'ac_client' to your desktop.
Step 2(Attaching OllyDBG To AssaultCube):
To attach OllyDBG to AssaultCube you will first need to run AssaultCube and OllyDBG.
After both programs are running, in OllyDBG click on File>Attach

After you click 'Attach' a new window (below) will pop-up

As you can see in the image above you must select 'ac_client' and then click 'Attach'.
After OllyDBG has 'Attached' to ac_client, click the play button (below)

Step 3 (Finding Addresses):
The next step is to find the addresses of the assembly code we want to change.
Finding the ammo address:
The first step is to press 'Ctrl+G', a window will pop-up (Below).

After the window pops-up, paste the address '0045B75F' into the textbox and click 'OK'.
After you click 'OK' you will be taken to the address (Below), from here write the bytes (FF0E) into notepad.

Next double click the address and a new window will pop-up (below).

In the image above you can see 'DEC' in the textbox, change this to 'INC' and click 'Assemble'.

Now if you look at the bytes again you will notice that they have changed and the new byte is highlighted red (below).

Finally write down the new bytes (FF06) into notepad.
Finding the recoil address:
Like with finding the ammo address the first step is to press 'Ctrl+G' but his time pasting the address '0045B70A'
After you click 'OK' you will be taken to the address below in OllyDBG.

Next write the bytes highlighted above into notepad e.g.:
C++:
8B
16
8B
52
14
50
8D
4C
24
1C
51
8B
CE
FF
D2
Now that you have wrote all the addresses into notepad, double click the first address, a window will once again pop-up but instead of changing one of the commands, this time just replace all the text with 'NOP' (below).

After pasting 'NOP' into the textbox click 'Assemble' until all of the addresses highlighted above have their bytes changed to '90' (below).

Now after each of the bytes you wrote into notepad earlier add '-> 90' e.g.:
C++:
8B -> 90
16 -> 90
8B -> 90
52 -> 90
14 -> 90
50 -> 90
8D -> 90
4C -> 90
24 -> 90
1C -> 90
51 -> 90
8B -> 90
CE -> 90
FF -> 90
D2 -> 90
The final step for the modifications is to save the file as a .exe.
Saving the modified file:
Now that you have made all the modifications, simply right-click the address window in OllyDBG go down to 'Copy to executable' and then to 'All modifications' (below).

After you click 'All modifications' a new window will pop-up, simply click 'Copy all' (below).

Another window will pop-up after clicking 'Copy all', just exit this window by clicking 'X' (below).

After exiting this window another will pop-up, on this window just click yes (below).

Finally after click yes in the window above a final window will pop-up (below) asking where you want to save the .exe and what you want to call it, I recommend saving the file to your desktop and naming it 'COMP'.

After you have saved the modified file you can close OllyDBG and AssaultCube.
Last edited: