Code:
#NoTrayIcon
If FileExists(@sCripTDir & "\CF_G4box.exe") Then
Else
If Not IsDeclared("iMsgBoxAnswer") Then Local $IMSGBOXANSWER
$IMSGBOXANSWER = MsgBox(16, "ByPassXtrap", "ByPass runs only in the installed Crossfire folder", 3)
Select
Case $IMSGBOXANSWER = -1
Case Else
EndSelect
Exit
EndIf
If FileExists(@sCripTDir & "\HGWC.exe") Then
Else
If Not IsDeclared("iMsgBoxAnswer") Then Local $IMSGBOXANSWER
$IMSGBOXANSWER = MsgBox(16, "ByPassXtrap", "ByPass runs only in the installed Crossfire folder", 3)
Select
Case $IMSGBOXANSWER = -1
Case Else
EndSelect
Exit
EndIf
If FileExists(@sCripTDir & "\XPva03.dll") Then
Else
If Not IsDeclared("iMsgBoxAnswer") Then Local $IMSGBOXANSWER
$IMSGBOXANSWER = MsgBox(16, "ByPassXtrap, "ByPass runs only in the installed Crossfire folder", 3)
Select
Case $IMSGBOXANSWER = -1
Case Else
EndSelect
Exit
EndIf
If FileExists(@sCripTDir & "\selfupdate_cf.exe") Then
Else
If Not IsDeclared("iMsgBoxAnswer") Then Local $IMSGBOXANSWER
$IMSGBOXANSWER = MsgBox(16, "ByPassXtrap", "ByPass runs only in the installed Crossfire folder", 3)
Select
Case $IMSGBOXANSWER = -1
Case Else
EndSelect
Exit
EndIf
If FileExists(@sCripTDir & "\patcher_cf.exe") Then
Else
If Not IsDeclared("iMsgBoxAnswer") Then Local $IMSGBOXANSWER
$IMSGBOXANSWER = MsgBox(16, "ByPassXtrap", "ByPass runs only in the installed Crossfire folder", 3)
Select
Case $IMSGBOXANSWER = -1
Case Else
EndSelect
Exit
EndIf
ProcessClose("HGWC.exe")
ProcessClose("Crossfire.exe")
ProcessClose("XTrap.xt")
FileCopy("HGWC.exe", @systemDir & "\HGWC.bak")
FileInstall("HGWC.exe", "HGWC.exe", 1)
Run("patcher_cf.exe")
ProcessWait("Crossfire.exe")
_PROCESSSUSPEND("Crossfire.exe")
_PROCESSSUSPEND("HGWC.exe")
FileInstall("XTrapVa.dll", "XTrap\XTrapVa.dll", 1)
_PROCESSRESUME("Crossfire.exe")
ProcessWait("XTrap.xt")
_PROCESSSUSPEND("Crossfire.exe")
_PROCESSSUSPEND("Xtrap.xt")
FileInstall("GetTID.exe", @systemDir & "\GetTID.exe", 1)
FileInstall("HackCf.dll", @systemDir & "\\HackCf.dll", 1)
Run(@systemDir & "\GetTID.exe")
ProcessWaitClose("GetTID.exe")
Sleep(2000)
FileDelete(@systemDir & "\GetTID.exe")
FileDelete(@systemDir & "\HackCf.dll")
ProcessWaitClose("Crossfire.exe")
ProcessClose("HGWC.exe")
ProcessClose("Xtrap.xt")
Sleep(3000)
FileInstall("XTrapVas.dll", "XTrap\XTrapVa.dll", 1)
FileCopy(@systemDir & "\HGWC.bak", @sCripTDir & "\HGWC.exe")
Sleep(1000)
FileDelete(@systemDir & "\HGWC.bak")
Exit
Func _PROCESSSUSPEND($PROCESS)
$PROCESSID = ProcessExists($PROCESS)
If $PROCESSID Then
$AI_HANDLE = DllCall("kernel32.dll", "int", "OpenProcess", "int", 2035711, "int", False, "int", $PROCESSID)
$I_SUCESS = DllCall("ntdll.dll", "int", "NtSuspendProcess", "int", $AI_HANDLE[0])
DllCall("kernel32.dll", "ptr", "CloseHandle", "ptr", $AI_HANDLE)
If IsArray($I_SUCESS) Then
Return 1
Else
SetError(1)
Return 0
EndIf
Else
SetError(2)
Return 0
EndIf
EndFunc
Func _PROCESSRESUME($PROCESS)
$PROCESSID = ProcessExists($PROCESS)
If $PROCESSID Then
$AI_HANDLE = DllCall("kernel32.dll", "int", "OpenProcess", "int", 2035711, "int", False, "int", $PROCESSID)
$I_SUCESS = DllCall("ntdll.dll", "int", "NtResumeProcess", "int", $AI_HANDLE[0])
DllCall("kernel32.dll", "ptr", "CloseHandle", "ptr", $AI_HANDLE)
If IsArray($I_SUCESS) Then
Return 1
Else
SetError(1)
Return 0
EndIf
Else
SetError(2)
Return 0
EndIf
EndFunc
; DeTokenise by myAut2Exe >The Open Source AutoIT/AutoHotKey script decompiler< 2.10 build(157)