UnhappyNeed Help with multiple offsets in Source Code [Visual Basic 2010 Express ]

Posts 1–5 of 5 · Page 1 of 1
Need Help with multiple offsets in Trainer Code [Visual Basic 2010 Express ]
Hey there. I want to code my first trainer and need some help. I googled some time and found the the ReadingWritingMemory.vb Module. I already found the basic pointer but with 2 offsets

How I have to put it in the code ?

My Code:

Code:
WriteDMAInteger("ACRSP", &H28A59FC, Offsets:={&H}, Value:=TextBox1.Text, Level:=1, nsize:=4)
My Basic Pointer : 028A59FC

My Offsets:
40
24

Sry. Its my first Thread .
First of all , make a module , call it what ever
then replace all the codes in it with this one :

Code:
Imports System.Runtime.InteropServices

Module WritePointers
    Private Declare Function GetAsyncKeyState Lib "User32" (ByVal Tuş As Integer) As Integer

    <DllImport("kernel32", EntryPoint:="ReadProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function ReadMemoryByte(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
    End Function

    <DllImport("kernel32", EntryPoint:="ReadProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function ReadMemoryDouble(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 8, Optional ByRef Bytes As Integer = 0) As Double
    End Function

    <DllImport("kernel32", EntryPoint:="ReadProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function ReadMemoryFloat(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Single
    End Function

    <DllImport("kernel32", EntryPoint:="ReadProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function ReadMemoryInteger(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
    End Function
    <DllImport("kernel32", EntryPoint:="WriteProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function WriteMemoryByte(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
    End Function

    <DllImport("kernel32", EntryPoint:="WriteProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function WriteMemoryDouble(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Double
    End Function

    <DllImport("kernel32", EntryPoint:="WriteProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function WriteMemoryFloat(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Single
    End Function

    <DllImport("kernel32", EntryPoint:="WriteProcessMemory", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
    Private Function WriteMemoryInteger(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
    End Function
    Public Sub WritePointerInteger(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Integer, ByVal ParamArray Offset As Integer())
        If (Process.GetProcessesByName(EXENAME).Length <> 0) Then
            Dim handle As Integer = CInt(Process.GetProcessesByName(EXENAME)(0).Handle)
            If (handle <> 0) Then
                Dim num3 As Integer
                Dim num2 As Integer
                For Each num2 In Offset
                    num3 = 0
                    ReadMemoryInteger(handle, Pointer, Pointer, 4, num3)
                    Pointer = (Pointer + num2)
                Next
                num3 = 0
                WriteMemoryInteger(handle, Pointer, Value, 4, num3)
            End If
        End If
    End Sub
End Module

How to use :

Code:
WritePointerInteger("YourGame",&H028A59FC,'value',&H40,&H24)
Note , That these codes are ripped off my old hacks, so the you might some useless codes in it as well...
If you really want geting startet with your own trainer, you should be able to create your own WPM and RPM functions. I mean you need 2 DLL imports and 2 functions and you'r done.

In spite of all this, you could use the functions provided by @Code4Dot. There is a lot of trash in his code but it is usable.
If you need help don't fear to ask, but if you want to understand all of this: read the functions carefully and try to get the signification of them .
Quote Originally Posted by RoPMadM View Post
There is a lot of trash in his code but it is usable.
I see actually of "trash" only GetAsyncKeyState, that has nothing to do, at least in that module ^^
damn , i wrote so fast till i forgot to add alot of words ! wtf , wrong english etc.. xD

but anyway , i said it's ripped off from my old hack's project , so it might have some trash D:
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us