Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Beginner here: guidance needed!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
riverwest
Newbie cheater
Reputation: 0

Joined: 05 May 2019
Posts: 14

PostPosted: Sun May 05, 2019 4:36 pm    Post subject: Beginner here: guidance needed! Reply with quote

Software developer here, new to hacking games. Just trying this out for fun as it helps me understand more than what I'm normally exposed to. I'd like to show you the work I've done so far in my exploration to get infinite ammo for Pandemic Express. Conceptually, I know that to do this, I need to create a trainer that will inject the proper code so my ammo does not decrease.

Steps
1. New scan (current ammo) > shoot > next scan (current ammo) > repeat. Found 3 addresses.
2. Took the first address and ran "Find out what access this address". I find one instruction cmp [rsi+rcx*4+00000094],eax. From the guides I've read, I need to look at the address in brackets [ ], but I first note the value of "rcx*4+00000094" which is "4*4+00000094" == "16+00000094" == AA. I assume my offset is AA (but I don't do anything with this yet). The value of rsi is 000001AF2C60EC60 so I search for this address in CE.
3. In my search results, I get 11 addresses - one of them a base address, 7FFAFE0560A8. I add this base address to the list of "tracked addresses" and find that the address 7FFAFE0560A8 is actually saying "TheHunting.DLL+FC60A8". This is important, no? Anyways, let's dig further.
4. I run "Find out what accesses this address" on 7FFAFE0560A8 and I get 7 instructions. Each of these instructions are mov, which is probably where the ammo is getting set for the game, but I'm not entirely sure yet. A list of distinct codes is below:

- mov rcx,[rax+00000278]
- mov rcx,[rsi+00000278]
- mov rcx,[rcx+00000270]
- mov rcx,[rcx+00000278]
- mov rdx,[rax+00000278]

I'm thinking at this point, maybe rax, rsi or rcx holds the actual value of my ammo? Bad assumption? Not sure yet. Very Happy I list out the addresses of the instructions just to have.

rax = 00007FFAFE055E30
rsi = 00007FFAFE055E30
rcx = 000001AF2C60EC60

Searching at the rax and rsi addresses gives me 3 new base addresses:

7FFAFE055DF8
7FFAFE06B090
7FFB24ECE058 <<

Calling out the last one, because once I run "Find out what accesses this address" I get the following two commands:

cmp qword ptr [rcx+000007C8],00
mov rax,[rcx+000007C8]

Getting juicy, "cmp" - that's comparing values, that has to be near what I want, right? Lets mark down the value of rcx, which is 00007FFB24ECD890 and search for that address.

--

5 new base addresses! (There is an endless number of references here..). I run the "Find out what accesses this address" again on all of them and only 2 return instructions.

Address 1 - 7FFAFE01DC58
Instruction set ->
mov rcx,[7FFAFE01DC58]
(this instruction is actually mov rcx,[TheHunting.DLL+F8DC58] but I don't know what to do with that)

Address 2 - 7FFB24EBD1C0
Instruction set ->

- mov rcx,[7FFB24EBD1C0]
- mov rdi,[7FFB24EBD1C0]
- mov rax,[7FFB24EBD1C0]

(the address 7FFB24EBD1C0 is actually [CryAction.dll+9BD1C0], but I don't know what to do with this either)


----

So my question is, where do I go from here? I've tried adding for example, 7FFB24EBD1C0, which is from a few sentences above and browsed the memory region and found these commands:

jmp PandemicExpress.CryModuleGetMemoryInfo+C9B7
jmp PandemicExpress.exe+242F4
..

I don't know what to do from here. I didn't find my original values, but I jumped down to the .exe so I'm confident this is helpful.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun May 05, 2019 5:26 pm    Post subject: Re: Beginner here: guidance needed! Reply with quote

riverwest wrote:
...
1. New scan (current ammo) > shoot > next scan (current ammo) > repeat. Found 3 addresses....

Add the addresses to the list and freeze them, too find the one address you need. So click the box so an X shows, this will freeze it at whatever the values is in the list.


riverwest wrote:
...
2. Took the first address and ran "Find out what access this address". I find one instruction cmp [rsi+rcx*4+00000094],eax. From the guides I've read, I need to look at the address in brackets [ ], but I first note the value of "rcx*4+00000094" which is "4*4+00000094" == "16+00000094" == AA. I assume my offset is AA (but I don't do anything with this yet). The value of rsi is 000001AF2C60EC60 so I search for this address in CE....

So opcode is always in hex; e.g. 4 * 4 = 10 or 0x4 * 0x4 = 0x10. And "rsi+rcx*4+00000094" looks like a list/array; basically RSI is the list start and RCX is the index and 0x4 is the item size, so each item is just one 32 bit integer or a single precision float (most likely an integer). And look at the brackets like they say "the value at the address of" but this isn't always true but will work for basic move instructions.


riverwest wrote:
...
3. In my search results, I get 11 addresses - one of them a base address, 7FFAFE0560A8. I add this base address to the list of "tracked addresses" and find that the address 7FFAFE0560A8 is actually saying "TheHunting.DLL+FC60A8". This is important, no? Anyways, let's dig further. ...

Yeah that a static address (they'll be green in the found list), meaning it will likely be the same with each reload on the process, should only change with a game update. And it seems "000001AF2C60EC60+4*4+00000094" (0x1AF2C60ED04) is your ammo address, and "rsi+0*4+00000094" might be some other ammo/item or it could be a function table/list.


riverwest wrote:
...
4. I run "Find out what accesses this address" on 7FFAFE0560A8 and I get 7 instructions. Each of these instructions are mov, which is probably where the ammo is getting set for the game, but I'm not entirely sure yet. A list of distinct codes is below: ...

That's seems to be where it gets the base/start of the ammo array. And from here ammo would be at "[7FFAFE0560A8+000007C8]+4*4+00000094", and this is just a pointer. And "7FFAFE0560A8" is just the base of some object in memory.


riverwest wrote:
...
5 new base addresses! (There is an endless number of references here..). I run the "Find out what accesses this address" again on all of them and only 2 return instructions. ...
(the address 7FFB24EBD1C0 is actually [CryAction.dll+9BD1C0], but I don't know what to do with this either) ...

And from here ammo would be at "[[CryAction.dll+9BD1C0]+000007C8]+4*4+00000094", and this is also a pointer.


You can just paste this on the address list and it will add the addresses, they all point to the same address and are just different ways to set it up.
Code:
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Ammo"</Description>
      <Color>000000</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>CryAction.dll+9BD1C0</Address>
      <Offsets>
        <Offset>4*4+94</Offset>
        <Offset>7C8</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"Ammo"</Description>
      <Color>000000</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>CryAction.dll+9BD1C0</Address>
      <Offsets>
        <Offset>A4</Offset>
        <Offset>7C8</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>3</ID>
      <Description>"Ammo"</Description>
      <Color>000000</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>[[CryAction.dll+9BD1C0]+000007C8]+4*4+00000094</Address>
    </CheatEntry>
  </CheatEntries>
</CheatTable>



Have a look at the CE wiki there is some information and tutorials.
https://wiki.cheatengine.org/index.php?title=Main_Page
https://wiki.cheatengine.org/index.php?title=Tutorials

_________________
Back to top
View user's profile Send private message Visit poster's website
riverwest
Newbie cheater
Reputation: 0

Joined: 05 May 2019
Posts: 14

PostPosted: Sun May 05, 2019 8:29 pm    Post subject: Reply with quote

Thank you very much for your help. I was able to understand your reply.
Back to top
View user's profile Send private message
riverwest
Newbie cheater
Reputation: 0

Joined: 05 May 2019
Posts: 14

PostPosted: Mon May 06, 2019 5:49 am    Post subject: Re: Beginner here: guidance needed! Reply with quote

TheyCallMeTim13 wrote:
...


Perhaps you can assist me again, in a direction I can take.

Following your instructions, I've been able to get into the assembly and begin debugging the opcodes. I thank you again for your help.

However, one of the addresses that is of interest to me, when running "Find out what accesses this address" returns only the same address - I'm not able to find a static address to the value. What might this mean?
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Mon May 06, 2019 6:24 am    Post subject: Re: Beginner here: guidance needed! Reply with quote

riverwest wrote:
TheyCallMeTim13 wrote:
...


Perhaps you can assist me again, in a direction I can take.

Following your instructions, I've been able to get into the assembly and begin debugging the opcodes. I thank you again for your help.

However, one of the addresses that is of interest to me, when running "Find out what accesses this address" returns only the same address - I'm not able to find a static address to the value. What might this mean?


You can do a scan (32 bit process 4 byte hex scan, 64 bit process 8 byte hex scan) to see what addresses have a value that is the address you did the "see what accesses" on. Basically it's a pointer with an offset of zero.

The other method is to actually go thought the opcode and reverse engineer how the game is creating the pointer, you might have to follow the function returns to find the full path (you can use the "break and trace this instruction" option by right clicking it in the memory view form. But this method requires a bit of ASM knowledge.
Example:
Code:

mov rsi,[Game.exe+DEADBEEF]
...
mov rcx,[rsi]
...
mov rax,[rcx+68]
...
mov rcx,rax
...
mov [rcx+10],rax

So the pointer path here would be: "[[[Game.exe+DEADBEEF]+0]+68]+10".
Example 2:
Code:

mov rsi,[Game.exe+DEADBEEF]
...
mov rcx,[rsi]
...
lea rax,[rcx+68] // note the "load effective address" instruction here.
...
mov rcx,rax
...
mov [rcx+10],rax

So the pointer path here would be: "[[Game.exe+DEADBEEF]+0]+68+10".

_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites