» Site Navigation | | | » Advertisement | | | » Recent Threads | | | | | | | | | | | |  |  | [vb6] Pointer Trainer |  |
09-18-2006, 07:38 PM
|
#1 (permalink)
| Full Member
Join Date: Sep 2006 Location: [.:::.] Age: 19 Posts: 286
GPoints: 195 Rep Power: 10 | [vb6] Pointer Trainer How to Write to a pointer Code: Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function GetWindowThreadProcessId Lib "User32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Function WriteLongPointer(Address As Long, Offset As Long, Value As Long, WindowName As String) As Long
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
Dim Valueofpointer As Long
Dim valueX As String
Dim Addy
hwnd = FindWindow(vbNullString, WindowName)
If hwnd = 0 Then
MsgBox "Could Not find process window!", vbCritical, "Read error"
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
MsgBox "Could Not Get a process handle!", vbCritical, "Read error"
Exit Function
End If
ReadProcessMem ProcessHandle, Address, Valueofpointer, 4, 0& 'Change the Four To two If you want For two bytes
' WriteLongPointer = Value
valueX = Val(Valueofpointer) + Val(Offset)
Decnum = valueX
HexNum = ""
While Decnum <> 0
NextHexDigit = Decnum - (Int(Decnum / 16) * 16)
If NextHexDigit < 10 Then
HexNum = Chr(Asc(NextHexDigit)) & HexNum
Else
HexNum = Chr(Asc("A") + NextHexDigit - 10) & HexNum
End If
Decnum = Int(Decnum / 16)
Wend
If HexNum = "" Then HexNum = "0"
valueX = HexNum
Addy = "&H" + valueX
Exit Function
WriteProcessMemory ProcessHandle, Addy, Value, 4, 0& 'Change the Four To two If you want For two bytes
CloseHandle ProcessHandle
End Function Call WriteLongPointer(AddressOfpointerHere, OffsetHere, ValueYouWAnt, WindowNameHere)
Ps. Make sure your offset is Not In hex but in Decimal number only!
__________________________________________________ _______________________
How to Read a pointer! Code: Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function GetWindowThreadProcessId Lib "User32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Function ReadLongPointer(Address As Long, Offset As Long, WindowName As String) As Long
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
Dim Valueofpointer As Long
Dim valueX As String
Dim Addy as string
hwnd = FindWindow(vbNullString, WindowName)
If hwnd = 0 Then
MsgBox "Could Not find process window!", vbCritical, "Read error"
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
MsgBox "Could Not Get a process handle!", vbCritical, "Read error"
Exit Function
End If
ReadProcessMem ProcessHandle, Address, Valueofpointer, 4, 0& 'Change the Four To two If you want For two bytes
' WriteLongPointer = Value
valueX = Val(Valueofpointer) + Val(Offset)
Decnum = valueX
HexNum = ""
While Decnum <> 0
NextHexDigit = Decnum - (Int(Decnum / 16) * 16)
If NextHexDigit < 10 Then
HexNum = Chr(Asc(NextHexDigit)) & HexNum
Else
HexNum = Chr(Asc("A") + NextHexDigit - 10) & HexNum
End If
Decnum = Int(Decnum / 16)
Wend
If HexNum = "" Then HexNum = "0"
valueX = HexNum
Addy = "&H" + valueX
Exit Function
ReadProcessMemory ProcessHandle, Addy, Value, 4, 0& 'Change the Four To two If you want For two bytes
ReadLongPointer = Value
CloseHandle ProcessHandle
End Function Dim Temp as Integer
Temp = ReadLongPointer(AddressOfpointerHere, OffsetHere, WindowNameHere)
Ps. Make sure your offset is Not In hex but in Decimal number only! | |
| |  |
09-19-2006, 04:30 AM
|
#2 (permalink)
| | | lol nice, i made one of these for warrock, like 2 weeks ago, lol | |
| |
09-19-2006, 07:22 PM
|
#3 (permalink)
| Full Member
Join Date: Sep 2006 Location: [.:::.] Age: 19 Posts: 286
GPoints: 195 Rep Power: 10 | Yea this code is old and I think there is one bug in it. So if you find it post it & I will fix it.
Updated, added a Read A Pointer function. | |
| |
07-18-2007, 08:23 PM
|
#4 (permalink)
| Full Member
Join Date: Jun 2007 Posts: 110
GPoints: 5 Rep Power: 8 | do you mean use api to realize pointer operation by vb, cool. good | |
| |
07-21-2007, 09:39 PM
|
#5 (permalink)
| Junior Member
Join Date: Jul 2007 Posts: 3
GPoints: 0 Rep Power: 0 | how can i use these codes | |
| |
08-12-2007, 11:31 PM
|
#6 (permalink)
| Full Member
Join Date: Sep 2006 Location: [.:::.] Age: 19 Posts: 286
GPoints: 195 Rep Power: 10 | Quote:
Originally Posted by brutalloss how can i use these codes | Download visual basic 6.0
Install it
New project
Place in module
Learn vb | |
| |
11-04-2007, 02:08 PM
|
#7 (permalink)
| Underground
Join Date: Nov 2006 Location: fewmitz@live.com Posts: 7,187
GPoints: 21,867 Rep Power: 23 | Quote:
Originally Posted by Thy Gamer Download visual basic 6.0
Install it
New project
Place in module
Learn vb | I'm pretty sure "Learn VB" should be a little higher up there... | |
| |  | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |