Falls ihr die Memory.au3 und die NomadMemory.au3 noch nicht habt, könnt ihr euch die Dateien im Anhang herunterladen. Öffnet einfach die Datei in einem Texteditor und speichert sie im Include Ordner von AutoIt mit Dateiname hier.au3
In diesem Prozess sind 40 DLLs geladen. Deswegen überprüft das Programm, ob mehr oder weniger DLLs geladen sind. Falls durch etwas anderes noch eine DLL geladen wird und die DLL nicht mehr entladen wird bis zur Abfrage, muss man jeweils die 40 erhöhen.
PHP Code:
#include <Memory.au3>
#include <WinAPI.au3>
#include <NomadMemory.au3>
Global $PID = @AutoItPID
Global $hOpen = DllOpen("Kernel32.dll")
SetPrivilege("SeDebugPrivilege", 1)
Global $vMODULEENTRY32 = DllStructCreate("DWORD dwSize; DWORD th32ModuleID; DWORD th32ProcessID; DWORD GlblcntUsage; DWORD ProccntUsage; ptr modBaseAddr; DWORD modBaseSize; HANDLE hModule; CHAR szModule[256]; CHAR szExePath[260];")
DllStructSetData($vMODULEENTRY32, 1, DllStructGetSize($vMODULEENTRY32))
While 1
If UBound(_InjectModulInfo(),1) <> 40 Then
MsgBox(0,"Injektions-Schutz","DLL-Injektion erkannt!")
DllClose($hOpen)
Exit
EndIf
Sleep(100)
WEnd
; #FUNCTION# ====================================================================================================================
; Name...........: _InjectModulInfo
; Description ...: Returns information about every modul in the specified process
; Syntax.........: _InjectModulInfo($PID)
; Parameters ....: $PID - A process identifier
; Return values .: Success - Returns an 2d array with the modules and there information
; Failure - Returns -1 and sets @Error:
; |@error = 1 - Wrong PID
; |@error = 2 - DllOpen failed -> kernel32.dll might not have been found
; Author ........: Deathly Assassin (http://www.*************)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _InjectModulInfo()
Local $hModule, $iCount = 0, $aArray[1][10], $hSnapshot, $i, $vNext
$hSnapshot = DllCall($hOpen, "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 8, "DWORD", $PID)
DllCall($hOpen, "BOOL", "Module32First", "HANDLE", $hSnapshot[0], "ptr", DllStructGetPtr($vMODULEENTRY32))
Do
ReDim $aArray[$iCount + 1][10]
For $i = 1 To 10
$aArray[$iCount][$i - 1] = DllStructGetData($vMODULEENTRY32, $i)
Next
$iCount += 1
$vNext = DllCall($hOpen, "BOOL", "Module32Next", "HANDLE", $hSnapshot[0], "ptr", DllStructGetPtr($vMODULEENTRY32))
Until Not $vNext[0]
Return $aArray
EndFunc ;==>_InjectModulInfo






