Results 1 to 24 of 24

Thread: [RERESOLVED] [2008] Help with ReadProcessMemory

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    62

    Resolved [RERESOLVED] [2008] Help with ReadProcessMemory

    var keeps coming out as 0 no matter what I try.

    Am I doing this right?

    Code:
        Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As IntPtr
        Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
        Private Sub btnCurrentXP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCurrentXP.Click
            Dim var As Integer
            Dim windowhandle As IntPtr
            Dim buffer(7) As Byte
            Dim bytesWritten As Integer
            windowhandle = FindWindow(vbNullString, "My window")
            var = ReadProcessMemory(windowhandle, &H80B910, buffer(0), 8, bytesWritten)
    
            MsgBox(var)
        End Sub
    Last edited by rhijaen; Feb 14th, 2008 at 03:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width