Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Get Base address of process!

$
0
0
Hello :)

I'm new on AutoIt and I would like find the base address of process. I have find in the multiple forum the same script to find this address, il EXACTLY that I search, but it don't work. :/

This is my script and the return is always 0. I don't understand why it don't work, I have make an error? :o

Func GetWoWBaseAddress($PID)
	$HSNAP = DllCall("Kernel32.dll", "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 8, "DWORD", $PID)
	$STMODULE = DllStructCreate("DWORD dwSize;DWORD th32ModuleID;DWORD th32ProcessID;" & "DWORD GlblcntUsage;DWORD ProccntUsage;ptr modBaseAddr;" & "DWORD modBaseSize;HANDLE hModule;WCHAR szModule[256];" & "WCHAR szExePath[260]")
	DllStructSetData($STMODULE, "dwSize", DllStructGetSize($STMODULE))
	$RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32FirstW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))
	IF ($RET[0] = False) Then
		DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])
		Return 0
	Else
		$RET[0] = True
		Do
			If DllStructGetData($STMODULE, "szModule") = "Wow.exe" Then
				DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])
				Return DllStructGetData($STMODULE, "modBaseAddr")
			EndIf
			$RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32NextW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))
		Until $RET[0] = False
	EndIf
EndFunc

$PID = WinGetProcess("World of Warcraft")
$WowBase = GetWoWBaseAddress($PID)
MsgBox(0,"Titre",$WowBase)


Thank in advance :)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>