[Release] GR Autolooter

11/17/2015 13:29 lollygaga#361
Any chance of an update for the x64 client of Guild Wars 2
11/17/2015 19:20 swir#362
0x17C613F
11/19/2015 08:50 rince2k#363
64bit including 19.10.2015 Offset:

Code:
#RequireAdmin
#Region
#AutoIt3Wrapper_Icon=gw2.ico
#AutoIt3Wrapper_Outfile=GW2_WvW_Tool64.exe
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Description=Guild Wars 2 WvW Tool 64bit
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#EndRegion
Global $GUI_EVENT_CLOSE=-3, $pid = 0, $open=0, $loot = 0, $timed = 0, $lootkey, $lootaddr_ini, $clicker_key
$Admin = IsAdmin()
If $Admin <> 1 Then
	MsgBox(0x30, "ERROR", "You must run this app as Administrator!")
	Exit
EndIf

Opt("TrayMenuMode", 3)
$Exit = TrayCreateItem("Exit")

If Not FileExists("GW2_WvW_64.ini") Then
	IniWrite("GW2_WvW_64.ini", "main", "lootkey", "f")
	IniWrite("GW2_WvW_64.ini", "main", "lootaddress", "0x1C513DB")
	IniWrite("GW2_WvW_64.ini", "main", "clicker_key", "{NUMPAD0}")
Else
	$lootkey = IniRead("GW2_WvW_64.ini", "main", "lootkey", "f")
	$lootaddr_ini = IniRead("GW2_WvW_64.ini", "main", "lootaddress", "")
	$clicker_key = IniRead("GW2_WvW_64.ini", "main", "clicker_key", "{NUMPAD0}")
EndIf

$GW2Tool = GUICreate("WvW Tool 64bit", 200, 100, -1, -1)
$Checkbox1 = GUICtrlCreateCheckbox(" Autoloot", 10, 10)
	GUICtrlSetTip(-1, "Automatically collects bags, boxes, etc.")
$Checkbox2 = GUICtrlCreateCheckbox(" Anti AFK", 10, 40)
	GUICtrlSetTip(-1, "Moves the character every 4 min. automatically" & @CRLF & "(GW2 window do not need to be active)")
$Checkbox3 = GUICtrlCreateCheckbox(" Clicker ", 10, 70)
GUICtrlSetTip(-1, "Mouseover an item in the inventory and press " & @CRLF & "the clicker key. The item stack is emptied quickly." & @CRLF & "Clickerkey:    " & $clicker_key)
$btninfo = GUICtrlCreateButton("?", 175, 75, 20, 20)
GUICtrlSetTip(-1, "Click!" & @CRLF & "")
For $Checkbox = $Checkbox1 To $Checkbox3
	GUICtrlSetState($Checkbox, 128)
Next
GUISetState(@SW_SHOW)

While $pid = 0
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			CleanUp()
		Case $btninfo
			info()
	EndSwitch
	Switch TrayGetMsg()
		Case $Exit
			CleanUp()
	EndSwitch
	$pid = ProcessExists("Gw2-64.exe")
WEnd

For $Checkbox = $Checkbox1 To $Checkbox3
    GUICtrlSetState($Checkbox, 64)
Next
SetPrivilege("SeDebugPrivilege", 1)
$open = _MemoryOpen($pid)
$baseAddr = _MemoryModuleGetBaseAddress($pid, "Gw2-64.exe")
$lootaddr = $baseAddr + $lootaddr_ini
$timer = TimerInit()

While 1
	;Autoloot
	If GUICtrlRead($Checkbox1) = 1 Then
		If WinActive("[CLASS:ArenaNet_Dx_Window_Class]") Then
			$loot = _MemoryRead($lootaddr, $open)
			If $loot = 64 Then
				ControlSend("","",0,$lootkey)
				Sleep(20)
			EndIf
		EndIf
	EndIf

	;Anti AFK
	If GUICtrlRead($Checkbox2) = 1 Then Anti_AFK()

	;Clicker
	If GUICtrlRead($Checkbox3) = 1 Then
		HotKeySet($clicker_key, "clicker")
	Else
		HotKeySet($clicker_key) ;kill hotkey
	EndIf

	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			CleanUp()
		Case $btninfo
			info()
	EndSwitch
	Switch TrayGetMsg()
		Case $Exit
			CleanUp()
	EndSwitch
	$pid = ProcessExists("Gw2-64.exe")
	If $pid = 0 Then CleanUp()
WEnd

Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $if_InheritHandle = 1)
	If Not ProcessExists($iv_Pid) Then
		SetError(1)
        Return 0
	EndIf
	Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
	If @Error Then
        SetError(2)
        Return 0
    EndIf
	Local $av_OpenProcess = DllCall($ah_Handle[0], 'int64', 'OpenProcess', 'int64', $iv_DesiredAccess, 'int64', $if_InheritHandle, 'int64', $iv_Pid)
	If @Error Then
        DllClose($ah_Handle[0])
        SetError(3)
        Return 0
    EndIf
	$ah_Handle[1] = $av_OpenProcess[0]
	Return $ah_Handle
EndFunc

Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')
	If Not IsArray($ah_Handle) Then
		SetError(1)
        Return 0
	EndIf
	Local $v_Buffer = DllStructCreate($sv_Type)
	If @Error Then
		SetError(@Error + 1)
		Return 0
	EndIf
	DllCall($ah_Handle[0], 'int64', 'ReadProcessMemory', 'int64', $ah_Handle[1], 'int64', $iv_Address, 'ulong_ptr', DllStructGetPtr($v_Buffer), 'int64', DllStructGetSize($v_Buffer), 'int64', '')
	If Not @Error Then
		Local $v_Value = DllStructGetData($v_Buffer, 1)
		Return $v_Value
	Else
		SetError(6)
        Return 0
	EndIf
EndFunc

Func _MemoryClose($ah_Handle)
	If Not IsArray($ah_Handle) Then
		SetError(1)
        Return 0
	EndIf
	DllCall($ah_Handle[0], 'int64', 'CloseHandle', 'int64', $ah_Handle[1])
	If Not @Error Then
		DllClose($ah_Handle[0])
		Return 1
	Else
		DllClose($ah_Handle[0])
		SetError(2)
        Return 0
	EndIf
EndFunc

