Memory Questions

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Memory Questions

Post by Patrickssj6 »

I know there are only a few people on this forum who could probably answer these questions but here it goes:

1. Let's say I found a static address in memory with haloce.exe. I know that the address also exists inside haloceded.exe (Halo CE Dedicated Server) but does it always have the same offset to the one found in the haloce.exe? Or do I have to search for it again?


2. The addresses change from map to map...so I added a function where you can add your own map to the list with information regarding the map with XML (like HMT XML offset list adding).

The user needs to find out 5 addresses for his map.
1.Certain Projectile X Position Address
2.Teleporter Enter X Position Address
3.Teleporter Exit X Position Address
4.Teleporter Enter Scenery X Position Address
5.Teleporter Exit Scenery X Position Address

Is there an easy way besides searching with CheatEngine and trying around to find those addresses?

Thanks. :D
...left for good
User avatar
xbox7887




Socialist Coagulator Decryptor Advisor
Eureka Commentator Wave Scorched Earth

Posts: 2160
Joined: Mon Dec 27, 2004 6:19 pm
Location: New Lenox, Illinois
Contact:

Post by xbox7887 »

You locate the pointer to that address, by determining what piece of code writes to it. From there you backtrack and figure out how the base address is calculated. Then all you need to do is grab/calculate the pointer and add whatever index the value is from it.

Example 1: Say you want to edit a value at address 0x1234 but it changes next time you play. Set a break on write for 0x1234. Your debugger spits out the bottom couple lines. You notice that your offset is based off of the value in register ebx. Find out how ebx gets initialized, then you can always just add the index 4 to get your actual address;)

Code: Select all

mov   ebx, dword ptr ds:[PointerLocation] ;<---grabs pointer from static address
xor   eax, eax ;useless, dont pay attention to ANYTHING inbetween, just what modifies your base address (ebx).
mov   dword ptr ds:[ebx + 4], Value   ;<---writes to your value
Example 2: Array-based pointers and stuff, same concepts as above.

Code: Select all

lea   ebx, [eax + ecx * 4 + 8]   ;<---pointer calculated
mov   [ebx + 8], Value ;<---writes to your value
Example 3: Same as above, except this is more common, and unfortunately a whole lot harder to recreate since values are usually retrieved from the stack (get passed as arguments). This means you need to hook into the code and retrieve the other stuff :X

Code: Select all

mov   ebx, [esp + 0Ch]  ;<---grab argument off stack
mov   [ebx + 2], Value  ;<---modifies the value at your address
These are just a few examples, but if you would like a more in-depth explanation, paste a few lines of code that modify your address, before and after the break, and I'll see if I can help.
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

ok so in example 1 the static always contains the pointer which points to the address I want (+4 first).

How would I use this information though? Code caving or is there a way by hijacking the process in some way with C++/ASM?

I only know VB.NET to this day. :wink:
...left for good
User avatar
xbox7887




Socialist Coagulator Decryptor Advisor
Eureka Commentator Wave Scorched Earth

Posts: 2160
Joined: Mon Dec 27, 2004 6:19 pm
Location: New Lenox, Illinois
Contact:

Post by xbox7887 »

If the value you are trying to edit is referenced by a static base address, simply read the pointer at that address, add your index, then modify the value at that address.

Unfortunately memory-searchers and VB.NET won't get you very far with some of the more advanced things ;P
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

xbox7887 wrote:If the value you are trying to edit is referenced by a static base address, simply read the pointer at that address, add your index, then modify the value at that address.

Unfortunately memory-searchers and VB.NET won't get you very far with some of the more advanced things ;P
I know but someone has to teach me how to switch from VB and memory hacking to something more "advanced" :wink:

I know the basics of Disassembly / Debugging but I don't know what to do next with it. TASM/MASM? C++/ASM? :)
...left for good
User avatar
xbox7887




Socialist Coagulator Decryptor Advisor
Eureka Commentator Wave Scorched Earth

Posts: 2160
Joined: Mon Dec 27, 2004 6:19 pm
Location: New Lenox, Illinois
Contact:

Post by xbox7887 »

http://modseven.de/dictionary.php

You will definitely want to learn a bit of assembly if you plan on doing any hooking. I prefer to use MASM because the intel syntax is much easier to read imo, but feel free to look around. You will also need to learn about the stack, if you haven't already, then I would suggest you familiarize yourself with the following opcodes...

cmp, jmp, and all conditional jump instructions (jcc)
mov
lea
push
pop
call
ret

After you have a basic knowledge of these things I can help you easily set up some sort of application to build assembly trainer files, then inject them directly into memory.
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Ok now...weeks later I did my research. Can you help me to explain the basics? I think I'm very capable of learning this. :D

I know how to dissemble/debug simple programs but you have to teach me some other things. :wink:
...left for good
Post Reply