Code:
Dim Classes As Integer() = {&H1CDBFF2, &H1CDC054, &H1CDC0B6, &H1CDC118, &H1CDC17A, &H1CDC1DC, &H1CDC23E, &H1CDC2A0, &H1CDC302, &H1CDC364, &H1CDC3C6, &H1CDC428, &H1CDC48A, &H1CDC4EC, &H1CDC54E}
Dim Camos As Integer() = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Hack("iw5mp")
SetInt(Classes(ComboBox1.SelectedIndex), Camos(ComboBox2.SelectedIndex))
End Sub
'Camos Value in Camo Name
'- 13 = gold
'- 12 = autumn
'- 11 = red
'- 10 = blue
'- 9 = winter
'- 8 = snake
'- 7 = marine
'- 6 = chocolate
'- 5 = hex
'- 4 = digital
'- 3 = woodland
'- 2 = snow
'- 1 = fortress
#Region "Write MeM"
<Flags()> _
Public Enum ProcessAccessType
PROCESS_TERMINATE = (&H1)
PROCESS_CREATE_THREAD = (&H2)
PROCESS_SET_SESSIONID = (&H4)
PROCESS_VM_OPERATION = (&H8)
PROCESS_VM_READ = (&H10)
PROCESS_VM_WRITE = (&H20)
PROCESS_DUP_HANDLE = (&H40)
PROCESS_CREATE_PROCESS = (&H80)
PROCESS_SET_QUOTA = (&H100)
PROCESS_SET_INFORMATION = (&H200)
PROCESS_QUERY_INFORMATION = (&H400)
End Enum
<DllImport("kernel32.dll")> _
Public Shared Function OpenProcess(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Int32, ByVal dwProcessId As UInt32) As IntPtr
End Function
<DllImport("kernel32.dll")> _
Public Shared Function CloseHandle(ByVal hObject As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Public Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Public Shared Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
Public Function Hack(ByVal Application As String) As Boolean
Dim pArray As Process() = Process.GetProcessesByName(Application)
If pArray.Length = 0 Then
Return True
End If
ReadProcess = pArray(0)
Open()
Return False
End Function
Public Sub SetInt(ByVal Address As Integer, ByVal Value As Integer)
Dim byteswritten As Integer
Write(Address, BitConverter.GetBytes(Value), byteswritten)
CloseHandle()
End Sub
Public Sub SetByte(ByVal Address As Integer, ByVal Value As Byte())
Dim byteswritten As Integer
Write(Address, Value, byteswritten)
CloseHandle()
End Sub
Private Property ReadProcess() As Process
Get
Return m_ReadProcess
End Get
Set(ByVal value As Process)
m_ReadProcess = value
End Set
End Property
Private m_ReadProcess As Process = Nothing
Private m_hProcess As IntPtr = IntPtr.Zero
Private Sub Open()
Dim access As ProcessAccessType
access = ProcessAccessType.PROCESS_VM_READ Or ProcessAccessType.PROCESS_VM_WRITE Or ProcessAccessType.PROCESS_VM_OPERATION
m_hProcess = OpenProcess(CUInt(access), 1, CUInt(m_ReadProces*****))
End Sub
Private Sub CloseHandle()
Dim iRetValue As Integer
iRetValue = CloseHandle(m_hProcess)
If iRetValue = 0 Then
Throw New Exception("CloseHandle failed")
End If
End Sub
Private Sub Write(ByVal MemoryAddress As IntPtr, ByVal bytesToWrite As Byte(), ByRef bytesWritten As Integer)
Dim ptrBytesWritten As IntPtr
WriteProcessMemory(m_hProcess, MemoryAddress, bytesToWrite, CUInt(bytesToWrite.Length), ptrBytesWritten)
bytesWritten = ptrBytesWritten.ToInt32()
End Sub
#End Region