Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 12:03

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

Advertisement



Dll Injector

Discussion on Dll Injector within the GW Bots forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2009
Posts: 941
Received Thanks: 180
Talking Dll Injector

hallo leute,

würde gerne einen injector, wie z.b. Inizio in meinen Bot einbauen.
Habe daher nach einem Quellcode gesucht, mit dem man einfach eine DLL injecten kann.

Bin nach einiger Zeit hier drauf gestoßen :



Wenn ich die funktion aufrufe, dann erhalte ich keinen Error, somit sollte das Injecten funktioniert haben, aber leider ändert sich der Fenstername von GW nicht, was bedeutet, dass wohl doch nicht richtig injiziert wurde.

Würde gerne wissen, woran das liegen könnte.
An der DLL kanns nicht liege, denn die funktioniert mit Inizio problemlos.

Danke bereits im Vorraus.


mfg Chillmastor
chillmastor is offline  
Old 05/15/2011, 12:23   #2
 
Cr33p's Avatar
 
elite*gold: 0
The Black Market: 133/0/1
Join Date: Mar 2008
Posts: 820
Received Thanks: 156
nehm das hier:
PHP 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($dllpathThen
    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: " $hMod1)
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) <= Or StringRight($dllpath4) <> ".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($pidThen
        $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($pLibRemoteThen
        
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 11)), "int"1"int"0)
        If 
IsArray($retThen
            
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($modHandleThen
        
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($LoadLibraryAThen
        
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($hThreadThen
        
;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 
Cr33p is offline  
Thanks
1 User
Old 05/15/2011, 13:00   #3
 
elite*gold: 20
Join Date: Feb 2007
Posts: 3,080
Received Thanks: 4,294
kknb is offline  
Thanks
2 Users
Old 05/15/2011, 13:20   #4
 
elite*gold: 0
Join Date: Sep 2009
Posts: 941
Received Thanks: 180
Bekomme bei der von euch geposteten Injectmethode immer Errorcode 13.

Blicke bei den DLL commands in AutoIT nicht durch, deswegen wäre es schön, wenn mir ein netter Mensch, der mehr davon versteht als ich, sagen könnte wie ich das ändern kann bzw. wo mein Fehler liegt.
chillmastor is offline  
Old 05/15/2011, 13:49   #5
 
elite*gold: 0
Join Date: Feb 2011
Posts: 135
Received Thanks: 43
Schau dir einfach den Code an...
Error 13 = CreateRemoteThread...
_Merowinger_ is offline  
Thanks
1 User
Old 05/15/2011, 13:52   #6
 
elite*gold: 0
Join Date: Sep 2009
Posts: 941
Received Thanks: 180
Ja das kann ich da auch lesen, jedoch habe ich keine Ahnung was ich da ändern kann, damit sich mein problem löst :P
chillmastor is offline  
Old 05/15/2011, 13:56   #7
 
elite*gold: 0
Join Date: Feb 2011
Posts: 135
Received Thanks: 43
Entweder in die dll eine MessageBox einfügen, die zeigt ob DllMain wirklich gecallt wird oder die Hide Functions raushauen, um zu sehen ob es wirklich an CreateRemoteThread liegt. Das Stichwort heißt hier allgemein debuggen.
_Merowinger_ is offline  
Thanks
1 User
Old 05/15/2011, 14:03   #8
 
elite*gold: 0
Join Date: Sep 2009
Posts: 941
Received Thanks: 180
Kann leider kein stück C++. Deswegen kann ich an der DLL nichts ändern.
Wenns keine andere Lösung gibt, dann werd ich wohl weiterhin Inizio benutzen.

Trotzdem Danke
chillmastor is offline  
Reply


Similar Threads Similar Threads
Suche Funktioniernden Injector (Search for a working injector) CA EU
09/08/2010 - Combat Arms - 13 Replies
Kann Jemand einen Link von einem Funktionierenden Injector geben außer PerX suche schon ewig aba find keinen Can somebody give me a link for a working Injector i search every time but still nothing found^^ pleas give link but no perx sorry for bad english thx schon ma im vorraus



All times are GMT +1. The time now is 12:03.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.