Source Code How to Hack Games with Visual Basic

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Brutalon

Newbie
Dank Tier Donator
Nov 12, 2014
13
338
0
Old but Gold. I won't explain much more then how to use it, cause most of this is Basic shit.
We will use a Module to define our MEMwriting Functions. Credits to whoever was the OP (years and years ago)


C#:
Module Module1
    Private Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private Declare Function WriteProcessMemory 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 WriteFloatMemory 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 Integer
    Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
    Private Declare Function ReadProcessMemory 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 CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer
    Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer

    Public RBuff1 As Long
    Public RBuff2 As Single
    Public RBuff3 As Integer

    'WriteMemory
    Public Function WriteMemory(ByVal Address As Integer, ByVal Value As Long, ByVal Bytes As Integer)
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        WriteProcessMemory(processHandle, Address, Value, Bytes, Nothing)
        CloseHandle(processHandle)
    End Function

    'ReadFloat
    Public Function ReadFloat(ByVal Address As Single)
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Address, RBuff1, 4, Nothing)
        CloseHandle(processHandle)
        Return RBuff1
    End Function

    'WriteFloat
    Public Function WriteFloat(ByVal Address As Integer, ByVal Value As Single)
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        WriteFloatMemory(processHandle, Address, Value, 4, Nothing)
        CloseHandle(processHandle)
    End Function

    'ReadLong
    Public Function ReadLong(ByVal Address As Integer)
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Address, RBuff1, 4, Nothing)
        CloseHandle(processHandle)
        Return RBuff1
    End Function

    'ReadFloatPointer
    Public Function ReadFloatPointer(ByVal Base As Integer, ByVal Offset As Short)
        Dim fullAddress As Long
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset
        ReadFloat(processHandle, fullAddress, RBuff2, 4, Nothing)
        Return RBuff2
        CloseHandle(processHandle)
    End Function

    'ReadLongPointer
    Public Function ReadLongPointer(ByVal Base As Integer, ByVal Offset As Short, ByVal Bytes As Integer) 'ReadLongPointer
        Dim fullAddress As Long
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset
        ReadProcessMemory(processHandle, fullAddress, RBuff3, Bytes, Nothing)
        Return RBuff3
        CloseHandle(processHandle)
    End Function

    'WriteFloatPointer
    Public Function WriteFloatPointer(ByVal Base As Integer, ByVal Offset As Short, ByVal Value As Single)
        Dim fullAddress As Long
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset
        WriteFloatMemory(processHandle, fullAddress, Value, 4, Nothing)
        CloseHandle(processHandle)
    End Function

    'WriteLongPointer
    Public Function WriteLongPointer(ByVal Base As Integer, ByVal Offset As Short, ByVal Value As Long, ByVal Bytes As Integer)
        Dim fullAddress As Long
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        ReadProcessMemory(processHandle, Base, RBuff1, 4, Nothing)
        fullAddress = RBuff1 + Offset
        WriteProcessMemory(processHandle, fullAddress, Value, Bytes, Nothing)
        CloseHandle(processHandle)
    End Function

    'NOP
    Public Function NOP(ByVal Address As Integer, ByVal value As Integer)
        Dim GameLookUp As Process() = Process.GetProcessesByName("Game")
        If GameLookUp.Length = 0 Then
            End
        End If
        Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
        WriteProcessMemory(processHandle, Address, value, 1, Nothing)
        CloseHandle(processHandle)
    End Function
End Module
And for the Guys who are to lazy to figure it out thereself, now u can use this Function in ur main Form.

C#:
WriteMemory(&H123ABC, 100, 4)
Adress as Integer, Value as Long, Bytes as Integer
C#:
ReadFloat(&H123ABC)
Adress as Single
C#:
WriteFloat(&H123ABC, 100.0)
Adress as Integer, Value as Single
C#:
ReadFloatPointer(&H123ABC, &HF3)
Base as Integer, Offset as short
C#:
WriteFloatPointer(&H123ABC, &HF3, 100.0)
Base as Integer, Offset as short, Value as Single
C#:
ReadLongPointer(&H123ABC, &HF3, 4)
Base as Integer, Offset as short, Bytes as Integer
C#:
WriteLongPointer(&H123ABC, &HF3, 100, 4)
Base as Integer, Offset as short, Value as Long, Bytes as Integer

For the people wondering for what u need the Read(..) Functions I'll give u an example

If u want to create a Jump hack (u Jump higher then before) it would work with the WriteFunction alone, too but u would have to set a Base Value (Base Height) ur jumping from (example 0).
If u have a terrain without the same height (with hills for example) it would be kinda usefull to determite in which height u are if u use this Function so u scan the height u are and THEN u Add +50.

It will be much cleaner with this.
 

rN'

Jr.Hacker
Meme Tier VIP
Jan 19, 2014
340
5,268
41
Maybe you should imrpove your WriteXPointer to smth like that:
C++:
ReadXPointer(ByVal Base as Integer, ByVal Offset as Integer() ByVal nCount as Integer )
ReadXPointer( &H7C5DF47, {&HF3, &H7F}, 2 )
Dunno how it works with arrays in vb..

anyways good job
 

Anomxus

Jr.Coder
Full Member
Nobleman
Jun 19, 2012
59
453
2
For reading I use this,
C++:
Public Shared Function ReadMemory(Of T)(ByVal pHandle As IntPtr, ByVal address As IntPtr) As T
	Dim bufferSize As Integer = Marshal.SizeOf(GetType(T))
	Dim buffer(bufferSize - 1) As Byte
	Dim read As IntPtr
	ReadProcessMemory(pHandle, address, buffer, New IntPtr(bufferSize), read)
	Dim gHandle As GCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned)
	Dim value As T = CType(Marshal.PtrToStructure(gHandle.AddrOfPinnedObject(), GetType(T)), T)
	gHandle.Free()
	Return value
End Function
Its really easy to read (almost) all variable types.

Ex.
C++:
ReadMemory(Of UInteger)(Wrapper.CSGOHelper.ProcessHandle, Wrapper.MemoryManager.Client + Wrapper.MemoryManager.GetOffset("EntityLocal"))
 

Brutalon

Newbie
Dank Tier Donator
Nov 12, 2014
13
338
0
Maybe you should imrpove your WriteXPointer to smth like that:
C++:
ReadXPointer(ByVal Base as Integer, ByVal Offset as Integer() ByVal nCount as Integer )
ReadXPointer( &H7C5DF47, {&HF3, &H7F}, 2 )
Dunno how it works with arrays in vb..

anyways good job
Its easy to improve the Module Functions in a way u want it. I normally use vb just to test things so the version is enough for me
 

rN'

Jr.Hacker
Meme Tier VIP
Jan 19, 2014
340
5,268
41
Its easy to improve the Module Functions in a way u want it. I normally use vb just to test things so the version is enough for me
As I said I don't know how this works in VB.NET because I'm coding in C++
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods