Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AutoIT3 Join-/Anti-Afk - BGBot
- Macros: /script JoinBattlefield(0); auf + legen
- /script AcceptBattlefieldPort(1,1); auf # legen
- code:
- ----------------------------------------------------------------------------------
- $Key_PvPWindow = "h"
- $Key_joinQueue = "{+}" ; /script JoinBattlefield(0);
- $Key_Confirm = "{#}" ; /script AcceptBattlefieldPort(1,1);
- $Key_Idle = "w"
- $Key_Idle2 = "s"
- $Key_autorun = "r"
- SetPrivilege("SeDebugPrivilege", 1)
- $Process = WinGetProcess("World of Warcraft")
- $hWnd = WinGetHandle("[CLASS:GxWindowClassD3d]")
- $WoWProcess = mem_open($Process)
- While True
- $status = mem_read(0x00B6DFD8, $WoWProcess, "int")
- switch $status
- Case 0
- joinQueue()
- Case 1
- idle()
- Case 2
- confirm()
- case 3
- idle()
- EndSwitch
- WEnd
- Func joinQueue()
- Sleep(5000)
- ControlSend($hWnd, "", "", $Key_PvPWindow)
- ControlSend($hWnd, "", "", $Key_Idle)
- ControlSend($hWnd, "", "", $Key_Idle2)
- Sleep(500)
- ControlSend($hWnd, "", "", $Key_joinQueue)
- Sleep(500)
- ControlSend($hWnd, "", "", $Key_Confirm)
- EndFunc
- Func idle()
- Sleep(6000)
- ControlSend($hWnd, "", "", $Key_Idle)
- ControlSend($hWnd, "", "", $Key_Idle2)
- EndFunc
- Func confirm()
- ControlSend($hWnd, "", "", $Key_Confirm)
- Sleep(500)
- EndFunc
- Func mem_open($iv_Pid)
- Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
- Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', 0x0bea4c8, 'int', 1, 'int', $iv_Pid)
- $ah_Handle[1] = $av_OpenProcess[0]
- Return $ah_Handle
- EndFunc
- Func mem_read($iv_Address, $ah_Handle, $sv_Type = 'dword')
- Local $v_Buffer = DllStructCreate($sv_Type)
- DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
- Local $v_Value = DllStructGetData($v_Buffer, 1)
- Return $v_Value
- EndFunc
- Func mem_close($ah_Handle)
- DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
- DllClose($ah_Handle[0])
- Return 1
- EndFunc
- Func SetPrivilege($privilege, $bEnable)
- Const $MY_TOKEN_ADJUST_PRIVILEGES = 0x0020
- Const $MY_TOKEN_QUERY = 0x0008
- Const $MY_SE_PRIVILEGE_ENABLED = 0x0002
- Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
- $nTokens = 1
- $LUID = DLLStructCreate("dword;int")
- If IsArray($privilege) Then $nTokens = UBound($privilege)
- $TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
- $NEWTOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
- $hCurrProcess = DLLCall("kernel32.dll","hwnd","GetCurrentProcess")
- $SP_auxret = DLLCall("advapi32.dll","int","OpenProcessToken","hwnd",$hCurrProcess[0], _
- "int",BitOR($MY_TOKEN_ADJUST_PRIVILEGES,$MY_TOKEN_QUERY),"int*",0)
- If $SP_auxret[0] Then
- $hToken = $SP_auxret[3]
- DLLStructSetData($TOKEN_PRIVILEGES,1,1)
- $nTokenIndex = 1
- While $nTokenIndex <= $nTokens
- If IsArray($privilege) Then
- $priv = $privilege[$nTokenIndex-1]
- Else
- $priv = $privilege
- EndIf
- $ret = DLLCall("advapi32.dll","int","LookupPrivilegeValue","str","","str",$priv, _
- "ptr",DLLStructGetPtr($LUID))
- If $ret[0] Then
- If $bEnable Then
- DLLStructSetData($TOKEN_PRIVILEGES,2,$MY_SE_PRIVILEGE_ENABLED,(3 * $nTokenIndex))
- Else
- DLLStructSetData($TOKEN_PRIVILEGES,2,0,(3 * $nTokenIndex))
- EndIf
- DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,1),(3 * ($nTokenIndex-1)) + 1)
- DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,2),(3 * ($nTokenIndex-1)) + 2)
- DLLStructSetData($LUID,1,0)
- DLLStructSetData($LUID,2,0)
- EndIf
- $nTokenIndex += 1
- WEnd
- $ret = DLLCall("advapi32.dll","int","AdjustTokenPrivileges","hwnd",$hToken,"int",0, _
- "ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int",DllStructGetSize($NEWTOKEN_PRIVILEGES), _
- "ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int*",0)
- $f = DLLCall("kernel32.dll","int","GetLastError")
- EndIf
- $NEWTOKEN_PRIVILEGES=0
- $TOKEN_PRIVILEGES=0
- $LUID=0
- If $SP_auxret[0] = 0 Then Return 0
- $SP_auxret = DLLCall("kernel32.dll","int","CloseHandle","hwnd",$hToken)
- If Not $ret[0] And Not $SP_auxret[0] Then Return 0
- return $ret[0]
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement