Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'A .NET Wrapper created for San Andreas Multiplayer (Works in SP though).
- 'Written By Shaqways / Sixem
- 'Using Cless' @ CEF (Cheat Engine Forums) Memory Class
- 'Version 1.0.3
- Public Class SAMP
- Public Class Cheats
- Public Shared Sub Mega_Jump()
- WriteByte("gta_sa", &H96916C, 1)
- End Sub
- Public Shared Sub All_Cars_Have_Nitro()
- WriteByte("gta_sa", &H969165, 1)
- End Sub
- End Class
- Public Class Vehicle
- Public Shared Function Set_Stripe_Color(ByVal ColorID As Integer)
- WritePointerByte("gta_sa", &HB6F980, ColorID, 1077)
- Return ColorID
- End Function
- Public Shared Function Get_Stripe_Color()
- Return ReadPointerByte("gta_sa", &HB6F980, 1077)
- End Function
- Public Shared Function Set_Body_Color(ByVal ColorID As Integer)
- WritePointerByte("gta_sa", &HB6F980, ColorID, 1076)
- Return ColorID
- End Function
- Public Shared Function Get_Body_Color(ByVal ColorID As Integer)
- Return ReadPointerByte("gta_sa", &HB6F980, 1076)
- End Function
- Public Shared Function Passenger_Driver_Health()
- Return ReadPointerFloat("gta_sa", &HB6F980, 1120, &H540)
- End Function
- Public Shared Function Passenger_1_Health()
- Return ReadPointerFloat("gta_sa", &HB6F980, 1124, &H540)
- End Function
- Public Shared Function Passenger_2_Health()
- Return ReadPointerFloat("gta_sa", &HB6F980, 1128, &H540)
- End Function
- Public Shared Function Passenger_3_Health()
- Return ReadPointerFloat("gta_sa", &HB6F980, 1132, &H540)
- End Function
- Public Shared Function Teleport(ByVal X As Integer, ByVal Y As Integer, ByVal Z As Integer)
- WritePointerInteger("gta_sa", &HB6F5F0, X, &H14, &H30)
- WritePointerInteger("gta_sa", &HB6F5F0, Y, &H14, &H34)
- WritePointerInteger("gta_sa", &HB6F5F0, Z, &H14, &H38)
- WritePointerInteger("gta_sa", &HB6F980, X, 20, 48)
- WritePointerInteger("gta_sa", &HB6F980, Y, 20, 52)
- WritePointerInteger("gta_sa", &HB6F980, Z, 20, 56)
- Return 0
- End Function
- Public Shared Sub Restore_Car_Health()
- WritePointerInteger("gta_sa", &HB6F980, 1148846080, 1216)
- Set_Car_Tires(0)
- End Sub
- Public Shared Function Get_Vehicle_Position_X()
- Return ReadPointerInteger("gta_sa", &HB6F980, 20, 48)
- End Function
- Public Shared Function Get_Vehicle_Position_Y()
- Return ReadPointerInteger("gta_sa", &HB6F980, 20, 52)
- End Function
- Public Shared Function Get_Vehicle_Position_Z()
- Return ReadPointerInteger("gta_sa", &HB6F980, 20, 56)
- End Function
- Public Shared Function Set_Car_Tires(ByVal X As Integer)
- WritePointerInteger("gta_sa", &HB6F980, X, &H5A5)
- WritePointerInteger("gta_sa", &HB6F980, X, &H5A6)
- WritePointerInteger("gta_sa", &HB6F980, X, &H5A7)
- WritePointerInteger("gta_sa", &HB6F980, X, &H5A8)
- Return 0
- End Function
- Public Shared Function Set_Car_Door_Lock(ByVal State As Integer)
- If State = 1 Or State = 2 Then
- WritePointerInteger("gta_sa", &H969084, "2", &H4F8)
- Else
- WritePointerInteger("gta_sa", &H969084, "1", &H4F8)
- End If
- Return 0
- End Function
- Public Shared Function Is_Player_Driving()
- If ReadPointerByte("gta_sa", &HB6F5F0, &H534) = 0 Then
- Return 1
- Else
- Return 0
- End If
- End Function
- End Class
- Public Class Player
- Public Shared Infinite_Sprint_Status As Integer = CInt(0)
- Public Shared Sub Toggle_Infinite_Sprint()
- If Infinite_Sprint_Status = (0) Then
- WriteByte("gta_sa", &HB7CEE4, 1)
- Infinite_Sprint_Status = CInt(1)
- Else
- WriteByte("gta_sa", &HB7CEE4, 0)
- Infinite_Sprint_Status = CInt(0)
- End If
- End Sub
- Public Shared Function Get_Player_Health()
- Return ReadPointerFloat("gta_sa", &HB6F5F0, &H540)
- End Function
- Public Shared Function Get_Player_Armor()
- Return ReadPointerFloat("gta_sa", &HB6F5F0, &H548)
- End Function
- Public Shared Function Get_Current_Weapon()
- Return ReadPointerInteger("gta_sa", &HB6F5F0, &H740)
- End Function
- Public Shared Function Teleport(ByVal X As Integer, ByVal Y As Integer, ByVal Z As Integer)
- WritePointerInteger("gta_sa", &HB6F5F0, X, &H14, &H30)
- WritePointerInteger("gta_sa", &HB6F5F0, Y, &H14, &H34)
- WritePointerInteger("gta_sa", &HB6F5F0, Z, &H14, &H38)
- WritePointerInteger("gta_sa", &HB6F980, X, 20, 48)
- WritePointerInteger("gta_sa", &HB6F980, Y, 20, 52)
- WritePointerInteger("gta_sa", &HB6F980, Z, 20, 56)
- Return 0
- End Function
- Public Shared Sub Restore_Player_Health()
- WritePointerInteger("gta_sa", &HB6F5F0, 1120403456, &H540)
- End Sub
- Public Shared Sub Restore_Player_Armor()
- WritePointerInteger("gta_sa", &HB6F5F0, 1120403456, &H548)
- End Sub
- Public Shared Function Get_Player_Position_X()
- Return ReadPointerInteger("gta_sa", &HB6F5F0, &H14, &H30)
- End Function
- Public Shared Function Get_Player_Position_Y()
- Return ReadPointerInteger("gta_sa", &HB6F5F0, &H14, &H34)
- End Function
- Public Shared Function Get_Player_Position_Z()
- Return ReadPointerInteger("gta_sa", &HB6F5F0, &H14, &H38)
- End Function
- End Class
- Public Shared Function Get_Money()
- Return ReadInteger("gta_sa", &HB7CE50)
- End Function
- Public Shared Function Set_Money(ByVal Money As Integer)
- WriteInteger("gta_sa", &HB7CE50, Money)
- Return Money
- End Function
- Public Shared Sub Force_Crash()
- WritePointerFloat("gta_sa", &HB6F980, 9918521992, 0)
- End Sub
- Public Shared Function Set_Weather(ByVal WCode As Integer)
- WriteInteger("gta_sa", &HC81320, WCode)
- Return WCode
- End Function
- #Region "Module Const"
- Private Declare Function ReadMemoryByte Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
- Private Declare Function ReadMemoryInteger Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
- Private Declare Function ReadMemoryFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Single
- Private Declare Function ReadMemoryDouble Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 8, Optional ByRef Bytes As Integer = 0) As Double
- Private Declare Function ReadMemoryString Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As IntPtr, Optional ByVal Size As Integer = 8, Optional ByRef Bytes As Integer = 0) As IntPtr
- Private Declare Function WriteMemoryByteArray Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte(), Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte()
- Private Declare Function WriteMemoryByte Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
- Private Declare Function WriteMemoryInteger Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
- Private Declare Function WriteMemoryFloat Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Single
- Private Declare Function WriteMemoryDouble Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Double
- Public Shared Function ReadText(ByVal EXENAME As String, ByVal Address As Integer) As IntPtr
- Dim Value As String
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- ReadMemoryString(Handle, Address, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadByte(ByVal EXENAME As String, ByVal Address As Integer) As Byte
- Dim Value As Byte
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- ReadMemoryByte(Handle, Address, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadInteger(ByVal EXENAME As String, ByVal Address As Integer) As Integer
- Dim Value As Integer
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- ReadMemoryInteger(Handle, Address, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadFloat(ByVal EXENAME As String, ByVal Address As Integer) As Single
- Dim Value As Single
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- ReadMemoryFloat(Handle, Address, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadDouble(ByVal EXENAME As String, ByVal Address As Integer) As Double
- Dim Value As Double
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- ReadMemoryByte(Handle, Address, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadPointerByte(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Byte
- Dim Value As Byte
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- ReadMemoryByte(Handle, Pointer, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadPointerInteger(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Integer
- Dim Value As Integer
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- ReadMemoryInteger(Handle, Pointer, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadPointerFloat(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Single
- Dim Value As Single
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- ReadMemoryFloat(Handle, Pointer, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Function ReadPointerDouble(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Double
- Dim Value As Double
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- ReadMemoryDouble(Handle, Pointer, Value)
- End If
- End If
- Return Value
- End Function
- Public Shared Sub WriteByte(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Byte)
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- WriteMemoryByte(Handle, Address, Value)
- End If
- End If
- End Sub
- Public Shared Sub WriteByteArray(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Byte())
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- WriteMemoryByteArray(Handle, Address, Value)
- End If
- End If
- End Sub
- Public Shared Sub WriteInteger(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Integer)
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- WriteMemoryInteger(Handle, Address, Value)
- End If
- End If
- End Sub
- Public Shared Sub WriteFloat(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Single)
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- WriteMemoryFloat(Handle, Address, Value)
- End If
- End If
- End Sub
- Public Shared Sub WriteDouble(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Double)
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- WriteMemoryDouble(Handle, Address, Value)
- End If
- End If
- End Sub
- Public Shared Sub WritePointerByte(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Byte, ByVal ParamArray Offset As Integer())
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- WriteMemoryByte(Handle, Pointer, Value)
- End If
- End If
- End Sub
- Public Shared Sub WritePointerInteger(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Integer, ByVal ParamArray Offset As Integer())
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- WriteMemoryInteger(Handle, Pointer, Value)
- End If
- End If
- End Sub
- Public Shared Sub WritePointerFloat(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Single, ByVal ParamArray Offset As Integer())
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- WriteMemoryFloat(Handle, Pointer, Value)
- End If
- End If
- End Sub
- Public Shared Sub WritePointerDouble(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Double, ByVal ParamArray Offset As Integer())
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- WriteMemoryDouble(Handle, Pointer, Value)
- End If
- End If
- End Sub
- Public Shared Function ReadPointerLong(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Long
- Dim Value As Single
- If Process.GetProcessesByName(EXENAME).Length <> 0 Then
- Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
- If Handle <> 0 Then
- For Each I As Integer In Offset
- ReadMemoryInteger(Handle, Pointer, Pointer)
- Pointer += I
- Next
- ReadMemoryFloat(Handle, Pointer, Value)
- End If
- End If
- Return Value
- End Function
- #End Region
- End Class
- Public Class EXE
- Public Shared Function Get_PID()
- Try
- Dim Process_Handle() As Process = Process.GetProcessesByName("gta_sa")
- Dim cURL As Integer = CInt(0)
- For Each Proc As Process In Process_Handle
- cURL += CInt(1)
- Return Proc.Id
- Next
- If cURL = CInt(0) Then
- Return 0
- End If
- Catch ex As Exception
- Return 0
- End Try
- End Function
- Public Shared Function Is_GTA_Running()
- Dim Process_Handle() As Process = Process.GetProcessesByName("gta_sa")
- Dim cURL As Integer = CInt(0)
- For Each Proc As Process In Process_Handle
- cURL += CInt(1)
- Return 1
- Next
- If cURL = CInt(0) Then
- Return 0
- End If
- End Function
- Public Shared Sub Kill()
- Dim Process_Handle() As Process = Process.GetProcessesByName("gta_sa")
- Dim cURL As Integer = CInt(0)
- For Each Proc As Process In Process_Handle
- Proc.Kill()
- Next
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment