Register for your free account! | Forgot your password?

You last visited: Today at 16:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Autoinject for ur Scripts [au3]

Discussion on Autoinject for ur Scripts [au3] within the GW Exploits, Hacks, Bots, Tools & Macros forum part of the Guild Wars category.

Reply
 
Old   #1


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,285
Autoinject for ur Scripts [au3]

Just include it
Code:
;If Not @Compiled Then Exit

$hwnd = WinGetHandle("Guild Wars")

Global Const $dllpath = @ScriptDir & "\data\Hook.dll"
Global Const $dllname = "Hook.dll"

If Not FileExists($dllpath) Then
	MsgBox(0x10, "Error", $dllpath & " Not found!")
	Exit
EndIf

$hMod = GetModule($hwnd, $dllname)
If $hMod = 0 Then
	$iDLL = InjectModule($hwnd, $dllpath)
	If Not @error Then
		TrayTip("", "Injection Successfull", 1)
	Else
		MsgBox(0x10, "Error in DLL Injection", "Couldn't inject dll to " & $hwnd & @CRLF & "Code: " & @error)
	EndIf
Else
	TrayTip("", $dllname & " was already Injected: " & $hMod, 1)
EndIf
		
Func GetModule($hWnd, $ModuleName)

	Local Const $MODULEENTRY32Struct = DllStructCreate("dword dwsize;" & _
			"dword th32ModuleID;" & _
			"dword th32ProcessId;" & _
			"dword GlblcntUsage;" & _
			"dword ProccntUsage;" & _
			"dword modBaseAddr;" & _
			"dword modBaseSize;" & _
			"dword hModule;" & _
			"char szModule[256];" & _
			"char szExePath[260];")

	Local $SnapShot = DllCall("Kernel32.dll", "hwnd", "CreateToolhelp32Snapshot", "dword", 0x08, "dword", WinGetProcess($hWnd))

	DllStructSetData($MODULEENTRY32Struct, "dwsize", DllStructGetSize($MODULEENTRY32Struct))

	Local $State = DllCall("Kernel32.dll", "int", "Module32First", "hwnd", $SnapShot[0], "ptr", DllStructGetPtr($MODULEENTRY32Struct))

	Do
		$ReadModule = DllStructGetData($MODULEENTRY32Struct, "szModule")
		If $ReadModule == $ModuleName Then Return "0x" & (Hex(DllStructGetData($MODULEENTRY32Struct, 'modBaseAddr')))
		$State = DllCall("Kernel32.dll", "int", "Module32Next", "hwnd", $SnapShot[0], "ptr", DllStructGetPtr($MODULEENTRY32Struct))
		Sleep(1)
	Until Not $State[0]
	DllCall("Kernel32.dll", "int", "CloseHandle", "int", $SnapShot[0])
	
	Return 0
EndFunc   ;==>GetModule

Func InjectModule($hwnd, $dllpath)
	If IsHWnd($hwnd) = 0 Then
		SetError(-1)
		Return False
	ElseIf StringLen($dllpath) <= 4 Or StringRight($dllpath, 4) <> ".dll" Then
		SetError(-2)
		Return False
	EndIf

	Local $pid, $pHandle, $pLibRemote, $modHandle, $LoadLibraryA, $hThread

	Local $kernel32 = DllOpen("kernel32.dll")
	If $kernel32 = -1 Then
		Exit
	EndIf

	$pid = DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $hwnd, "int*", 0)
	If IsArray($pid) Then
		$pid = $pid[2]
	Else
		SetError(-3)
		Return False
	EndIf

	$pHandle = DllCall($kernel32, "int", "OpenProcess", "int", 0x1F0FFF, "int", 0, "int", $pid)
	If IsArray($pHandle) And $pHandle[0] > 0 Then
		$pHandle = $pHandle[0]
	Else
		SetError(-4)
		Return False
	EndIf

	$pLibRemote = DllCall($kernel32, "int", "VirtualAllocEx", "int", $pHandle, "short", 0, "int", 0x1000, "int", 0x1000, "int", 4)
	If IsArray($pLibRemote) Then
		If $pLibRemote[0] > 0 Then
			;ConsoleWrite("0x" & Hex($pLibRemote[0], 8) & @CR)
			$pLibRemote = $pLibRemote[0]
		Else
			SetError(-5)
			Return False
		EndIf
	Else
		SetError(-6)
		Return False
	EndIf

	For $i = 0 To StringLen($dllpath)
		$ret = DllCall("kernel32.dll", "int", "WriteProcessMemory", "int", $pHandle, "int", $pLibRemote + $i, "int*", Asc(StringMid($dllpath, $i + 1, 1)), "int", 1, "int", 0)
		If IsArray($ret) Then
			If $ret[0] = 0 Then
				SetError(-7)
				Return False
			EndIf
		Else
			SetError(-8)
			Return False
		EndIf
	Next

	$modHandle = DllCall($kernel32, "long", "GetModuleHandle", "str", "kernel32.dll")
	If IsArray($modHandle) Then
		If $modHandle[0] > 0 Then
			$modHandle = $modHandle[0]
		Else
			SetError(-9)
			Return False
		EndIf
	Else
		SetError(-10)
		Return False
	EndIf

	$LoadLibraryA = DllCall($kernel32, "long", "GetProcAddress", "long", $modHandle, "str", "LoadLibraryA")
	If IsArray($LoadLibraryA) Then
		If $LoadLibraryA[0] > 0 Then
			$LoadLibraryA = $LoadLibraryA[0]
		Else
			SetError(-11)
			Return False
		EndIf
	Else
		SetError(-12)
		Return False
	EndIf

	$hThread = DllCall($kernel32, "int", "CreateRemoteThread", "int", $pHandle, "int", 0, "int", 0, "long", $LoadLibraryA, "long", $pLibRemote, "int", 0, "int", 0)
	If IsArray($hThread) Then
		;ConsoleWrite($hThread[0] & @CR)
		If $hThread[0] > 0 Then
			$hThread = $hThread[0]
		Else
			SetError(-13)
			Return False
		EndIf
	Else
		SetError(-14)
		Return False
	EndIf

	DllCall($kernel32, "int", "VirtualFreeEx", "int", $pHandle, "int", $pLibRemote, "int", 0x1000, "int", 0x8000)
	DllCall($kernel32, "int", "CloseHandle", "int", $hThread)
	DllCall($kernel32, "int", "CloseHandle", "int", $pHandle)

	DllClose($kernel32)

	Return True
