| View previous topic :: View next topic |
| Author |
Message |
Mal1t1a Cheater
Reputation: 0
Joined: 03 Jan 2010 Posts: 40
|
Posted: Thu Apr 21, 2011 12:22 am Post subject: Getting Process Hex Address? |
|
|
Is there a simple way of getting the Process Hex Address? I'm making a game trainer in VB.net (yeah I know, bad bad bad).
My problem is that because of DMA, I can't properly write to the game. How does Cheat Engine get past this? It provides me with: 0000XXXX-game.exe
where XXXX is the hex address of the game, however, when I find my static address (game.exe+0243BE94), it changes each time because of game.exe.
If I use: Process.GetProcessesByName("game")(0).Id.ToString("X")
it will return the hex address that Cheat Engine shows: 0000XXXX-game.exe
But if I use that in reference to this:
dim gid = ("&H" & Process.GetProcessesByName("game")(0).Id.ToString("X")) + &H0243BE94
and if I write to that value, it doesn't modify the value that cheat engine is pointing to, from address: game.exe+0243BE94
When I look at the address in the regular view it displays: 037DBE94
So then I did 037DBE94 - 243BE94 it came to 13A0000. This value changes everytime the game is created though.
Basically I want to know this: How in VB.net can I get what the address of: game.exe+0243BE94 is equal to, the way Cheat Engine does?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 21, 2011 2:31 pm Post subject: |
|
|
Id is the process ID. This is just the unique identifier on the system for the process. You want the base address of the game to add onto your offsets. You can use the MainModule property to get it:
| Code: | | Process.GetProcessesByName("game")(0).MainModule.BaseAddress |
Keep in mind forcing indexing such as (0) onto GetProcessesByName has the potential to throw exceptions. You should try to obtain the list and check it before using it.
_________________
- Retired. |
|
| Back to top |
|
 |
Mal1t1a Cheater
Reputation: 0
Joined: 03 Jan 2010 Posts: 40
|
Posted: Thu Apr 21, 2011 5:33 pm Post subject: |
|
|
Thank you so very much, I've been trying everything I could to do this, I was even using VirtualQueryEx API call to try and gather the Base Address.
Yes I do know that forcing indexing could potentially cause exceptions, however I was using sudo-code for the sake of showing what I mean. Thanks very much again!
|
|
| Back to top |
|
 |
|