Func SetPrivilege( $privilege, $bEnable )
    Const $TOKEN_ADJUST_PRIVILEGES = 0x0020
    Const $TOKEN_QUERY = 0x0008
    Const $SE_PRIVILEGE_ENABLED = 0x0002
    Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
    $nTokens = 1
    $LUID = DLLStructCreate("dword;int64")
    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],   _
            "int64",BitOR($TOKEN_ADJUST_PRIVILEGES,$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","int64","LookupPrivilegeValue","str","","str",$priv,   _
                    "ulong_ptr",DLLStructGetPtr($LUID))
            If $ret[0] Then
                If $bEnable Then
                    DLLStructSetData($TOKEN_PRIVILEGES,2,$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","int64","AdjustTokenPrivileges","hwnd",$hToken,"int64",0,   _
                "ulong_ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int64",DllStructGetSize($NEWTOKEN_PRIVILEGES),   _
                "ulong_ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int64*",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","int64","CloseHandle","hwnd",$hToken)
    If Not $ret[0] And Not $SP_auxret[0] Then Return 0
    return $ret[0]
EndFunc

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)
    If Not IsString($sModule) Then Return SetError(2, 0, 0)
    Local   $PSAPI = DllOpen("psapi.dll")
    Local   $hProcess
    Local   $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020)
    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ulong_ptr", "OpenProcess", "dword", $PERMISSION, "int64", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf
    Local   $Modules = DllStructCreate("ptr[1024]")
    Local   $aCall = DllCall($PSAPI, "int64", "EnumProcessModules", "ulong_ptr", $hProcess, "ulong_ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local   $iModnum = $aCall[4] / 4
        Local   $aTemp
        For $i = 1 To $iModnum
            $aTemp =  DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ulong_ptr", $hProcess, "ulong_ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf
    DllClose($PSAPI)
    Return SetError(-1, 0, 0)
EndFunc

Func CleanUp()
	_MemoryClose($open)
	Exit
EndFunc

Func Anti_AFK()
	$timed = TimerDiff($timer)
	If $timed >240000 Then
		ControlSend("[CLASS:ArenaNet_Dx_Window_Class]", "", 0, "{w down}")
		Sleep(500)
		ControlSend("[CLASS:ArenaNet_Dx_Window_Class]", "", 0, "{w up}")
		ControlSend("[CLASS:ArenaNet_Dx_Window_Class]", "", 0, "{s down}")
		Sleep(1300)
		ControlSend("[CLASS:ArenaNet_Dx_Window_Class]", "", 0, "{s up}")
		$timer = TimerInit()
	EndIf
EndFunc

Func info()
    MsgBox(0+64, "Info", "Guild Wars 2 - WvW Tool" & @CR & @CR & "©  2015" & " Kellerkind",6)
EndFunc

Func clicker()
	MouseClick("left")
EndFunc
11/19/2015 18:58 whipaz999#364
@rince2k
Your version does not allow to press on check boxes.
11/19/2015 19:03 rince2k#365
Its only for the 64bit beta client.
.exe must be gw2-64.exe
11/19/2015 19:04 whipaz999#366
Quote:
Originally Posted by rince2k View Post
Its only for the 64bit beta client
I'm sorry, it's not your code. Something's wrong with my PC. I just tried using the old version (the one i was using 2weeks ago), I can't tap any of those 3 checkboxes either. Hmm
11/21/2015 12:04 Yothri#367
0x178A11B
11/22/2015 12:20 whipaz999#368
22/11/2015

lootaddress=0x1C513DB
11/24/2015 16:32 djenk#369
[Only registered and activated users can see links. Click Here To Register...] Has a 64 bit client for you. It is based on the work of this thread with a few improvements.

Those with AutoIt can always view the source code and run that directly: Right click > Run Script (x64). Otherwise a .exe is included as well which works out of the box.

If you have any problems with it please post it to the AURA thread. A big change from this version is that you do not include the "0x" in the loot address when changing the .ini file.

Also be sure to check that the path to your gw2 64 bit client is correct in the .ini file. You may remove the paramaters if you don't like seeing the map load info or want to use port 80.
11/30/2015 14:29 MystKid#370
whats the new address?
12/01/2015 22:12 whipaz999#371
01/12/2015
lootaddress=0x1C5F98B
12/03/2015 17:15 MystKid#372
autoloot does not work
12/04/2015 11:19 whipaz999#373
Quote:
Originally Posted by MystKid View Post
autoloot does not work
Works like a charm to me, 64bit version. Make sure you update manually the lootaddress in .ini file.
Just tested now, the lootaddress that I've posted above still works.
12/11/2015 15:36 MystKid#374
never been able to use the autoloot. tried several times using cheat engien with the tutorial to get the address but all the adresses i got until now never worked. i am using the original 32 bit gw2.exe, windows 10 64 bit
12/12/2015 12:33 whipaz999#375
Quote:
Originally Posted by MystKid View Post
never been able to use the autoloot. tried several times using cheat engien with the tutorial to get the address but all the adresses i got until now never worked. i am using the original 32 bit gw2.exe, windows 10 64 bit
Hmm, well I don't know. I'm using windows 10 64bit, gw2 64bit, and the @rince2k 's script (the 64bit version auto looter). (Compiled to .exe file, and updated to the latest loot address myself) Running as administrator and it works fine. Same thing with GW2 A.U.R.A.