Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic

    BO2 Memory Class [VB]

    So, since there was an "ask/beg" for this:
    Code:
    Class BO2_MemoryClass
        Private GameProc As String = ""
        Private Function OpenGame() As IntPtr
            If System.Diagnostics.Process.GetProcessesByName(GameProc).Length = 1 Then
                Return System.Diagnostics.Process.GetProcessesByName(GameProc)(0).Handle
            End If
            Return New IntPtr(0)
        End Function
        Public Enum ProcessAccessFlags As UInteger
            All = &H1F0FFF
            Terminate = &H1
            CreateThread = &H2
            Operation = &H8
            Read = &H10
            Write = &H20
            DupHandle = &H40
            SetInformation = &H200
            QueryInformation = &H400
            Synchronize = &H100000
        End Enum
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function OpenProcess(dwDesiredAccess As ProcessAccessFlags, <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.Bool)> bInheritHandle As Boolean, dwProcessId As Integer) As IntPtr
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function CloseHandle(hObject As IntPtr) As Boolean
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function ReadProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function WriteProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
        End Function
    
    
        Public Function Process_Handle(ProcessName As String) As Boolean
            GameProc = ProcessName
            If System.Diagnostics.Process.GetProcessesByName(ProcessName).Length = 1 Then
                Return True
            End If
            Return False
        End Function
    #Region "Write Stuff"
        Public Sub WriteString(Address As Integer, Text As String, Optional Length As Integer = -1)
            If Length = -1 Then
                Length = Text.Length
            End If
            Dim Buffer As Byte() = New System.Text.ASCIIEncoding().GetBytes(Text)
            Dim Zero As IntPtr = IntPtr.Zero
            WriteProcessMemory(OpenGame(), New IntPtr(Address), Buffer, CUInt(Length), Zero)
        End Sub
        Public Sub WriteInt(Address As Integer, Value As Integer)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteUInt(Address As UInteger, Value As UInteger)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteFloat(Address As Integer, Value As Single)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteBytes(Address As Integer, ByteArray As Byte())
            Dim buffer As Byte() = ByteArray
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
        End Sub
    #End Region
    #Region "Read Stuff"
        Public Function ReadString(Address As Integer, Length As Integer) As String
            Dim buffer As Byte() = New Byte(Length - 1) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
            Return New System.Text.ASCIIEncoding().GetString(buffer, 0, Length)
        End Function
        Public Function ReadInt(Address As Integer) As Integer
            Dim buffer As Byte() = New Byte(3) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToInt32(buffer, 0)
        End Function
        Public Function ReadUInt(Address As UInteger) As UInteger
            Dim buffer As Byte() = New Byte(3) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToUInt32(buffer, 0)
        End Function
        Public Function ReadFloat(Address As UInteger) As Single
            Dim buffer As Byte() = New Byte(7) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToSingle(buffer, 0)
        End Function
        Public Function ReadBytes(Address As Integer, BytesLength As Integer) As Byte()
            Dim buffer As Byte() = New Byte(BytesLength - 1) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
            Return buffer
        End Function
    #End Region
    #Region "Pointers"
        Public Function BaseAddress(Module_Name As String) As Integer
            Try
                If System.Diagnostics.Process.GetProcessesByName(GameProc).Length <> 0 Then
                    For Each [Mod] As System.Diagnostics.ProcessModule In System.Diagnostics.Process.GetProcessesByName(GameProc)(0).Modules
                        If [Mod].ModuleName = Module_Name Then
                            Return [Mod].BaseAddress.ToInt32()
                        End If
                    Next
                    Return 0
                Else
                    Return 0
                End If
            Catch
                Console.WriteLine("Base Address Error")
                Return 0
            End Try
        End Function
        Public Function Pointers([Module] As String, PointersX As Integer()) As Integer
            Dim Base As Integer = BaseAddress([Module]) + PointersX(0)
            Dim Runner As Integer = ReadInt(Base) + PointersX(1)
            Dim i As Integer = 2
            While i <> PointersX.Length - 2
                Runner = ReadInt(Runner) + PointersX(i)
                i += 1
            End While
    
            Return Runner
        End Function
    #End Region
    End Class

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  2. The Following User Says Thank You to Jorndel For This Useful Post:

    Pingo (01-05-2013)

  3. #2
    Coper's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    BlackOps3.exe
    Posts
    449
    Reputation
    17
    Thanks
    3,648
    My Mood
    In Love
    Quote Originally Posted by Jorndel View Post
    So, since there was an "ask/beg" for this:
    Code:
    Class BO2_MemoryClass
        Private GameProc As String = ""
        Private Function OpenGame() As IntPtr
            If System.Diagnostics.Process.GetProcessesByName(GameProc).Length = 1 Then
                Return System.Diagnostics.Process.GetProcessesByName(GameProc)(0).Handle
            End If
            Return New IntPtr(0)
        End Function
        Public Enum ProcessAccessFlags As UInteger
            All = &H1F0FFF
            Terminate = &H1
            CreateThread = &H2
            Operation = &H8
            Read = &H10
            Write = &H20
            DupHandle = &H40
            SetInformation = &H200
            QueryInformation = &H400
            Synchronize = &H100000
        End Enum
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function OpenProcess(dwDesiredAccess As ProcessAccessFlags, <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.Bool)> bInheritHandle As Boolean, dwProcessId As Integer) As IntPtr
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function CloseHandle(hObject As IntPtr) As Boolean
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function ReadProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
        End Function
        <Runtime.InteropServices.DllImport("kernel32.dll")> _
        Private Shared Function WriteProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
        End Function
    
    
        Public Function Process_Handle(ProcessName As String) As Boolean
            GameProc = ProcessName
            If System.Diagnostics.Process.GetProcessesByName(ProcessName).Length = 1 Then
                Return True
            End If
            Return False
        End Function
    #Region "Write Stuff"
        Public Sub WriteString(Address As Integer, Text As String, Optional Length As Integer = -1)
            If Length = -1 Then
                Length = Text.Length
            End If
            Dim Buffer As Byte() = New System.Text.ASCIIEncoding().GetBytes(Text)
            Dim Zero As IntPtr = IntPtr.Zero
            WriteProcessMemory(OpenGame(), New IntPtr(Address), Buffer, CUInt(Length), Zero)
        End Sub
        Public Sub WriteInt(Address As Integer, Value As Integer)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteUInt(Address As UInteger, Value As UInteger)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteFloat(Address As Integer, Value As Single)
            Dim buffer As Byte() = BitConverter.GetBytes(Value)
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
        End Sub
        Public Sub WriteBytes(Address As Integer, ByteArray As Byte())
            Dim buffer As Byte() = ByteArray
            Dim R As IntPtr
            WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
        End Sub
    #End Region
    #Region "Read Stuff"
        Public Function ReadString(Address As Integer, Length As Integer) As String
            Dim buffer As Byte() = New Byte(Length - 1) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
            Return New System.Text.ASCIIEncoding().GetString(buffer, 0, Length)
        End Function
        Public Function ReadInt(Address As Integer) As Integer
            Dim buffer As Byte() = New Byte(3) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToInt32(buffer, 0)
        End Function
        Public Function ReadUInt(Address As UInteger) As UInteger
            Dim buffer As Byte() = New Byte(3) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToUInt32(buffer, 0)
        End Function
        Public Function ReadFloat(Address As UInteger) As Single
            Dim buffer As Byte() = New Byte(7) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
            Return BitConverter.ToSingle(buffer, 0)
        End Function
        Public Function ReadBytes(Address As Integer, BytesLength As Integer) As Byte()
            Dim buffer As Byte() = New Byte(BytesLength - 1) {}
            Dim R As IntPtr
            ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
            Return buffer
        End Function
    #End Region
    #Region "Pointers"
        Public Function BaseAddress(Module_Name As String) As Integer
            Try
                If System.Diagnostics.Process.GetProcessesByName(GameProc).Length <> 0 Then
                    For Each [Mod] As System.Diagnostics.ProcessModule In System.Diagnostics.Process.GetProcessesByName(GameProc)(0).Modules
                        If [Mod].ModuleName = Module_Name Then
                            Return [Mod].BaseAddress.ToInt32()
                        End If
                    Next
                    Return 0
                Else
                    Return 0
                End If
            Catch
                Console.WriteLine("Base Address Error")
                Return 0
            End Try
        End Function
        Public Function Pointers([Module] As String, PointersX As Integer()) As Integer
            Dim Base As Integer = BaseAddress([Module]) + PointersX(0)
            Dim Runner As Integer = ReadInt(Base) + PointersX(1)
            Dim i As Integer = 2
            While i <> PointersX.Length - 2
                Runner = ReadInt(Runner) + PointersX(i)
                i += 1
            End While
    
            Return Runner
        End Function
    #End Region
    End Class
    Thx jorndel now get ready for my new black ops 2 hack yea!!

    YOU ONLY LIVE ONCE


  4. #3
    HiMM4's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    1
    My Mood
    Doh
    wtf is this xd

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by HiMM4 View Post
    wtf is this xd


    If you don't know what this is, then you're in the wrong section mate

    This is for coders/hackers.
    This is a class that will allow coders to write hacks, and hack the game with memory editing.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

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

    ~Syphox (01-14-2013)

  7. #5
    HiMM4's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    1
    My Mood
    Doh
    looks very complicated

  8. #6
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by HiMM4 View Post
    looks very complicated
    That's why I did the "hardcore" work, and you can have fun :P

    What you do now is just: WriteInteger(&H12345, 9999)
    For 9999 ammo for your current weapon. (Fake address: Address = &H12345 )


    ---------- Post added at 07:59 PM ---------- Previous post was at 07:59 PM ----------

    Quote Originally Posted by HiMM4 View Post
    looks very complicated
    If you want to learn: I'm able to help

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  9. #7
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Jorndel View Post

    That's why I did the "hardcore" work, and you can have fun :P
    Yeah cause WriteProcessMemory is so hardcore.
     
    Just kidding, lub you


    Quote Originally Posted by HiMM4 View Post
    looks very complicated
    It isn't after you learn the basics ^^


    CoD Minion from 09/19/2012 to 01/10/2013

  10. #8
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by -InSaNe- View Post
    Yeah cause WriteProcessMemory is so hardcore.
     
    Just kidding, lub you



    It isn't after you learn the basics ^^

    Why I used: " "


     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  11. The Following User Says Thank You to Jorndel For This Useful Post:

    HiMM4 (01-04-2013)

  12. #9
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Btw, just something I noticed, you're P/Invoking OpenProcess but not even using it Not that it'd make any difference to remove it but oh well.. I just wanted to point that out


    CoD Minion from 09/19/2012 to 01/10/2013

  13. The Following User Says Thank You to MarkHC For This Useful Post:

    HiMM4 (01-04-2013)

  14. #10
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by -InSaNe- View Post
    Btw, just something I noticed, you're P/Invoking OpenProcess but not even using it Not that it'd make any difference to remove it but oh well.. I just wanted to point that out
    Hmmmzzzz
    Fine then..

    I'll do a new one then

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  15. The Following User Says Thank You to Jorndel For This Useful Post:

    HiMM4 (01-04-2013)

  16. #11
    HiMM4's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    1
    My Mood
    Doh
    ahah no ty dont want to learn it just want to use them

  17. #12
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,920
    Reputation
    574
    Thanks
    5,050
    My Mood
    Twisted
    Quote Originally Posted by -InSaNe- View Post
    Btw, just something I noticed, you're P/Invoking OpenProcess but not even using it Not that it'd make any difference to remove it but oh well.. I just wanted to point that out
    *Using old memory class of jorni*
    I saw it once, no idea what it does
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  18. #13
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Isaakske View Post

    *Using old memory class of jorni*
    I saw it once, no idea what it does
    Wasn't I to update it for you?
    Or you don't want that? :S

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  19. The Following User Says Thank You to Jorndel For This Useful Post:

    Coolhead17 (08-20-2013)

  20. #14
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,920
    Reputation
    574
    Thanks
    5,050
    My Mood
    Twisted
    Quote Originally Posted by Jorndel View Post


    Wasn't I to update it for you?
    Or you don't want that? :S
    Im fine with the old one
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  21. #15
    abdulmailk's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    My Mood
    Busy
    how to use ??

Page 1 of 2 12 LastLast

Similar Threads

  1. C# Memory Class (Writen by Jorndel)
    By Jorndel in forum Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    Replies: 12
    Last Post: 03-03-2019, 08:45 AM
  2. VB.Net Memory Class (Writen by Jorndel)
    By Jorndel in forum Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    Replies: 25
    Last Post: 11-02-2017, 09:59 PM
  3. [Help] c# memory class
    By xXFleshpoundXx in forum C# Programming
    Replies: 8
    Last Post: 01-12-2013, 05:24 AM
  4. [Help Request] memory class
    By Coper in forum Call of Duty Black Ops 2 Help
    Replies: 5
    Last Post: 01-04-2013, 03:19 AM
  5. [Help] Memory Hack base Using Classes Help I Don't Get It
    By kmanev073 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 10
    Last Post: 01-05-2012, 04:21 AM