Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 14:46

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

Advertisement



DLL injector prozess anzeige button

Discussion on DLL injector prozess anzeige button within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 962
Received Thanks: 96
DLL injector prozess anzeige button

Hay ich möchte von diesen source wo ein dll searcher drin ist noch ein butten über den aneren mit dem ich alle prozesse anzeigen lääst und wenn ich auf ein rauf klickt das er in den input eingefügt wird.

Hier der Code:
Quote:
PHP Code:
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n

#RequireAdmin
#include <GUIConstants.au3>

GUICreate("Beispiel"275100)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel("Prozess:"10105017)
$I_ProcessName GUICtrlCreateInput(""651020021)
GUICtrlCreateLabel("DLL:"10405017)
$I_DllPath GUICtrlCreateInput(""654015021)
$B_SearchDll GUICtrlCreateButton("..."225404025)
$R_Auto GUICtrlCreateRadio("Automatisch"10757517)
GUICtrlSetState(-1$GUI_CHECKED)
$R_Man GUICtrlCreateRadio("Manuell"130755517)
$B_Inject GUICtrlCreateButton("Injizieren"190707525)
GUICtrlSetState(-1$GUI_DISABLE)
GUISetState()

$Injected False

Do
    
$Msg GUIGetMsg()
    Switch 
$Msg
        
Case $B_SearchDll
            GUICtrlSetData
($I_DllPathFileOpenDialog("Dll", @HomeDrive"Dynamic Link Library (*.dll)"3))
        Case 
$R_Auto
            GUICtrlSetState
($B_Inject$GUI_DISABLE)
        Case 
$R_Man
            GUICtrlSetState
($B_Inject$GUI_ENABLE)
        Case 
$B_Inject
            _InjectDll
(ProcessExists(GUICtrlRead($I_ProcessName)), GUICtrlRead($I_DllPath))
            
_Message(@error)
    EndSwitch

    If 
BitAND(GUICtrlRead($R_Auto), $GUI_CHECKED) And Not $Injected Then
        $ProcessId 
ProcessExists(GUICtrlRead($I_ProcessName))
        If 
$ProcessId 0 Then
            _InjectDll
($ProcessIdGUICtrlRead($I_DllPath))
            
_Message(@error)
            
$Injected True
            
;Exit
        EndIf
    EndIf

    
Sleep(10)
Until $Msg == $GUI_EVENT_CLOSE



Func _Message
($ErrorCode)
    If 
$ErrorCode <> 0 Then
        MsgBox
(48"Fehler""Es ist ein Fehler aufgetreten!" & @CRLF "Fehlercode: " & @error)
    Else
        
MsgBox(64"Info""Injektion erfolgreich!")
    EndIf
EndFunc


;=================================================================================================
; Function:            
_InjectDll($ProcessId$DllPath)
Description:        Injects a .dll into a running program.
; Return 
Value(s):    On Success Returns true
;                    On Failure Returns false
;                    @Error No error.
;                             
Invalid ProcessId.
;                             
File does not exist.
;                             
File is not a .dll (invalid file).
;                             
Failed to open 'Advapi32.dll'.
;                             
Failed to get the full path.
;                             
Failed to open the process.
;                             
Failed to call 'GetModuleHandle'.
;                             
Failed to call 'GetProcAddress'.
;                             
Failed to call 'VirtualAllocEx'.
;                             
10 Failed to write the memory.
;                             
11 Failed to create the 'RemoteThread'.
Author(s):        KillerDeluxe
;=================================================================================================

Func _InjectDll($ProcessId$DllPath)
    If 
$ProcessId == 0 Then Return SetError(1""False)
    If 
Not(FileExists($DllPath)) Then Return SetError(2""False)
    If 
