[Help]Making a trainer[Solved]

Posts 1–15 of 22 · Page 1 of 2
[Help]Making a trainer[Solved]
Hello im trying to make a trainer in VB 2008.
i already made multiple trainers but that was whit CE.

So:
i have a text box and a button.
The address is for overall kills.
The trainer is for CoD MW2.
It will open but when i click the button nothing happens.
The code for the button is:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim buffer As Integer
Try
buffer = TextBox1.Text
Catch ex As Exception
MsgBox("Please write a valid number")
Exit Sub
End Try
'Writeinterger("iw4mp.exe",01B2B8B0, buffer)
End Sub
End Class

I look forward to hear your suggestions
post your modules, also use a numericupdown instead of a textbox...

use a long instead of an integer

where/what is the error?

Instead of textbox1.text you can use numericupdown1.value(easier)
Quote Originally Posted by Blubb1337 View Post
post your modules, also use a numericupdown instead of a textbox...

use a long instead of an integer

where/what is the error?

Instead of textbox1.text you can use numericupdown1.value(easier)
Well i am a noob at VB so fell free to yell out OMG after reading this:

1. What is a module and what does it do?

2. How do a use Long function?
Quote Originally Posted by pyton789 View Post
Well i am a noob at VB so fell free to yell out OMG after reading this:

1. What is a module and what does it do?

2. How do a use Long function?
Omg.

A module is many things, but its usually file of executable code. An executable (.exe) is a module, but that module can be linked with other modules called dynamically linked libraries (.dll) Modules however are distinct seperated units of code. A dll can be linked with many different executables and even other .dll even though it can not be executed directly it is independent of other modules. (for example: iw4mp.exe is a module)

Long is a variable type. However I assumed long and an integer were the same thing. At least I know a long long is, but I might be wrong. =/

Code:
'Writeinterger("iw4mp.exe",01B2B8B0, buffer)
Also Im pretty sure you spelled this wrong.
Quote Originally Posted by why06 View Post
Omg.

A module is many things, but its usually file of executable code. An executable (.exe) is a module, but that module can be linked with other modules called dynamically linked libraries (.dll) Modules however are distinct seperated units of code. A dll can be linked with many different executables and even other .dll even though it can not be executed directly it is independent of other modules. (for example: iw4mp.exe is a module)

Long is a variable type. However I assumed long and an integer were the same thing. At least I know a long long is, but I might be wrong. =/

Code:
'Writeinterger("iw4mp.exe",01B2B8B0, buffer)
Also Im pretty sure you spelled this wrong.
First off all thanks, but how do i use a module. Do i need to attach it to the form or what and how?

And what do you think i spelled wrong here:
Code:
'Writeinterger("iw4mp.exe",01B2B8B0, buffer)

To Blubb i cant use a numericupdown because it only goes up to 100
Quote Originally Posted by pyton789 View Post
First off all thanks, but how do i use a module. Do i need to attach it to the form or what and how?

And what do you think i spelled wrong here:
Code:
'Writeinterger("iw4mp.exe",01B2B8B0, buffer)

To Blubb i cant use a numericupdown because it only goes up to 100
Goto menu and click "Project". A list will appear. Click "Add Module" to add a new module. If you want to add an existing module from the hard-disk, click "Add Existing Item" from the same menu.

I think your spelling of "Writeinterger" isn't correct. It must be "WriteInteger" !!

You can extend the maximum value of numericupdown by going to properties and then changing "Maximum Value" field. Similarly change the minimum value if necessary !!
Quote Originally Posted by MJLover View Post
Goto menu and click "Project". A list will appear. Click "Add Module" to add a new module. If you want to add an existing module from the hard-disk, click "Add Existing Item" from the same menu.
But do i just need to add the game exe or what?

And thanks
search for trainer tutorials in vb section and you will get your modules...
You think your bad I don't know how to declare something =.=

What features will the trainer have?
Quote Originally Posted by Spookerzz View Post
You think your bad I don't know how to declare something =.=

What features will the trainer have?
Dim name as whattodeclare

dim s as string
dim i as integer

xD

Not hard =/

I made a trainer for cod6...including a hell of a lot features.
all trainer tutorials in this forum use pointers and mw2 dont. so it dosent work.
Quote Originally Posted by pyton789 View Post
all trainer tutorials in this forum use pointers and mw2 dont. so it dosent work.
instead of pointers, simply put the normal address...
i pmed you answer it
Hi again i still cant make it work.
I got a module from someguy of youtube because i didn't bother creating one.
i changed the form alittle but else it is the same exept i know get an error and it used to not just work at all.

i now have:
a button and a numericupdown
button code is:
Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Buffer As Integer
        Buffer = NumericUpDown1.Value
        Dim Buff As Integer
        Buff = "01B02B8B0"

        WriteInteger("iw4mp.exe", Buff, Buffer)
    End Sub
End Class
Module:

