1

I've found/reworked some code to read/write data directly to the memory of another application. The code to read/write a single address is as fast as I could want, but finding the address is a hassle. I'd assume for any given program the locations of variables in the memory would be the same relative to a given position, I'd guess the start position.

So I currently use this to read memory:

Public Function ReadBytes(ByVal addr As IntPtr, ByVal size As Int32) As Byte()
    Dim _rtnBytes(size - 1) As Byte
    ReadProcessMemory(_targetProcessHandle, addr, _rtnBytes, size, vbNull)
    Return _rtnBytes
End Function

This code requires a bunch of global variables, routines to attach to the memory etc..

The ideal answer would give me a method or reference to code that gives me the starting address of the memory for a given process. I'm doing this in VB.NET

FraserOfSmeg
  • 1,128
  • 2
  • 23
  • 41
  • Possibly related: http://stackoverflow.com/questions/1989783/how-is-it-possible-to-access-memory-of-other-processes – Josh Part Mar 14 '15 at 18:19
  • possible duplicate of [How to get the starting/base address of a process in C++?](http://stackoverflow.com/questions/11564148/how-to-get-the-starting-base-address-of-a-process-in-c) – Sam Axe Mar 15 '15 at 13:22
  • @Dan-o C++ and VB.net are quite different languages, so for my purpose the other question doesn't really help. – FraserOfSmeg Mar 15 '15 at 13:29
  • The other question has all the pieces you need to implement what you need. Just *read* the accepted answer. – Sam Axe Mar 15 '15 at 13:30

0 Answers0