Solved👍 Can't fix the problem...

Posts 1–5 of 5 · Page 1 of 1
👍 Can't fix the problem...
Well im working on my first little trainer (im not done yet) but every time i want to test it, this happens:



can somebody maybe tell me the problem or help me please?

(I know im a noobie and this might seem lame to you guys but it's my first one)

Here are the codes:

NUMBER 1

Code:
Imports System.Runtime.InteropServices

Public Class Mw3_Trainer
    <Flags()> _
    Public Enum ProcessAccessType
        PROCESS_TERMINATE = (&H1)
        PROCESS_CREATE_THREAD = (&H2)
        PROCESS_SET_SESSIONID = (&H4)
        PROCESS_VM_OPERATION = (&H8)
        PROCESS_VM_READ = (&H10)
        PROCESS_VM_WRITE = (&H20)
        PROCESS_DUP_HANDLE = (&H40)
        PROCESS_CREATE_PROCESS = (&H80)
        PROCESS_SET_QUOTA = (&H100)
        PROCESS_SET_INFORMATION = (&H200)
        PROCESS_QUERY_INFORMATION = (&H400)
    End Enum
    <DllImport("kernel32.dll")> _
    Public Shared Function OpenProcess(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Int32, ByVal dwProcessId As UInt32) As IntPtr
    End Function
    <DllImport("kernel32.dll")> _
    Public Shared Function CloseHandle(ByVal hObject As IntPtr) As Int32
    End Function
    <DllImport("kernel32.dll")> _
    Public Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Int32
    End Function
    <DllImport("kernel32.dll")> _
    Public 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


    Public Function Hack(ByVal Application As String) As Boolean
        Dim pArray As Process() = Process.GetProcessesByName(Application)
        If pArray.Length = 0 Then
            Return True
        End If
        ReadProcess = pArray(0)
        Open()
        Return False
    End Function
    Public Sub SetInt(ByVal Address As Integer, ByVal Value As Integer)
        Dim byteswritten As Integer
        Write(Address, BitConverter.GetBytes(Value), byteswritten)
    End Sub


    Public Sub SetByte(ByVal Address As Integer, ByVal Value As Byte())
        Dim byteswritten As Integer
        Write(Address, Value, byteswritten)
    End Sub


    Private Property ReadProcess() As Process
        Get
            Return m_ReadProcess
        End Get
        Set(ByVal value As Process)
            m_ReadProcess = value
        End Set
    End Property
    Private m_ReadProcess As Process = Nothing
    Private m_hProcess As IntPtr = IntPtr.Zero
    Private Sub Open()
        Dim access As ProcessAccessType
        access = ProcessAccessType.PROCESS_VM_READ Or ProcessAccessType.PROCESS_VM_WRITE Or ProcessAccessType.PROCESS_VM_OPERATION
        m_hProcess = OpenProcess(CUInt(access), 1, CUInt(m_ReadProcess.Id))
    End Sub
    Private Sub CloseHandle()
        Dim iRetValue As Integer
        iRetValue = CloseHandle(m_hProcess)
        If iRetValue = 0 Then
            Throw New Exception("CloseHandle failed")
        End If
    End Sub
    Private Sub Write(ByVal MemoryAddress As IntPtr, ByVal bytesToWrite As Byte(), ByRef bytesWritten As Integer)
        Dim ptrBytesWritten As IntPtr
        WriteProcessMemory(m_hProcess, MemoryAddress, bytesToWrite, CUInt(bytesToWrite.Length), ptrBytesWritten)
        bytesWritten = ptrBytesWritten.ToInt32()
    End Sub

    Sub SetInt(p1 As Integer, mylist As Integer)
        Throw New NotImplementedException
    End Sub

End Class
Number 2

Code:
Public Class Form1

    Dim MW3 As New Mw3_Trainer

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MW3.Hack("iw5mp")
        MW3.SetInt(&H1DC04C8, MaskedTextBox1.Text)
    End Sub


    Private MyList As Integer() = {0, 300, 1200, 2700, 4800}
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        MW3.Hack("iw5mp")
        MW3.SetInt(&H1DC02B8, MyList(ComboBox1.SelectedIndex))
    End Sub
End Class
/Fixed Image

It's mostly like because the input is wrong.
Ensure you use numbers only.

(I'll check the code)


Remove this part: (Memory Class, you added it by mistake)
Code:
Sub SetInt(p1 As Integer, mylist As Integer)
        Throw New NotImplementedException
    End Sub
Ensure you put the address. (&H123) to the correct value
Ok! Thank you for checking it over!
Quote Originally Posted by Pepsi- View Post
Ok! Thank you for checking it over!
Let me know if it's solved or if you need any further help
Ok, it's working now Thanks for the help once again
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us