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 


Getting Process Hex Address?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Mal1t1a
Cheater
Reputation: 0

Joined: 03 Jan 2010
Posts: 40

PostPosted: Thu Apr 21, 2011 12:22 am    Post subject: Getting Process Hex Address? Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Apr 21, 2011 2:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mal1t1a
Cheater
Reputation: 0

Joined: 03 Jan 2010
Posts: 40

PostPosted: Thu Apr 21, 2011 5:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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