Visual Basic hack

Posts 1–5 of 5 · Page 1 of 1
Visual Basic hack
Hi!

I made a visual basic hack and i think it works, but i cant test it cause i get a crossfire error for some reason when i start it

Uses this Module

This is my edited Module...
 
Code
Code:
Option Strict On

Imports System.Runtime.InteropServices
Imports System.Text

Module MemoryModule
    <DllImport("kernel32.dll")> _
    Private Function OpenProcess(ByVal dwDesiredAccess As UInteger, <MarshalAs(UnmanagedType.Bool)> ByVal bInheritHandle As Boolean, ByVal dwProcessId As Integer) As IntPtr
    End Function

    <DllImport("kernel32.dll", SetLastError:=True)> _
    Private Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As IntPtr, <Out()> ByRef lpNumberOfBytesWritten As IntPtr) As Boolean
    End Function

    <DllImport("kernel32.dll", SetLastError:=True)>
    Private Function CloseHandle(ByVal hObject As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function

    Private Const PROCESS_VM_WRITE As UInteger = &H20
    Private Const PROCESS_VM_READ As UInteger = &H10
    Private Const PROCESS_VM_OPERATION As UInteger = &H8
    Private Const TargetProcess As String = "crossfire"
    Private ProcessHandle As IntPtr = IntPtr.Zero
    Private LastKnownPID As Integer = -1

    Private Function ProcessIDExists(ByVal pID As Integer) As Boolean
        For Each p As Process In Process.GetProcessesByName(TargetProcess)
            If p.ID = pID Then Return True
        Next
        Return False
    End Function

    Private Function UpdateProcessHandle() As Boolean
        If LastKnownPID = -1 OrElse Not ProcessIDExists(LastKnownPID) Then
            If ProcessHandle <> IntPtr.Zero Then CloseHandle(ProcessHandle)
            Dim p() As Process = Process.GetProcessesByName(TargetProcess)
            If p.Length = 0 Then Return False
            LastKnownPID = p(0).Id
            ProcessHandle = OpenProcess(PROCESS_VM_READ Or PROCESS_VM_WRITE Or PROCESS_VM_OPERATION, False, p(0).Id)
            If ProcessHandle = IntPtr.Zero Then Return False
        End If
        Return True
    End Function

    Private Function GetObjectBytes(ByVal value As Object) As Byte()
        If value.GetType() Is GetType(Byte()) Then Return CType(value, Byte())
        Dim buffer(Marshal.SizeOf(value) - 1) As Byte
        Dim ptr As IntPtr = Marshal.AllocHGlobal(buffer.Length)
        Marshal.StructureToPtr(value, ptr, True)
        Marshal.Copy(ptr, buffer, 0, buffer.Length)
        Marshal.FreeHGlobal(ptr)
        Return buffer
    End Function

    Public Function WriteMemory(ByVal address As Integer, ByVal value As Object) As Boolean
        Return WriteMemory(address, value, False)
    End Function

    Public Function WriteMemory(ByVal address As Integer, ByVal value As Object, ByVal unicode As Boolean) As Boolean
        If Not UpdateProcessHandle() Then Return False
        Dim buffer() As Byte
        If TypeOf value Is String Then
            If unicode Then buffer = Encoding.Unicode.GetBytes(value.ToString()) Else buffer = Encoding.ASCII.GetBytes(value.ToString())
        Else
            buffer = GetObjectBytes(value)
        End If
        Dim result As Boolean = WriteProcessMemory(ProcessHandle, New IntPtr(address), buffer, New IntPtr(buffer.Length), IntPtr.Zero)
        Return result
    End Function
End Module


To Use :
 
To Use
Code:
Dim NoFallDamage As Integer = (&HB3730C + &H4)
        Dim NoFallDamageValue As Double = 0.0F
        WriteMemory(NoFallDamage, NoFallDamageValue)


It works but i get this X-Trap error in game -.- BTW : It doesn't ban you.
r u serious?
WriteProcessMemory <.<
Quote Originally Posted by timiostimio View Post
r u serious?
WriteProcessMemory <.<
method is made by master 131....
Quote Originally Posted by timiostimio View Post
r u serious?
WriteProcessMemory <.<
It works if you use it correctly
Quote Originally Posted by lucasheer715 View Post
method is made by master 131....
I know the problem /
Well, let me show you, in a short code JUST EXAMPLE CODE!!
Code:
while (true)
{
     OpenProcess(CrossFire)
     pWeaponMgr = CShellModule + ReadProcessMemory(0x123ABC);
     for (int i = 0; i < 999; i++)
     {
          *(float*)(pWeaponMgr + Reload) = 30.0f;
     }
CloseProcess(CrossFire); //Or "CloseHandle" <=============== THIS
Sleep(3000);  <===================================== And this is really important, since this is what Xcrap detect...
}
Close the handle, and give enough time to Xcrap to calm down, idon't remember the corrcet value for sleep, but i used about 500-1000...


Since you are making an External Hack let me give you some advice:
-Weapons only need to be modified once, so you don't have to put it into an infinite loop, that means you only run the "for(...)" when you want to edit something, and then close the hanle...
-BasicPlayerInfo hacks the same...
-PlayerPointer is a bit tricky, you may do it, that every time the user have to switch them on when they join a match (since it refresh when you get into a room), so it won't require a "while(true)"...

Good Lock mate...
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?