-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Description
Hi this hook fails when injected in Explorer.exe on Windows 8.1 x64. Maybe because of trampoline size?
To test compile and inject in to Explorer.exe using ProcessHacker x64.
library Hook64;
uses
System.SysUtils,
System.Classes,
Winapi.Windows,
DDetours;
type
HINST = NativeUInt;
HMENU = type UINT_PTR;
var
_CreateWindowExW: function(
dwExStyle: DWORD;
lpClassName: LPCWSTR;
lpWindowName: LPCWSTR;
dwStyle: DWORD;
x: Integer;
y: Integer;
nWidth: Integer;
nHeight: Integer;
hWndParent: HWND;
hMenu: HMENU;
hInstance: HINST;
lpParam: LPVOID
): HWND; WINAPI = nil;
function __CreateWindowExW(
dwExStyle: DWORD;
lpClassName: LPCWSTR;
lpWindowName: LPCWSTR;
dwStyle: DWORD;
x: Integer;
y: Integer;
nWidth: Integer;
nHeight: Integer;
hWndParent: HWND;
hMenu: HMENU;
hInstance: HINST;
lpParam: LPVOID
): HWND; WINAPI;
begin
if (lpClassName = 'Worker Window') then
WriteLn('Intercepted!');
Result := _CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
end;
begin
AllocConsole;
@_CreateWindowExW := InterceptCreate(@CreateWindowExW, @__CreateWindowExW);
end.
Metadata
Metadata
Assignees
Labels
No labels