Not(StringRight($DllPath4) == ".dll"Then Return SetError(3""False)

    
$Kernel32 DllOpen("kernel32.dll")
    If @
error Then Return SetError(4""False)

    
$DLL_Path DllStructCreate("char[255]")
    
DllCall($Kernel32"DWORD""GetFullPathNameA""str"$DllPath"DWORD"255"ptr"DllStructGetPtr($DLL_Path), "int"0)
    If @
error Then Return SetError(5""False)

    
$hProcess DllCall($Kernel32"DWORD""OpenProcess""DWORD"0x1F0FFF"int"0"DWORD"$ProcessId)
    If @
error Then Return SetError(6""False)

    
$hModule DllCall($Kernel32"DWORD""GetModuleHandleA""str""kernel32.dll")
    If @
error Then Return SetError(7""False)

    
$lpStartAddress DllCall($Kernel32"DWORD""GetProcAddress""DWORD"$hModule[0], "str""LoadLibraryA")
    If @
error Then Return SetError(8""False)

    
$lpParameter DllCall($Kernel32"DWORD""VirtualAllocEx""int"$hProcess[0], "int"0"ULONG_PTR"DllStructGetSize($DLL_Path), "DWORD"0x3000"int"4)
    If @
error Then Return SetError(9""False)

    
DllCall("kernel32.dll""BOOL""WriteProcessMemory""int"$hProcess[0], "DWORD"$lpParameter[0], "str"DllStructGetData($DLL_Path1), "ULONG_PTR"DllStructGetSize($DLL_Path), "int"0)
    If @
error Then Return SetError(10""False)

    
$hThread DllCall($Kernel32"int""CreateRemoteThread""DWORD"$hProcess[0], "int"0"int"0"DWORD"$lpStartAddress[0], "DWORD"$lpParameter[0], "int"0"int"0)
    If @
error Then Return SetError(11""False)

    
DllCall($Kernel32"BOOL""CloseHandle""DWORD"$hProcess[0])
    
DllClose($Kernel32)

    Return 
SetError(0""True)
EndFun 
lautlosertot is offline  
Old 06/30/2011, 00:02   #2
 
RunzelEier's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 1,196
Received Thanks: 682
so gehts.
ich hatte das in nem combo gemacht, aber sollte ja kein ding sein das umzubauen
PHP Code:
Func _refresh()
    
$process ProcessList()
    For 
$i 1 to UBound($process)-1
        GUICtrlSetData
($Combo,$process[$i][0])
    
Next
    _GUICtrlComboBox_SetCurSel
($Combo,0)
EndFunc 
RunzelEier is offline  
Old 06/30/2011, 00:25   #3
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Ich würde dafür eine ListView benutzen. Ein neuer Thread war dafür aber nicht nötig.

PHP Code:
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n

#RequireAdmin
#include <GUIConstants.au3>
#include <GUIListView.au3>
#include <ListViewConstants.au3>

#Region MainGUI
$MainGUI GUICreate("Beispiel"275100)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel("Prozess:"10105017)
$I_ProcessName GUICtrlCreateInput(""651015021)
$B_SearchProcess GUICtrlCreateButton("..."225104025)
GUICtrlCreateLabel("DLL:"10405017)
$I_DllPath GUICtrlCreateInput(""654015021)
$B_SearchDll GUICtrlCreateButton("..."225404025)
$R_Auto GUICtrlCreateRadio("Automatisch"10757517)
GUICtrlSetState(-1$GUI_CHECKED)
$R_Man GUICtrlCreateRadio("Manuell"130755517)
$B_Inject GUICtrlCreateButton("Injizieren"190707525)
GUICtrlSetState(-1$GUI_DISABLE)
GUISetState()
#EndRegion

#Region SubGUI
$SubGUI GUICreate("Prozesse"250255)
$ListView GUICtrlCreateListView("Prozess|Prozess ID"00250230)
GUICtrlSendMsg(-1$LVM_SETEXTENDEDLISTVIEWSTYLE00x21)
GUICtrlSendMsg(-1$LVM_SETCOLUMNWIDTH0150)
GUICtrlSendMsg(-1$LVM_SETCOLUMNWIDTH175)
$B_Process GUICtrlCreateButton("Prozess auswählen"023025025)
#EndRegion

$Injected False

While Sleep(10)
    
$Msg GUIGetMsg(1)
    If 
$Msg[1] == $MainGUI Then
        
Switch $Msg[0]
            Case 
$GUI_EVENT_CLOSE
                
Exit
            Case 
$B_SearchProcess
                _GUICtrlListView_DeleteAllItems
($ListView)
                
$ProcessList ProcessList()
                For 
$i 1 To $ProcessList[0][0]
                    
GUICtrlCreateListViewItem($ProcessList[$i][0] & "|" $ProcessList[$i][1], $ListView)
                
Next
                GUISetState
(@SW_SHOW$SubGUI)
            Case 
$B_SearchDll
                GUICtrlSetData
($I_DllPathFileOpenDialog("Dll", @HomeDrive"Dynamic Link Library (*.dll)"3))
            Case 
$R_Auto
                GUICtrlSetState
($B_Inject$GUI_DISABLE)
            Case 
$R_Man
                GUICtrlSetState
($B_Inject$GUI_ENABLE)
            Case 
$B_Inject
                _InjectDll
(ProcessExists(GUICtrlRead($I_ProcessName)), GUICtrlRead($I_DllPath))
                
_Message(@error)
        EndSwitch

    ElseIf 
$Msg[1] == $SubGUI Then
        
Switch $Msg[0]
            Case 
$GUI_EVENT_CLOSE
                GUISetState
(@SW_HIDE$SubGUI)
            Case 
$B_Process
                $SelectedItem 
_GUICtrlListView_GetSelectedIndices($ListViewTrue)
                
GUICtrlSetData($I_ProcessName_GUICtrlListView_GetItemText($ListView$SelectedItem[1], 0))
                
GUISetState(@SW_HIDE$SubGUI)
        EndSwitch
    EndIf

    If 
BitAND(GUICtrlRead($R_Auto), $GUI_CHECKED) And Not $Injected Then
        $ProcessId 
ProcessExists(GUICtrlRead($I_ProcessName))
        If 
$ProcessId 0 Then
            _InjectDll
($ProcessIdGUICtrlRead($I_DllPath))
            
_Message(@error)
            
$Injected True
            
;Exit
        EndIf
    EndIf

    
Sleep(10)
WEnd



Func _Message
($ErrorCode)
    If 
$ErrorCode <> 0 Then
        MsgBox
(48"Fehler""Es ist ein Fehler aufgetreten!" & @CRLF "Fehlercode: " & @error)
    Else
        
MsgBox(64"Info""Injektion erfolgreich!")
    EndIf
EndFunc


;=================================================================================================
; Function:            
_InjectDll($ProcessId$DllPath)
Description:        Injects a .dll into a running program.
; Return 
Value(s):    On Success Returns true
;                    On Failure Returns false
;                    @Error No error.
;                             
Invalid ProcessId.
;                             
File does not exist.
;                             
File is not a .dll (invalid file).
;                             
Failed to open 'Advapi32.dll'.
;                             
Failed to get the full path.
;                             
Failed to open the process.
;                             
Failed to call 'GetModuleHandle'.
;                             
Failed to call 'GetProcAddress'.
;                             
Failed to call 'VirtualAllocEx'.
;                             
10 Failed to write the memory.
;                             
11 Failed to create the 'RemoteThread'.
Author(s):        KillerDeluxe
;=================================================================================================

Func _InjectDll($ProcessId$DllPath)
    If 
$ProcessId == 0 Then Return SetError(1""False)
    If 
Not(FileExists($DllPath)) Then Return SetError(2""False)
    If 
Not(StringRight($DllPath4) == ".dll"Then Return SetError(3""False)

    
$Kernel32 DllOpen("kernel32.dll")
    If @
error Then Return SetError(4""False)

    
$DLL_Path DllStructCreate("char[255]")
    
DllCall($Kernel32"DWORD""GetFullPathNameA""str"$DllPath"DWORD"255"ptr"DllStructGetPtr($DLL_Path), "int"0)
    If @
error Then Return SetError(5""False)

    
$hProcess DllCall($Kernel32"DWORD""OpenProcess""DWORD"0x1F0FFF"int"0"DWORD"$ProcessId)
    If @
error Then Return SetError(6""False)

    
$hModule DllCall($Kernel32"DWORD""GetModuleHandleA""str""kernel32.dll")
    If @
error Then Return SetError(7""False)

    
$lpStartAddress DllCall($Kernel32"DWORD""GetProcAddress""DWORD"$hModule[0], "str""LoadLibraryA")
    If @
error Then Return SetError(8""False)

    
$lpParameter DllCall($Kernel32"DWORD""VirtualAllocEx""int"$hProcess[0], "int"0"ULONG_PTR"DllStructGetSize($DLL_Path), "DWORD"0x3000"int"4)
    If @
error Then Return SetError(9""False)

    
DllCall("kernel32.dll""BOOL""WriteProcessMemory""int"$hProcess[0], "DWORD"$lpParameter[0], "str"DllStructGetData($DLL_Path1), "ULONG_PTR"DllStructGetSize($DLL_Path), "int"0)
    If @
error Then Return SetError(10""False)

    
$hThread DllCall($Kernel32"int""CreateRemoteThread""DWORD"$hProcess[0], "int"0"int"0"DWORD"$lpStartAddress[0], "DWORD"$lpParameter[0], "int"0"int"0)
    If @
error Then Return SetError(11""False)

    
DllCall($Kernel32"BOOL""CloseHandle""DWORD"$hProcess[0])
    
DllClose($Kernel32)

    Return 
SetError(0""True)
EndFunc 
KDeluxe is offline  
Thanks
1 User
Old 07/01/2011, 20:59   #4
 
elite*gold: 0
Join Date: Aug 2009
Posts: 962
Received Thanks: 96
Danke hatt geklappt
lautlosertot is offline  
Reply


Similar Threads Similar Threads
[How To]Rang Anzeige Durch lvl Anzeige Ersetzen Server & Client Side!!
03/02/2011 - Metin2 Private Server - 93 Replies
Hallo habe jetzt gard Zeit gefunden und werde euch zum Teil Erklären wie dass mit der lvl Anzeige geht!!! Erstmal Serverside!!!!! Was ihr braucht? Game datei von dem Pfad /usr/rain/channel/share_data/ Notepad oder Hex Editor Ladet sie von eurem Pc und und macht noch ein backup fals es nicht klappt !!!
Item-Shop Lager Button Zum Normalen lager button machen? DE
01/12/2011 - Metin2 - 6 Replies
Moin, seid heute gib es ja im inventar den IS button wo man mit sein lager öffnen kann,könnte man den auch zu einem Normalen lager Button Machen?
Prozess umbennen
09/15/2010 - AutoIt - 8 Replies
kurze und knappe frage ich habe den prozess mit den namen PWO der sollte in z.b test umbennant werden. wie kann ich das mit au3 machen? thx
WarRock statt KOREANISCHE BUTTON --> Englische BUTTON
02/26/2010 - WarRock - 6 Replies
Bin mir nicht sicher ob es diesen Thread schon gibt aber hab bis jetzt nichts gesehen hier. Funktionen Für WarRock Korea Koreanische Schriften (Button) weg und englische Schriften (Button) hin Anleitung



All times are GMT +2. The time now is 14:46.


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.