[VB.NET] Read memory help

03/17/2011 19:07 ax5#1
Ok so im looking for some one that can help me to read a procces memory from a game and show it on a label in vb.net so if the HP changes then the label will change.

Please help me here cant find anything on google, also how to send keys to the game
03/17/2011 20:24 bvz#2
My.Computer.Keyboard.SendKeys("ENTER")... for example ...
i can add a memory example later..
03/21/2011 20:56 ax5#3
Quote:
Originally Posted by bvz View Post
My.Computer.Keyboard.SendKeys("ENTER")... for example ...
i can add a memory example later..
that code dont work for HERO ONLINE - hero.netgame.com it would be good if you can add memmory example :)
03/22/2011 14:26 bvz#4
you must run it as administrator :s
03/22/2011 16:36 ax5#5
Quote:
Originally Posted by bvz View Post
you must run it as administrator :s
ok so now all i need is read memory :mofo:
03/23/2011 19:00 0x0009000#6
Quote:
Originally Posted by ax5 View Post
ok so now all i need is read memory :mofo:
Ok first of all you need the Imports & dec's
Code:
Imports System.Runtime.InteropServices
Imports System.Text

Public Class Form1
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
    Private Declare Function WriteFloatMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
    Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
    Private 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 Integer
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal nVirtKey As Integer) As Short
    Private Const VK_SPACE = &H20
    Public Healthwath As Long
    Public Healthwath2 As Single
    Public Healthwath3 As Integer
This is the Function of ReadProcessMemory, basicly you can Read everything if you have the right adresses.
Code:
    Public Function HealthHack()
        Dim processname As Process() = Process.GetProcessesByName("name")
        If processname.Length > 0 Then
        Dim processname_1 As Process = hl2(0)
        Dim readHandle As IntPtr = OpenProcess(&H10, False, CUInt(processname_1.Id))
        ReadProcessMemory(readHandle, &HADRESSHERE, Healthwath, 4, Nothing)

        CloseHandle(readHandle)
        End If
        Return HealthHack()
    End Function
Then add a Timer to your form (interval = 100MS (should be enaugh for HP))

and then just add the function as the label text.

example:
Code:
label1.text = HealthHack()

And yea, a little anti copy&paste has been added ;), dont be lazy! :D
03/24/2011 22:21 ax5#7
thanks mate i will try this <3
03/25/2011 13:35 MoepMeep#8
Quote:
Originally Posted by 0x0009000 View Post


And yea, a little anti copy&paste has been added ;), dont be lazy! :D
the endless loop is mean :p