[Release] GR Autolooter

05/02/2013 11:24 copycatuk#61
Quote:
Originally Posted by geshvader View Post
Have not seen how original works before last patch.
Made my own. Looks like it works the same way. On my PC at least.
Someone try and check.
SUPERAntiSpyware Trojan.Agent/Gen-Bifrose 20130502
VIPRE Trojan.Win32.Generic!BT 20130502
TheHacker Trojan/Cosmu.bizd 20130502
VIPRE Trojan.Win32.Generic!BT 20130502
05/02/2013 11:37 Deathsnacks#62
Quote:
Originally Posted by copycatuk View Post
SUPERAntiSpyware Trojan.Agent/Gen-Bifrose 20130502
VIPRE Trojan.Win32.Generic!BT 20130502
TheHacker Trojan/Cosmu.bizd 20130502
VIPRE Trojan.Win32.Generic!BT 20130502
Decompiled it and looks safe, seems like its catching on the (of what I think is) NomadMemory library being used.
05/02/2013 11:41 geshvader#63
It's compiled AutoIt script.
Some functions for work with (read) memory address used.
Maybe this explain?
Checked it with eset nod 32 - clear.
05/02/2013 11:58 copycatuk#64
Works - Thanks
05/02/2013 12:09 sitapea1337#65
Decompiled:
Code:
Global $title = "Guild Wars 2"
Global $hwnd = WinGetHandle($title)
Global $lootkey = "f"
#Region _Memory

Func _memoryopen($iv_pid, $iv_desiredaccess = 2035711, $iv_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], "int", "OpenProcess", "int", $iv_desiredaccess, "int", $iv_inherithandle, "int", $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], "int", "ReadProcessMemory", "int", $ah_handle[1], "int", $iv_address, "ptr", DllStructGetPtr($v_buffer), "int", DllStructGetSize($v_buffer), "int", "")
	If NOT @error Then
		Local $v_value = DllStructGetData($v_buffer, 1)
		Return $v_value
	Else
		SetError(6)
		Return 0
	EndIf
EndFunc

Func _memorywrite($iv_address, $ah_handle, $v_data, $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
	Else
		DllStructSetData($v_buffer, 1, $v_data)
		If @error Then
			SetError(6)
			Return 0
		EndIf
	EndIf
	DllCall($ah_handle[0], "int", "WriteProcessMemory", "int", $ah_handle[1], "int", $iv_address, "ptr", DllStructGetPtr($v_buffer), "int", DllStructGetSize($v_buffer), "int", "")
	If NOT @error Then
		Return 1
	Else
		SetError(7)
		Return 0
	EndIf
EndFunc

Func _memoryclose($ah_handle)
	If NOT IsArray($ah_handle) Then
		SetError(1)
		Return 0
	EndIf
	DllCall($ah_handle[0], "int", "CloseHandle", "int", $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 $my_token_adjust_privileges = 32
	Const $my_token_query = 8
	Const $my_se_privilege_enabled = 2
	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

#EndRegion
$iv_pid = ProcessExists("Gw2.exe")
$memoryopen = _memoryopen($iv_pid)
While 1
	$mem_read = _memoryread("0x" & "017309EB", $memoryopen)
	Sleep(50)
	If $mem_read = 64 Then
		ControlSend($hwnd, "", "", $lootkey)
	EndIf
WEnd
_memoryclose($memoryopen)

EDIT: Haven't tested that code, but since address seems to be correct, it should work. Though - one should make "chatbox/typing" check as well since it wouldn't be nice for script to spam "f" when chat is open and character is standing on loot.
Still - that script would be enough.
05/02/2013 12:12 geshvader#66
nMemory2.au3 used
05/02/2013 12:26 sunflight#67
Quote:
Originally Posted by Whynotzoidberg View Post
buy [Only registered and activated users can see links. Click Here To Register...] they have a tool for wvw autoloot.
I donīt want to pay a montly fee ...
05/02/2013 14:37 Thorid#68
Quote:
Originally Posted by geshvader View Post
Have not seen how original works before last patch.
Made my own. Looks like it works the same way. On my PC at least.

PM me if someone want donate some gold/gems for newb (me) :)
Was a bit skeptical at first but it works just as expected, thanks heaps! :)
05/02/2013 15:42 buFFy!#69
Quote:
Originally Posted by sitapea1337 View Post
Decompiled:
Code:
Global $title = "Guild Wars 2"
Global $hwnd = WinGetHandle($title)
Global $lootkey = "f"
#Region _Memory

Func _memoryopen($iv_pid, $iv_desiredaccess = 2035711, $iv_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], "int", "OpenProcess", "int", $iv_desiredaccess, "int", $iv_inherithandle, "int", $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], "int", "ReadProcessMemory", "int", $ah_handle[1], "int", $iv_address, "ptr", DllStructGetPtr($v_buffer), "int", DllStructGetSize($v_buffer), "int", "")
	If NOT @error Then
		Local $v_value = DllStructGetData($v_buffer, 1)
		Return $v_value
	Else
		SetError(6)
		Return 0
	EndIf
EndFunc

Func _memorywrite($iv_address, $ah_handle, $v_data, $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
	Else
		DllStructSetData($v_buffer, 1, $v_data)
		If @error Then
			SetError(6)
			Return 0
		EndIf
	EndIf
	DllCall($ah_handle[0], "int", "WriteProcessMemory", "int", $ah_handle[1], "int", $iv_address, "ptr", DllStructGetPtr($v_buffer), "int", DllStructGetSize($v_buffer), "int", "")
	If NOT @error Then
		Return 1
	Else
		SetError(7)
		Return 0
	EndIf
EndFunc

Func _memoryclose($ah_handle)
	If NOT IsArray($ah_handle) Then
		SetError(1)
		Return 0
	EndIf
	DllCall($ah_handle[0], "int", "CloseHandle", "int", $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 $my_token_adjust_privileges = 32
	Const $my_token_query = 8
	Const $my_se_privilege_enabled = 2
	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

#EndRegion
$iv_pid = ProcessExists("Gw2.exe")
$memoryopen = _memoryopen($iv_pid)
While 1
	$mem_read = _memoryread("0x" & "017309EB", $memoryopen)
	Sleep(50)
	If $mem_read = 64 Then
		ControlSend($hwnd, "", "", $lootkey)
	EndIf
WEnd
_memoryclose($memoryopen)

EDIT: Haven't tested that code, but since address seems to be correct, it should work. Though - one should make "chatbox/typing" check as well since it wouldn't be nice for script to spam "f" when chat is open and character is standing on loot.
Still - that script would be enough.
just call interact or send the lootpacket

however:

Code:
if _memoryread(0x1699834, $hProcess, "dword") == 0 then loot()
05/02/2013 16:20 Lemberac#70
Buffy you should implement autoloot on midnight paid version. It would be a blast
05/02/2013 16:21 buFFy!#71
Quote:
Originally Posted by Lemberac View Post
Buffy you should implement autoloot on midnight paid version. It would be a blast
Not in the mood for now. Playing Neverwinter.
05/02/2013 18:11 Xereon#72
jesus, for those people qqing for an update, i stated that i wont and posted the interact method, if your too lazy to set a bp on it, sorry not my problem.
05/02/2013 19:18 darkbluefirefly#73
how's neverwinter?
05/02/2013 19:26 buFFy!#74
Quote:
Originally Posted by darkbluefirefly View Post
how's neverwinter?
Way better than Guild Wars 2. Offtopic tho.
05/02/2013 21:35 w00tsauce#75
Thanks a lot geshvader. eset shows it as clean and it works as expected.