Code:
Module ReadWritingMemory
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer

    Private Declare Function WriteProcessMemory1 Lib "kernel32" Alias "WriteProcessMemory" (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 WriteProcessMemory2 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 Single
    Private Declare Function WriteProcessMemory3 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long

    Private Declare Function ReadProcessMemory1 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 ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single
    Private Declare Function ReadProcessMemory3 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long

    Const PROCESS_ALL_ACCESS = &H1F0FF

    Public Function WriteDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1)
            Next
            WriteInteger(Process, lvl, Value, nsize)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Function ReadDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Integer
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1)
            Next
            Dim vBuffer As Integer
            vBuffer = ReadInteger(Process, lvl, nsize)
            Return vBuffer
        Catch ex As Exception

        End Try
    End Function

    Public Function WriteDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Single, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1)
            Next
            WriteFloat(Process, lvl, Value, nsize)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Function ReadDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Single
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1)
            Next
            Dim vBuffer As Single
            vBuffer = ReadFloat(Process, lvl, nsize)
            Return vBuffer
        Catch ex As Exception

        End Try
    End Function

    Public Function WriteDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Long, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1)
            Next
            WriteLong(Process, lvl, Value, nsize)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Function ReadDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Long
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1)
            Next
            Dim vBuffer As Long
            vBuffer = ReadLong(Process, lvl, nsize)
            Return vBuffer
        Catch ex As Exception

        End Try
    End Function

    Public Sub WriteNOPs(ByVal ProcessName As String, ByVal Address As Long, ByVal NOPNum As Integer)
        Dim C As Integer
        Dim B As Integer
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Sub
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Sub
        End If

        B = 0
        For C = 1 To NOPNum
            Call WriteProcessMemory1(hProcess, Address + B, &H90, 1, 0&)
            B = B + 1
        Next C
    End Sub

    Public Sub WriteXBytes(ByVal ProcessName As String, ByVal Address As Long, ByVal Value As String)
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Sub
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Sub
        End If

        Dim C As Integer
        Dim B As Integer
        Dim D As Integer
        Dim V As Byte

        B = 0
        D = 1
        For C = 1 To Math.Round((Len(Value) / 2))
            V = Val("&H" & Mid$(Value, D, 2))
            Call WriteProcessMemory1(hProcess, Address + B, V, 1, 0&)
            B = B + 1
            D = D + 2
        Next C

    End Sub

    Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4)
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Sub
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Sub
        End If

        Dim hAddress, vBuffer As Integer
        hAddress = Address
        vBuffer = Value
        WriteProcessMemory1(hProcess, hAddress, CInt(vBuffer), nsize, 0)
    End Sub

    Public Sub WriteFloat(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Single, Optional ByVal nsize As Integer = 4)
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Sub
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Sub
        End If

        Dim hAddress As Integer
        Dim vBuffer As Single

        hAddress = Address
        vBuffer = Value
        WriteProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)
    End Sub

    Public Sub WriteLong(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Long, Optional ByVal nsize As Integer = 4)
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Sub
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Sub
        End If

        Dim hAddress As Integer
        Dim vBuffer As Long

        hAddress = Address
        vBuffer = Value
        WriteProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)
    End Sub

    Public Function ReadInteger(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Integer
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Function
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Function
        End If

        Dim hAddress, vBuffer As Integer
        hAddress = Address
        ReadProcessMemory1(hProcess, hAddress, vBuffer, nsize, 0)
        Return vBuffer
    End Function

    Public Function ReadFloat(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Single
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Function
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Function
        End If

        Dim hAddress As Integer
        Dim vBuffer As Single

        hAddress = Address
        ReadProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)
        Return vBuffer
    End Function

    Public Function ReadLong(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Long
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
        End If
        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
        If MyP.Length = 0 Then
            MessageBox.Show(ProcessName & " isn't open!")
            Exit Function
        End If
        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
        If hProcess = IntPtr.Zero Then
            MessageBox.Show("Failed to open " & ProcessName & "!")
            Exit Function
        End If

        Dim hAddress As Integer
        Dim vBuffer As Long

        hAddress = Address
        ReadProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)
        Return vBuffer
    End Function

End Module

Did i write the correct thing here?:

Code:
        If ProcessName.EndsWith("iw4mp.exe") Then
            ProcessName = ProcessName.Replace("iw4mp.exe", "iw4mp.exe")
when i click the button i get this error "Conversion from string "01B02B8B0" to type 'Integer' is not valid."

Does it matter that the module isn't crated by one of those undetectet module makers(it actuelly might be i just dont know)

Is this correct?:
Code:
        Buff = "01B02B8B0"

        WriteInteger("iw4mp.exe", Buff, Buffer)
I mean the top there i wrote Buff =....(i did it because if i did it like this
Code:
        WriteInteger("iw4mp", 01B02B8B0, Buffer)
then it didn't work and it wanted me to make a "," here 01,B02B...)

Thanks in advance
I'll allow it, just next time create a new thread or PM/VM the person who tried helping you initially.

we don't allow posting in threads = or > 7 days
Posts 1–15 of 22 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us