EndFunc   ;==>_InjectDll
buFFy! is offline  
Thanks
10 Users
Old 02/08/2010, 18:49   #2
 
vassilis's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 62
Received Thanks: 81
ich bekomme nur die anzeige das "Windows explorer" nicht funktioniert und anschliesend neu gestartet wird...die graphics.dll ist aber auch nicht injected
vassilis is offline  
Old 02/15/2010, 09:55   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 14
Received Thanks: 0
hallo hab auch ein kleines problem damit

habe das script an der stelle verändert
Global Const $dllpath = @ScriptDir & "\data\GWCA.dll"
Global Const $dllname = "GWCA.dll"

habe das script so als dll_injektion.au3 gespeichert und per
#include "dll_injektion.au3"
in mein script gesetzt.

wenn ich den Bot starte sag er das das includen (schreibt man wohl nicht so ^^)
geklappt hat, aber das hat es nicht .
denn normalerweise steht der charname links oben im gw fenster wenn es klappt und mein GWCA basierender bot läuft dann logischerweise auch nicht.
0ojako0 is offline  
Old 02/15/2010, 10:32   #4
 
elite*gold: 20
Join Date: Feb 2007
Posts: 3,080
Received Thanks: 4,294
haste das projekt auch kompiliert vorm starten? zumindest bei mir gehts nur so.
kknb is offline  
Old 02/26/2010, 17:15   #5
 
Na Mora's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 30
Received Thanks: 0
versteh ich das richtig, dass die zu injizierende .dll im verzeichnis vom skript + \data ist und den namen Hook.dll haben muss? demnach müsste man doch "\data" weglassen können und dann muss die .dll im skriptverzeichnis sein, oder?
Na Mora is offline  
Old 02/26/2010, 17:23   #6
 
elite*gold: 20
Join Date: Feb 2007
Posts: 3,080
Received Thanks: 4,294
richtig
kknb is offline  
Thanks
1 User
Old 05/21/2010, 22:44   #7
 
elite*gold: 0
Join Date: May 2008
Posts: 26
Received Thanks: 0
Habe da mal eine Frage: Woran kann es liegen, dass die gwca dll nicht geladen werden kann? Es kommt die Fehlermeldung "Couldn't inject dll to". Die Standardursachen wie falsche PFade und nicht laufende Prozesse kann man ausschließen. Die Exe wird als Admin unter Win 7 64 bit ausgeführt.
Morta Della is offline  
Old 05/21/2010, 22:45   #8
 
elite*gold: 100
Join Date: Oct 2007
Posts: 738
Received Thanks: 485
Was sagt der Error Code?
ddl is offline  
Reply


Similar Threads Similar Threads
Gunz AutoInject
12/10/2009 - GunZ - 7 Replies
Here is an AutoInjector for gunz, easy to use... Link: 100% Free File Hosting Services - Upload | Share | Earn Just open the injector, browse/loadthe DarkX hack, but make sure u got it on AUTO-INJECT And done ^^ Start gunz and the hack will be activated... Some people will get error on COMDLG32.OCX, so i just attached the file with it. Just put it in SYSTEM map...
agBot Loop Scripts [ Let's Make alist with Mobs Scripts ]
07/09/2008 - SRO Hacks, Bots, Cheats & Exploits - 228 Replies
Hello Everyone, i saw that everyone is getting stuck to make agBot Loop Script. so i though we should make a topic a mobs scripts. and i will start. :) Now for me i prefer to use notepad to make my scripts. How to install : Just Copy the code and paste in <bot folder>\config\config1\script\default.lst If we got more scripts, i will just make a webpage, where you can select Town, HP and MP Bots you wanna buy then the monster you want to kill. then it auto generate the script for you....



All times are GMT +1. The time now is 16:34.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.