Author Topic: OFP Rounds in Mag  (Read 1817 times)

0 Members and 1 Guest are viewing this topic.

sarek3

  • Poptart
  • *
  • Posts: 4
    • View Profile
OFP Rounds in Mag
« on: March 09, 2011, 07:15:06 pm »
I have a question to the author of the "unlimited ammo" trainer: how to find offset with number of rounds? Straightforward search doesn't give me any results.

Could be solution for ARMA. The games are similar after all.

M. O.

  • Administrator
  • MasstKer
  • *
  • Posts: 9185
    • View Profile
    • http://www.tkc-community.net
Re: OFP Rounds in Mag
« Reply #1 on: March 10, 2011, 12:12:17 am »
Sometimes games use total ammo etc. I don't remember what the case is for OFP, but I don't think there were any probs. You should however try searching for a value that decreases. (And as last resort unknown value).

In ArmA they modifed the algorithm to make it harder for cheaters, but we managed to freeze the ammo anyway.
Heckling is an art, and game hacking a science.

sarek3

  • Poptart
  • *
  • Posts: 4
    • View Profile
Re: OFP Rounds in Mag
« Reply #2 on: March 10, 2011, 12:28:01 am »
I've tried and I'm left with nothing or some crazy values which bear no resemblance. Maybe you have a source code?

M. O.

  • Administrator
  • MasstKer
  • *
  • Posts: 9185
    • View Profile
    • http://www.tkc-community.net
Re: OFP Rounds in Mag
« Reply #3 on: March 10, 2011, 01:08:07 am »
The values don't have to resemble those on the screen. Try to freeze them and see what happens in game.
Heckling is an art, and game hacking a science.

sarek3

  • Poptart
  • *
  • Posts: 4
    • View Profile
Re: OFP Rounds in Mag
« Reply #4 on: March 10, 2011, 09:30:07 pm »
That was a lot to poke but I found the value. Problem is that it's dynamically allocated - for every magazine it's different, for every start it's different.

M. O.

  • Administrator
  • MasstKer
  • *
  • Posts: 9185
    • View Profile
    • http://www.tkc-community.net
Re: OFP Rounds in Mag
« Reply #5 on: March 11, 2011, 06:05:38 am »
Yes, you'll have to breakpoint the value once you find it, and nop the decrease op (or equivalent) (which should be at a static loc).
Heckling is an art, and game hacking a science.

sarek3

  • Poptart
  • *
  • Posts: 4
    • View Profile
Re: OFP Rounds in Mag
« Reply #6 on: May 31, 2011, 03:41:08 pm »
I'm using MHS and I've selected "Find what writes this address" (I can also select "Find what accesses this address"). I've got this static offset 004358DD and after I NOP it I have unlimited ammo. I don't know what to do now. I mean how does it lead me to address with rounds?

Attached screenshots:



« Last Edit: May 31, 2011, 04:05:43 pm by sarek3 »

M. O.

  • Administrator
  • MasstKer
  • *
  • Posts: 9185
    • View Profile
    • http://www.tkc-community.net
Re: OFP Rounds in Mag
« Reply #7 on: May 31, 2011, 04:17:22 pm »
Oh ok, you want the number of rounds. That can be done in a number of ways. One solution would be to make a code cave and store either the pointer to the ammo or its contents (the ammo) at a static location which you then read. I'm sure it's possible to have even more elegant solutions (like obtaining the pointer directly from the static adress you found), but the code cave solution always works no matter how the rest of the code looks.

So you basically store away ESI+C at some other place (if ESI+C is the pointer where ammo is stored).
Heckling is an art, and game hacking a science.