Func _GetModuleFileNameEx($_Pid)
DllCall('ntdll', 'LONG', 'RtlAdjustPrivilege', 'ULONG', 0x14, 'BYTE', 1, 'BYTE', 0, 'BYTE*', 0)
$_Hwnd = DllCall("Kernel32.dll", "hwnd", "OpenProcess", "dword", 0x0400 + 0x0010, "int", 0, "dword", $_Pid)
$_Return = DllCall("Psapi.dll", "long", "GetModuleFileNameEx", "hwnd", $_Hwnd[0], "long", 0, "str", 0, "long", 255)
DllCall("Kernel32.dll", "int", "CloseHandle", "hwnd", $_Hwnd[0])
If StringInStr($_Return[3], "\") Then Return $_Return[3]
Return ""
EndFunc ;==>_GetModuleFileNameEx
Func _GetModuleFileNameEx($_Pid)
DllCall('ntdll', 'LONG', 'RtlAdjustPrivilege', 'ULONG', 0x14, 'BYTE', 1, 'BYTE', 0, 'BYTE*', 0)
$_Hwnd = DllCall("Kernel32.dll", "hwnd", "OpenProcess", "dword", 0x0400 + 0x0010, "int", 0, "dword", $_Pid)
$_Return = DllCall("Psapi.dll", "long", "GetModuleFileNameEx", "hwnd", $_Hwnd[0], "long", 0, "str", 0, "long", 255)
DllCall("Kernel32.dll", "int", "CloseHandle", "hwnd", $_Hwnd[0])
If StringInStr($_Return[3], "\") Then Return $_Return[3]
Return ""
EndFunc ;==>_GetModuleFileNameEx |