Page 1 of 3 123 LastLast
Results 1 to 15 of 34

Hybrid View

  1. #1
    CodeHPro's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    116
    Reputation
    10
    Thanks
    76
    My Mood
    Aggressive

    how to write/Read game memory with vb 2008

    this tut will show you how to read & write memory in any game
    first go to vb 2008 add a module paste this into it
    Code:
    Module Memory
        Public Const PROCESS_VM_READ = &H10
        Public Const PROCESS_VM_WRITE = (&H20)
        Public Const PROCESS_VM_OPERATION = (&H8)
        Public Const PROCESS_QUERY_INFORMATION = (&H400)
        Public Const PROCESS_READ_WRITE_QUERY = PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION + PROCESS_QUERY_INFORMATION
        Public Const PROCESS_ALL_ACCESS = &H1F0FFF
        Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
        Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Byte(), ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
        Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByVal lpBuffer() As Byte, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
        Public Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As UInteger, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr
        Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
        Public Function Game_Hwnd() As Int32
            Dim i As Int32 : Dim foundit As Boolean = False
            For Each p As Process In Process.GetProcessesByName("Halo2") ' Replace that with the games window text
                i = p.Id
                foundit = True : Exit For
            Next
            If foundit = True Then
                Return i
            Else
                MsgBox("Couldn't find Game")
                Return 0
            End If
        End Function
    #Region "Memory reading/Writing"
        Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Integer, ByVal Size As Integer)
            Try
                Dim GameReadWrite As Integer
                Dim PID As Integer = Game_Hwnd()
                GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)
    
                Dim bytArray() As Byte
                bytArray = BitConverter.GetBytes(Value)
                WriteProcessMemory(GameReadWrite, Address, bytArray, Size, 0)
    
                CloseHandle(GameReadWrite)
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte)
            Try
                Dim GameReadWrite As Integer
                Dim PID As Integer = Game_Hwnd()
                GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)
    
                WriteProcessMemory(GameReadWrite, Address, Value, Value.Length, 0)
    
                CloseHandle(GameReadWrite)
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte, ByVal Offset As Integer, ByVal Length As Integer)
            Try
                Dim Count1 As Integer
                For Count1 = 0 To Length - 1
                    WriteMemory(Address + Count1, Value(Count1 + Offset), 1)
                Next
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As String)
            Try
                Dim Length As Integer = Value.Length
                For I As Integer = 0 To Length - 1
                    WriteMemory(Address + I, Asc(Value.Chars(I)), 1)
                Next
                WriteMemory(Address + Length, 0, 1)
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Double)
            Try
                Dim Buffer(0 To 7) As Byte
                Buffer = BitConverter.GetBytes(Value)
                For I As Integer = 0 To 7
                    WriteMemory(Address + I, CInt(Buffer(I)), 1)
                Next
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        'Read Memory
        Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Double)
            Try
                Dim Buffer(7) As Byte
                Dim Temp As Integer
                For I As Integer = 0 To 7
                    ReadMemory(Address + I, Temp, 1)
                    Buffer(I) = CByte(Temp)
                Next
                Value = BitConverter.ToDouble(Buffer, 0)
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Integer, ByVal Size As Integer)
            Try
                Dim mValue As Integer
    
                Dim GameReadWrite As Integer
                Dim PID As Integer = Game_Hwnd()
                GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)
    
                ReadProcessMemory(GameReadWrite, Address, mValue, Size, 0)
                Value = mValue
    
                CloseHandle(GameReadWrite)
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub ReadMemory(ByVal Address As Integer, ByRef Value() As Byte, ByVal Length As Integer)
            Try
                Dim bytArray() As Byte
                Dim Count1 As Integer
                Dim tempInteger As Integer
                ReDim bytArray(Length - 1)
                For Count1 = 0 To Length - 1
                    ReadMemory(Address + Count1, tempInteger, 1)
                    bytArray(Count1) = CByte(tempInteger)
                Next
                Value = bytArray
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String)
            Try
                Dim intChar As Integer
                Dim Count1 As Integer
                Dim strTemp As String
                strTemp = String.Empty
                Count1 = 0
                Do
                    ReadMemory(Address + Count1, intChar, 1)
                    If intChar <> 0 Then strTemp = strTemp & Chr(intChar)
                    Count1 += 1
                Loop Until intChar = 0
                Value = strTemp
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
        Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String, ByVal Length As Integer)
            Try
                Dim intChar As Integer
                Dim Count1 As Integer
                Dim strTemp As String
                strTemp = String.Empty
                For Count1 = 0 To Length - 1
                    ReadMemory(Address + Count1, intChar, 1)
                    strTemp = strTemp & Chr(intChar)
                Next
                Value = strTemp
            Catch Ex As Exception
                'ShowError(Ex)
            End Try
        End Sub
    #End Region
        Function ReadInt(ByVal Address As Int32)
            Dim i As Int32
            ReadMemory(Address, i, 4)
            Return i
        End Function
        Sub WriteInt(ByVal Address As Int32, ByVal Value As Int32)
            WriteMemory(Address, Value, 4) ' We'll write a 4 bit to the address
        End Sub
    End Module
    then go to your form add a button to read the address name it "read" and add a label then double click the read button you just made and paste this code
    Code:
         
    'if your address you got from Cheat Engine or anything else has 
    gamename+address then use this 
     Label1.Text = ReadInt((BaseAddress + put address here))
    'if it doesn't have the + then use this 
     Label1.Text = ReadInt((put address here))
    now add a button to write to the address
    then paste this
    Code:
    'again if the address had + then use this
    WriteInt((BaseAddress + 5350952), value you want to set it to)
    if it didnt have + then use this 
    WriteInt((5350952), value you want to set it to)
    now paste this code in your form load event
    Code:
      Dim MyProcess As Process() = Process.GetProcessesByName("halo2") ' Replace that with the games window text
            Dim mainModule As ProcessModule
            mainModule = MyProcess(0).MainModule
            BaseAddress = CInt(mainModule.BaseAddress)
            BaseAddress = CInt(mainModule.BaseAddress)
    add this code right under where it says
    Public Class form1
    Code:
    Dim BaseAddress As Integer
        Dim MyProcess As Process() = Process.GetProcessesByName("halo2") ' Replace that with the games window text
    and your done! if you have any other questions add me on Xfire or msn
    Xfire-codehpro
    msn-ipivb@live.com
    you can download the source files at the bottom of this post
    here are some pic;s of what it should look like when your done



  2. The Following 35 Users Say Thank You to CodeHPro For This Useful Post:

    andre1979 (10-15-2013),AngerFist69 (05-03-2012),AnonEddy (11-15-2014),Avees (12-23-2013),catalink (11-13-2012),conan029 (01-27-2015),dodomut (08-15-2014),dtb2001 (05-06-2013),ExcLusFiZz (12-01-2015),hahagm78 (08-01-2014),Hellbombil (10-24-2009),hiago590 (02-04-2016),igustin10 (12-16-2015),kimleng (04-27-2015),kissofdiss (12-21-2013),marcosskr (08-16-2012),Medinyo (07-23-2015),mostafa2033 (06-12-2012),nucl34r (03-05-2010),Overnightmau5 (05-05-2012),patchaya (01-23-2014),Pixelyze (04-09-2014),SAHAR123456 (04-30-2012),soroush2010 (12-10-2015),src36 (06-16-2013),suffICE (01-10-2016),SuperRomu (03-07-2013),tasdawg (04-06-2013),TestUser1231234123 (08-15-2012),TonyMane123 (08-12-2013),Tum (05-06-2014),Vamphilim (07-11-2015),xxmalucaoxx (04-22-2015),xxwhoxx (03-09-2013),Zoom (10-23-2009)

  3. #2
    CoderNever's Avatar
    Join Date
    Feb 2009
    Gender
    female
    Location
    https://mpgh.net MPGHCash: $700,458,011
    Posts
    1,198
    Reputation
    131
    Thanks
    2,236
    My Mood
    Buzzed
    Lol..its true isn't it every single time I make a release someone recodes it and release a tut or the source..

  4. The Following User Says Thank You to CoderNever For This Useful Post:

    Hellbombil (10-24-2009)

  5. #3
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    whats it do though.......
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  6. The Following User Says Thank You to guza44_44 For This Useful Post:

    Hellbombil (10-24-2009)

  7. #4
    rwkeith's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Posts
    457
    Reputation
    11
    Thanks
    79
    My Mood
    Angelic
    Quote Originally Posted by guza44_44 View Post
    whats it do though.......
    Its a memory editor. Much like CE, MHS, etc. It reads addresses in a process and lets you write or edit addresses you choose.
    Goals In Life:
    [X] Become an Advanced Member
    [X]Release a tut on mpgh
    [0]Post 300 posts
    [X]Make a working hack
    [X] Learn c++

  8. The Following User Says Thank You to rwkeith For This Useful Post:

    Hellbombil (10-24-2009)

  9. #5
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Very nice! Thanks!

    Read my pm!
    Last edited by Zoom; 10-23-2009 at 10:31 AM.
    -Rest in peace leechers-

    Your PM box is 100% full.

  10. The Following User Says Thank You to Zoom For This Useful Post:

    Hellbombil (10-24-2009)

  11. #6
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    OMG so this is like my own cheat engine?

  12. The Following User Says Thank You to ac1d_buRn For This Useful Post:

    Hellbombil (10-24-2009)

  13. #7
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy

    Talking Help ME :D

    Quote Originally Posted by ac1d_buRn View Post
    OMG so this is like my own cheat engine?
    A bit of but hard to get addresses and change value.

    can any1 help me with this:

    Base:0x1037D0C8
    Final:0x1037D0C8
    Value: 120
    Address: 1037D0C8

    How do I write it to the process?
    Please help me!
    -Rest in peace leechers-

    Your PM box is 100% full.

  14. The Following User Says Thank You to Zoom For This Useful Post:

    Hellbombil (10-24-2009)

  15. #8
    CodeHPro's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    116
    Reputation
    10
    Thanks
    76
    My Mood
    Aggressive
    Quote Originally Posted by hejsan1 View Post
    A bit of but hard to get addresses and change value.

    can any1 help me with this:

    Base:0x1037D0C8
    Final:0x1037D0C8
    Value: 120
    Address: 1037D0C8

    How do I write it to the process?
    Please help me!
    send me a msg on xfie or msn and i can help you
    Quote Originally Posted by Coder Never View Post
    Lol..its true isn't it every single time I make a release someone recodes it and release a tut or the source..
    wtf you talking about ?

  16. The Following User Says Thank You to CodeHPro For This Useful Post:

    Hellbombil (10-24-2009)

  17. #9
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Quote Originally Posted by CodeHPro View Post
    send me a msg on xfie or msn and i can help you


    wtf you talking about ?
    Whats your msn?
    -Rest in peace leechers-

    Your PM box is 100% full.

  18. The Following User Says Thank You to Zoom For This Useful Post:

    Hellbombil (10-24-2009)

  19. #10
    CodeHPro's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    116
    Reputation
    10
    Thanks
    76
    My Mood
    Aggressive
    Quote Originally Posted by hejsan1 View Post
    Whats your msn?
    not hard to click the littel msn icon over here
    <----

  20. #11
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    Very nice 0.0 you are pro
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  21. The Following User Says Thank You to guza44_44 For This Useful Post:

    Hellbombil (10-24-2009)

  22. #12
    stevethehacker's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    USA bitch
    Posts
    416
    Reputation
    14
    Thanks
    51
    My Mood
    Bored
    fucking choob.don't bump old threads

  23. #13
    unseenhorror's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    Houston, TX
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Devilish
    well i guess i found the one dick sucking fagot that every forum has to have

    "stevenator" -- need i say more

  24. #14
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Quote Originally Posted by unseenhorror View Post
    well i guess i found the one dick sucking fagot that every forum has to have

    "stevenator" -- need i say more
    It smells bann!
    -Rest in peace leechers-

    Your PM box is 100% full.

  25. #15
    unseenhorror's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    Houston, TX
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Devilish
    as far as the rules go i did not find one that said not to post in a week old topic .. as far as the flaming goes i don't believe i have flamed anyone that didn't flame me first. so i guess the rules say "1. don't post in week old threads 2. flame anyone who does" that about right?

    Quote Originally Posted by stevethehacker View Post
    fucking choob.don't bump old threads
    Last edited by unseenhorror; 11-08-2009 at 11:18 AM.

Page 1 of 3 123 LastLast

Similar Threads

  1. [Request]Tutorial : How to Read/Writte Memory Proces
    By The Futur Young Coder in forum Programming Tutorials
    Replies: 0
    Last Post: 12-16-2010, 12:04 AM
  2. [TUT]How to Hack Flash Games with Cheat Engine
    By JIGS4W in forum Programming Tutorials
    Replies: 5
    Last Post: 11-22-2009, 05:59 AM
  3. C++ Memory write/read functions?
    By Spoking in forum C++/C Programming
    Replies: 16
    Last Post: 08-07-2009, 12:52 PM
  4. Replies: 5
    Last Post: 07-22-2009, 04:26 PM
  5. [Request] Write/Read Memory Tutorial
    By Infection_X in forum Visual Basic Programming
    Replies: 1
    Last Post: 08-15-2008, 06:11 PM

Tags for this Thread