Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Globalization
- Imports System.Text.RegularExpressions
- Public Class Form1
- Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer() As Byte, ByVal iSize As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
- Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal iSize As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
- Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAcess As UInt32, ByVal bInheritHandle As Boolean, ByVal dwProcessId As Int32) As IntPtr
- Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As IntPtr) As Boolean
- Private PROCESS_ALL_ACCESS As UInt32 = &H1F0FFF
- Private CSGO_process As Process
- Private CSGO_handle As Int32
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- CSGO_process = Process.GetProcessesByName("csgo")(0)
- CSGO_handle = OpenProcess(PROCESS_ALL_ACCESS, False, CSGO_process.Id)
- Dim ClientDLL As Int32
- Dim Pattern As String = "81C6????????8945FC890683F9FF7403894E045651"
- For Each [module] As System.Diagnostics.ProcessModule In CSGO_process.Modules
- If [module].FileName.IndexOf("client.dll") <> -1 Then
- ClientDLL = [module].BaseAddress
- End If
- Next
- ListBox1.Items.Clear()
- Dim EntityList As String = Hex(BitConverter.ToInt32(ReadMemory(AobScan(ClientDLL, &H1800000, "81C6????????8945FC890683F9FF7403894E045651", 0) + 2, 4), 0) - ClientDLL + &H10)
- Dim GlowObjectBase As String = Hex(BitConverter.ToInt32(ReadMemory(AobScan(ClientDLL, &H1800000, "F30F7F05????????83C801C705????????????????660F6F05", 0) + 4, 4), 0) - ClientDLL)
- Dim PlayerJump As String = Hex(BitConverter.ToInt32(ReadMemory(AobScan(ClientDLL, &H1800000, "8915????????8B15????????F6C203740383CE08A808BF????????0F457DFC", 0) + 2, 4), 0) - ClientDLL)
- Dim PlayerAttack As String = Hex(BitConverter.ToInt32(ReadMemory(AobScan(ClientDLL, &H1800000, "8915????????8B15????????F6C203740383CE04A804BF????????", 0) + 2, 4), 0) - ClientDLL)
- ListBox1.Items.Add("EntityList: " & EntityList)
- ListBox1.Items.Add("GlowObjectBase: " & GlowObjectBase)
- ListBox1.Items.Add("Player_Jump: " & PlayerJump)
- ListBox1.Items.Add("Player_Attack: " & PlayerAttack)
- CloseHandle(CSGO_handle)
- End Sub
- Private Function ReadMemory(ByVal Address As Int32, ByVal Length As Int32) As Byte()
- Dim Bytes(Length - 1) As Byte
- ReadProcessMemory(CSGO_handle, Address, Bytes, Bytes.Length, vbNull)
- Return Bytes
- End Function
- Private Sub WriteInt32(ByVal Address As Int32, ByVal Length As Int32, ByVal Value As Int32)
- Dim Bytes(Length - 1) As Byte
- Bytes = BitConverter.GetBytes(Value)
- WriteProcessMemory(csgo_handle, Address, Bytes, Bytes.Length, vbNull)
- End Sub
- Private Sub WriteSingle(ByVal Address As Int32, ByVal Length As Int32, ByVal Value As Single)
- Dim Bytes(Length - 1) As Byte
- Bytes = BitConverter.GetBytes(Value)
- WriteProcessMemory(csgo_handle, Address, Bytes, Bytes.Length, vbNull)
- End Sub
- Private Sub WriteBool(ByVal Address As Int32, ByVal Length As Int32, ByVal Value As Boolean)
- Dim Bytes(Length - 1) As Byte
- Bytes = BitConverter.GetBytes(Value)
- WriteProcessMemory(csgo_handle, Address, Bytes, Bytes.Length, vbNull)
- End Sub
- Private Function AobScan(ByVal Base As Integer, ByVal _Range As Integer, ByVal Signature As String, ByVal Instance As Integer) As Integer
- If (Signature <> String.Empty) Then
- Dim New_String As String = Regex.Replace(Signature.Replace("??", "3F"), "[^a-fA-F0-9]", "")
- Dim Count As Integer = -1
- Dim SearchFor As Byte() = New Byte((New_String.Length / 2) - 1) {}
- For i As Integer = 0 To SearchFor.Length - 1
- SearchFor(i) = Byte.Parse(New_String.Substring(i * 2, 2), NumberStyles.HexNumber)
- Next i
- Dim Sin As Byte() = ReadMemory(Base, _Range)
- Dim Z As Integer = 0, P As Integer = 0
- Dim iEnd As Integer = If(SearchFor.Length < &H20, SearchFor.Length, &H20)
- Dim sBytes As Integer() = New Integer(&H100 - 1) {}
- For j As Integer = 0 To iEnd - 1
- If (SearchFor(j) = &H3F) Then
- Z = (Z Or (CInt(1) << ((iEnd - j) - 1)))
- End If
- Next j
- If (Z <> 0) Then
- For k As Integer = 0 To sBytes.Length - 1
- sBytes(k) = Z
- Next k
- End If
- Z = 1
- Dim index As Integer = (iEnd - 1)
- Do While (index >= 0)
- sBytes(SearchFor(index)) = (sBytes(SearchFor(index)) Or Z)
- index -= 1
- Z = (Z << 1)
- Loop
- Do While (P <= (Sin.Length - SearchFor.Length))
- Z = (SearchFor.Length - 1)
- Dim last As Integer = SearchFor.Length
- Dim m As Integer = -1
- Do While (m <> 0)
- m = (m And sBytes(Sin(P + Z)))
- If (m <> 0) Then
- If (Z = 0) Then
- Count += 1
- If Count = Instance Then
- Return Base + P
- End If
- P += 2
- End If
- last = Z
- End If
- Z -= 1
- m = (m << 1)
- Loop
- P += last
- Loop
- End If
- Return -1
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment