I am using Visual Studio 2019 - Visual Basic.
I am trying to find the base address of a program via code. I know the base address already, but I need the program I am making to find it on its own.
I use this and it shows a lot of addresses from the modules:
Dim target As Process = Process.GetProcessesByName("The Program")(0)
For Each mo As ProcessModule In target.Modules
ListBox1.Items.Add(mo.BaseAddress.ToString())
'MsgBox(Hex(mo.BaseAddress.ToString()))
Next
(I renamed the name of the program from the above code in case there are issues with the program as in copyright stuff.)
I am trying to get the base address My base address I have is:
Base Address in Hex = 00007FF7BE6B0000
Base Address in Dec = 140702028333056
When I run the above code none of the addresses it lists are the base addresses I have.
I used a PE Editor to see the base address of the program. I used a program called PE Tools from GitHub.
So how do I code to get this Image Base Address?
I got it to work with this code: