[Tutorial] Just Cause 2 Unlimited Ammo with CE and Ollydbg

On domingo, 12 de septiembre de 2010 0 comentarios

Just Cause 2 Unlimited Ammo Tutorial

Let's get started.

Image

Load the game and attach Cheat Engine. After that enter you current ammunition (167 in my case) in Value textbox and hit New Scan.

Image

Go back in game and shoot once, twice or more and reload. Open up CE and enter new ammunition value (166 for me) and hit Next Scan. Only two addresses...this is going to be easy

Image

Just to be sure go back in game, shoot some more and reload. Open up CE and check the addresses. For me the value above changed randomly to 17 and quickly up to 161, but I only shot once so I need value 165 and only one address holds it.
Double click on the address and it will be added to memory list. Now right click on the newly added address and choose "Find out what writes to this address." It will ask you do you want to attach Cheat Engine to processes. Hit yes.


Go back into the game, shoot and reload once. Come back to Cheat Engine and look at "The following opcodes changed the selected address" window. You should have one line if you shot once. Select it and hit "More information." Notice the red line. This is what we need. Write down the address 00579d50.

Extra information: Some of you might wonder why not to use Ollydbg after we've found the address and the value. It seems Steam doesn't like debuggers much and so when Olly hit the breakpoint game crashed.

Image

Open up Ollydbg and go to File -> Attach -> Find and select JustCause2.exe -> Click attach. Ollydbg pauses the process and brings up ntdll module. So, click the big E button after L. Double-click on JustCause2.exe.

Image


Image

Right click anywhere in the code window and choose Go to -> Expression. Type in the address you wrote down before (00579d50) and click OK.

Image

This is where we end up. Looks familiar right?
We few ways to get unlimited ammunition :
  1. NOP the 00579D4E line. This way after reloading 0 bullets will be added(removed (next line).
  2. NOP the 00579D50 line. Nothing will be added to address thus ammunition won't change.
  3. Change ADD to SUB. This way instead of removing bullets on every reload you get more. I like this one the most so we'll go with it.
  4. ...there are actually many other ways

Image

Double-click on 00579D50 line and change ADD to SUB, click assemble.

Done. Continue process (click F9) and you have unlimited ammo.
Game will crash when you die

This happens because everything hates Ollydbg. Write your tiny trainer to patch one byte at address 00579D50. That byte would be 0x29 as you can see in Ollydbg once you've changed ADD to SUB.
So, WriteProcessMemory would look something like this :
Syntax « c » : [ Download ] [ Hide ]
byte patch = {0x29};
WriteProcessMemory(hProc, (LPVOID)0x00579D50, &patch, 1, 0);

Simple as that.

0 comentarios:

Publicar un comentario