Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 LocalPlayer As Int32 = &HA932CC
- Private EntityList As Int32 = &H4A35A14
- Private GlowObjectBase As Int32 = &H4B48F24
- Private attack As Int32 = &H2EA7958
- Private jump As Int32 = &H4AC69F8
- Private m_iCrossHairID As Int32 = &H410
- Private m_iTeamNum As Int32 = &HF0
- Private m_fFlags As Int32 = &H100
- Private GlowIndex As Int32 = &H86C0
- Private isDormant As Int32 = &HE9
- Private bSpotted As Int32 = &H935
- Private flashMaxAlpha As Int32 = &H1DB0
- Dim csgo_handle As IntPtr
- Dim csgo_process As Process
- Dim dwClient As Int32
- Dim dwEngine As Int32
- Private Structure GlowStruct
- Public r As Single
- Public g As Single
- Public b As Single
- Public a As Single
- Public rwo As Boolean
- Public rwuo As Boolean
- End Structure
- Private Defaultglow As GlowStruct = New GlowStruct With {.r = 0.4F, .g = 0.0F, .b = 0.0F, .a = 1.0F, .rwo = True, .rwuo = False}
- Private GlowEnabled As Boolean = True
- Private GlowShowTeam As Boolean = True
- Private GlowShowEnemies As Boolean = True
- Private g_currentPlayer_GlowIndex As Int32
- Private g_currentPlayer_Team As Int32
- Private LocalBase As Int32
- Private LocalPlayer_Team As Int32
- Private GlowPointer As Int32
- Private InCross As Int32
- Private Trigger_EntityBase As Int32
- Private Trigger_EntityBase_TeamID As Int32
- Private nFlashMaxAlpha As Single
- Private fFlag As Byte
- Private Sub DrawGlow(ByVal gIndex As Int32, ByVal Color As GlowStruct)
- WriteSingle(GlowPointer + ((gIndex * &H34) + &H4), 4, Color.r)
- WriteSingle(GlowPointer + ((gIndex * &H34) + &H8), 4, Color.g)
- WriteSingle(GlowPointer + ((gIndex * &H34) + &HC), 4, Color.b)
- WriteSingle(GlowPointer + ((gIndex * &H34) + &H10), 4, Color.a)
- WriteBool(GlowPointer + ((gIndex * &H34) + &H24), 1, Color.rwo)
- WriteBool(GlowPointer + ((gIndex * &H34) + &H25), 1, Color.rwuo)
- End Sub
- Sub Main()
- csgo_process = Process.GetProcessesByName("csgo")(0)
- csgo_handle = OpenProcess(PROCESS_ALL_ACCESS, False, csgo_process.Id)
- For Each [Module] As System.Diagnostics.ProcessModule In csgo_process.Modules
- If [Module].ModuleName.ToLower = "client.dll" Then
- dwClient = [Module].BaseAddress
- ElseIf [Module].ModuleName.ToLower = "engine.dll" Then
- dwEngine = [Module].BaseAddress
- End If
- Next
- While True
- LocalBase = BitConverter.ToInt32(ReadMemory(dwClient + LocalPlayer, 4), 0)
- LocalPlayer_Team = BitConverter.ToInt32(ReadMemory(LocalBase + m_iTeamNum, 4), 0)
- GlowPointer = BitConverter.ToInt32(ReadMemory(dwClient + GlowObjectBase, 4), 0)
- InCross = BitConverter.ToInt32(ReadMemory(LocalBase + m_iCrossHairID, 4), 0)
- Trigger_EntityBase = BitConverter.ToInt32(ReadMemory(dwClient + EntityList + ((InCross - 1) * 16), 4), 0)
- Trigger_EntityBase_TeamID = BitConverter.ToInt32(ReadMemory(Trigger_EntityBase + m_iTeamNum, 4), 0)
- nFlashMaxAlpha = BitConverter.ToSingle(ReadMemory(dwClient + &H4A35A14, 4), 0)
- fFlag = ReadMemory(dwClient + &H4A35A14, 1)(0)
- For I As Integer = 1 To 64
- Dim g_currentPlayer As Int32 = BitConverter.ToInt32(ReadMemory(dwClient + EntityList + ((I - 1) * 16), 4), 0)
- Dim g_currentPlayer_Dormant As Boolean = BitConverter.ToBoolean(ReadMemory(g_currentPlayer + isDormant, 4), 0)
- If Not (g_currentPlayer_Dormant) Then
- g_currentPlayer_GlowIndex = BitConverter.ToInt32(ReadMemory(g_currentPlayer + GlowIndex, 4), 0)
- g_currentPlayer_Team = BitConverter.ToInt32(ReadMemory(g_currentPlayer + m_iTeamNum, 4), 0)
- End If
- If Not (g_currentPlayer_Dormant) Then
- If (g_currentPlayer_Team = LocalPlayer_Team) Then
- DrawGlow(g_currentPlayer_GlowIndex, Defaultglow)
- ElseIf Not (g_currentPlayer_Team = LocalPlayer_Team) Then
- DrawGlow(g_currentPlayer_GlowIndex, Defaultglow)
- End If
- End If
- Next
- System.Threading.Thread.Sleep(1)
- End While
- 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
Advertisement
Add Comment
Please, Sign In to add comment