Getting the base address of a process in vb.net

417 Views Asked by At

OK this is a weird on. I need to get the base address of a process in vb.net (not my application). To delve into the memory of the other process (to explore the values I needed before coding it into vb.net) I used cheat engine. Cheat engine gives me an address like so:

Client.exe + 00BBD310

The issue here is that the Client.exe address changes whenever I re-run the program. I have a declaration of the process in my code already so I've tried this:

bAddress = handle_s.MainModule.BaseAddress

Where handle_s is the process in question. The issue here is that the value I get in bAddress isn't the value that is represented by cheat engines "Client.exe" - I can work backward to work out what cheat engine is referring to as it tells me what the result of the above sum is, however as the value changes each time, I need a method by which to simple get the value in vb.net.

Any advice/suggestions welcome.

1

There are 1 best solutions below

0
GuidedHacking On

MainModule.BaseAddress gives you the address where the module was loaded (source)

Therefore it's the absolute dynamic virtual address of the module. If 0x0BBD310 is a relative offset, then adding 0x0BBD310 to MainModule.BaseAddress will give you the address of your variable at run time.

If it's not matching up with what you're seeing in Cheat Engine then you're either attached to the wrong process or you're confused.