Felix Von Katze
Felix Von Katze

Reputation: 11

Finding base address of process in VB.net

Im working on a tool that modifies the value of memory addresses but my problem is that the programs base memory address changes every time I open it.

So how would I go about finding the base memory address of a program In VB ?

Upvotes: 0

Views: 1428

Answers (2)

DrSerhat
DrSerhat

Reputation: 11

First, get ProcessID and then use Process.MainModule property. In example, I used ID=8684 for my PC Notepad.

Imports System.Runtime.InteropServices

Dim myProcess As Process = Process.GetProcessById(8684)
Dim MyAddress as Intptr = myProcess.MainModule.BaseAddress

Upvotes: 1

Trevor
Trevor

Reputation: 8004

Give this a try and see how it work's out for you. This doesn't change for me at all it stay's the same for me...

   Dim handle_s As System.Diagnostics.Process = System.Diagnostics.Process.GetCurrentProcess()
   Dim bAddress As Int64 = handle_s.MainModule.BaseAddress.ToInt64

Upvotes: 0

Related Questions