hey all so i'm working on my first hack (steam version)
its a trainer for first i just include prestige hack. visual basic 2010
but there is a problem. i followd the tutorial of @jordel and i have done everything right. but in the tutorial its version 1.7.413
here is my source code (from jordel)
its my class.vb
Code:
Imports System.Runtime.InteropServices
Imports System.Text
Public Class trainner
#Region "Basic Stuff"
<DllImport("kernel32.dll")> _
Private Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Private Shared Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function GetKeyState(ByVal virtualKeyCode As Keys) As Short
End Function
Private pHandel As IntPtr
Public Function Process_Handle(ByVal ProcessName As String) As Boolean
Try
Dim ProcList As Process() = Process.GetProcessesByName(ProcessName)
If ProcList.Length = 0 Then
Return False
Else
pHandel = ProcList(0).Handle
Return True
End If
Catch ex As Exception
Console.Beep()
Console.WriteLine("Process_Handle - " + ex.Message)
Return False
End Try
End Function
Private Function Read(ByVal Address As Integer, ByVal Length As Integer) As Byte()
Dim Buffer As Byte() = New Byte(Length - 1) {}
Dim Zero As IntPtr = IntPtr.Zero
ReadProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
Return Buffer
End Function
Private Sub Write(ByVal Address As Integer, ByVal Value As Integer)
Dim Buffer As Byte() = BitConverter.GetBytes(Value)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
'This is the part you want to edit
#Region "Write Functions (Integer & String)"
Public Sub WriteInteger(ByVal Address As Integer, ByVal Value As Integer)
Write(Address, Value)
End Sub
Public Sub WriteString(ByVal Address As Integer, ByVal Text As String)
Dim Buffer As Byte() = New ASCIIEncoding().GetBytes(Text)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
Public Sub WriteBytes(ByVal Address As Integer, ByVal Bytes As Byte())
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Bytes, CUInt(Bytes.Length), Zero)
End Sub
Public Sub WriteNOP(ByVal Address As Integer)
Dim Buffer As Byte() = New Byte() {&H90, &H90, &H90, &H90, &H90}
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
#Region "Read Functions (Integer & String)"
Public Function ReadInteger(ByVal Address As Integer, Optional ByVal Length As Integer = 4) As Integer
Return BitConverter.ToInt32(Read(Address, Length), 0)
End Function
Public Function ReadString(ByVal Address As Integer, Optional ByVal Length As Integer = 4) As String
Return New ASCIIEncoding().GetString(Read(Address, Length))
End Function
Public Function ReadBytes(ByVal Address As Integer, ByVal Length As Integer) As Byte()
Return Read(Address, Length)
End Function
#End Region
#Region "Extra"
Public Function HotKey(ByVal Key As Keys) As Boolean
Return Convert.ToBoolean(GetKeyState(Key))
End Function
Private Check_res As Boolean = True
Public Function Check_Value(ByVal Value As String) As Integer
For Each a As Char In Value
If Char.IsNumber(a, 0) Then
Check_res = True
Else
Check_res = False
Return 0
Exit For
End If
Next
Return Convert.ToInt32(Value)
End Function
#End Region
End Class
and here is my code from "i dont know how its called"
Code:
Imports System.Text
Imports System.Runtime.InteropServices
Public Class Trainer
Dim MW3 As New my_class
Dim ProPerks_Offset As Integer = &H1DBAED2
Dim ProPerks_Bytes As Byte() = {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If MW3.Process_Handle("iw5mp") Then
MessageBox.Show("MW3 found")
MW3.WriteInteger(&H1DBA148, TextBox1.Text)
WriteBytes(ProPerks_Offset, ProPerks_Bytes)
Else
MsgBox("MW3 is not found")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
#Region "Basic Stuff"
<DllImport("kernel32.dll")> _
Private Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Private Shared Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function GetKeyState(ByVal virtualKeyCode As Keys) As Short
End Function
Private pHandel As IntPtr
Public Function Process_Handle(ByVal ProcessName As String) As Boolean
Try
Dim ProcList As Process() = Process.GetProcessesByName(ProcessName)
If ProcList.Length = 0 Then
Return False
Else
pHandel = ProcList(0).Handle
Return True
End If
Catch ex As Exception
Console.Beep()
Console.WriteLine("Process_Handle - " + ex.Message)
Return False
End Try
End Function
Private Function Read(ByVal Address As Integer, ByVal Length As Integer) As Byte()
Dim Buffer As Byte() = New Byte(Length - 1) {}
Dim Zero As IntPtr = IntPtr.Zero
ReadProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
Return Buffer
End Function
Private Sub Write(ByVal Address As Integer, ByVal Value As Integer)
Dim Buffer As Byte() = BitConverter.GetBytes(Value)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
'This is the part you want to edit
#Region "Write Functions (Integer & String)"
Public Sub WriteInteger(ByVal Address As Integer, ByVal Value As Integer)
Write(Address, Value)
End Sub
Public Sub WriteString(ByVal Address As Integer, ByVal Text As String)
Dim Buffer As Byte() = New ASCIIEncoding().GetBytes(Text)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
Public Sub WriteBytes(ByVal Address As Integer, ByVal Bytes As Byte())
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Bytes, CUInt(Bytes.Length), Zero)
End Sub
Public Sub WriteNOP(ByVal Address As Integer)
Dim Buffer As Byte() = New Byte() {&H90, &H90, &H90, &H90, &H90}
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
#Region "Read Functions (Integer & String)"
Public Function ReadInteger(ByVal Address As Integer, Optional ByVal Length As Integer = 4) As Integer
Return BitConverter.ToInt32(Read(Address, Length), 0)
End Function
Public Function ReadString(ByVal Address As Integer, Optional ByVal Length As Integer = 4) As String
Return New ASCIIEncoding().GetString(Read(Address, Length))
End Function
Public Function ReadBytes(ByVal Address As Integer, ByVal Length As Integer) As Byte()
Return Read(Address, Length)
End Function
#End Region
#Region "Extra"
Public Function HotKey(ByVal Key As Keys) As Boolean
Return Convert.ToBoolean(GetKeyState(Key))
End Function
Private Check_res As Boolean = True
Public Function Check_Value(ByVal Value As String) As Integer
For Each a As Char In Value
If Char.IsNumber(a, 0) Then
Check_res = True
Else
Check_res = False
Return 0
Exit For
End If
Next
Return Convert.ToInt32(Value)
End Function
#End Region
End Class
My question is: how can i bring this hack to 1.4.382 steam or rev28/rev25 from fourdeltaone IW5M?