Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


can write it in vb.net or C#

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
myown
How do I cheat?
Reputation: 0

Joined: 11 Mar 2014
Posts: 9

PostPosted: Wed Mar 12, 2014 12:55 pm    Post subject: can write it in vb.net or C# Reply with quote

this code in autoit to bypass xtrap

Code:

if not ProcessExists("GP") = True then
MsgBox (0, "", "Run GP")
endif

Do

sleep (100)

until ProcessExists("GP") = True
MsgBox (0, "", "Found GP")
MsgBox (0, "", "Done!")
sleep (1000)
_XTrapBypass()
AdlibRegister ("_XTrapBypass")

While True
sleep (100)
Wend



Func _XTrapBypass()
        _Soul_WriteProcessMemory ("GP.exe",_GetProcAddress("kernel32.dll", "ptr", "K32EnumProcesses"),0x90000CC2,"dword")
        _Soul_WriteProcessMemory("GP.exe", 0x00410858, "X6va20","char[7]")
      sleep (500)
      Exit
EndFunc


Func  _GetProcAddress ($Dll,$Type,$function)
        local $returntype
$dllcall = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $dll)
$address = DllCall($dll, $Type, "GetProcAddress", $Type, $dllcall[0], "str", $function)
Return $address[$returntype]
endfunc

Func _Soul_WriteProcessMemory ($hprocess,$Addy,$Val,$type = "dword")
                $kernel32 = DllOpen("kernel32.dll")
                If @error Then Return SetError(1, "", False)
                $hprocess = DllCall($kernel32, "DWORD", "OpenProcess", "DWORD", 0x1F0FFF, "int", 0, "DWORD", ProcessExists($hprocess))
                If @error Then Return SetError(2, "", False)
                local $n_TypVa = DllStructCreate($type)
                        If @error Then Return SetError(3, "", False)
                DllStructSetData($n_TypVa, 1, $Val)
                        If @error Then Return SetError(4, "", False)
                DllCall("kernel32.dll", "BOOL", "WriteProcessMemory", "int", $hprocess[0], "DWORD", $Addy, "ptr", DllStructGetPtr($n_TypVa), "int", DllStructGetSize($n_TypVa), "int", 0)
                If @error Then Return SetError(5, "", False)
                DllCall($kernel32, "BOOL", "CloseHandle", "DWORD", $hprocess[0])
                        If @error Then Return SetError(6, "", False)
                DllClose($kernel32)
                        If @error Then Return SetError(7, "", False)
                Return SetError(0, "", True)
        EndFunc
   EndSwitch
 WEnd
 Exit

i try in vb.net use this code
Code:

    <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
    Private Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single
    Public Shared Sub Writememory(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Single, ByVal nsize As Integer)
        If ProcessName.EndsWith(".exe") Then
            ProcessName = ProcessName.Replace(".exe", "")
        End If
        Dim processesByName() As Process = Process.GetProcessesByName(ProcessName)
        Dim ptr As IntPtr = CType(OpenProcess(127231, 0, processesByName(0).Id), IntPtr)
        If Not (ptr = IntPtr.Zero) Then
            Dim lpBaseAddress As Integer = Address
            Dim lpBuffer As Single = Value
            Dim lpNumberOfBytesWritten As Integer = 0
            WriteProcessMemory(CType(ptr, Integer), lpBaseAddress, lpBuffer, nsize, lpNumberOfBytesWritten)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Writememory("GP.exe", &H410858, "X6va20", 7)
        If Not (Process.GetProcessesByName("Xtrap.xt").Length = 0) Then
            Writememory("GP.exe", &H410858, "X6va20", 7)
        End If
    End Sub

but not work
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Mar 12, 2014 3:03 pm    Post subject: Reply with quote

We do not support multiplayer hacking on this forum.
http://forum.cheatengine.org/faq.php#0

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites