static void InstallMultiByteToWideChar() { if (Managed) { return; } dMultiByteToWideChar = new MultiByteToWideCharDelegate(MultiByteToWideCharHook); hMultiByteToWideChar = AutoHookCreator("kernel32.dll", "MultiByteToWideChar", dMultiByteToWideChar); hMultiByteToWideChar.Install(); }
static void InstallCreateWindowExHooks() { if (Managed) { return; } dCreateWindowExA = new CreateWindowExADelegate(CreateWindowEx); dCreateWindowExW = new CreateWindowExWDelegate(CreateWindowEx); hCreateWindowExA = AutoHookCreator("user32.dll", "CreateWindowExA", dCreateWindowExA); hCreateWindowExW = AutoHookCreator("user32.dll", "CreateWindowExW", dCreateWindowExW); hCreateWindowExA.Install(); hCreateWindowExW.Install(); }
static void InstallCreateWindowHooks() { if (Managed) { return; } dCreateWindowA = new CreateWindowADelegate(CreateWindow); dCreateWindowW = new CreateWindowWDelegate(CreateWindow); hCreateWindowA = AutoHookCreator("user32.dll", "CreateWindowA", dCreateWindowA); hCreateWindowW = AutoHookCreator("user32.dll", "CreateWindowW", dCreateWindowW); hCreateWindowA.Install(); hCreateWindowW.Install(); }
static void InstallSendMessageHooks() { if (Managed) { return; } dSendMessageA = new SendMessageADelegate(SendMessageAHook); dSendMessageW = new SendMessageWDelegate(SendMessageWHook); hSendMessageA = AutoHookCreator("user32.dll", "SendMessageA", dSendMessageA); hSendMessageW = AutoHookCreator("user32.dll", "SendMessageW", dSendMessageW); hSendMessageA.Install(); hSendMessageW.Install(); }
static void InstallExtTextOutHooks() { if (Managed) { return; } dExtTextOutA = new ExtTextOutADelegate(hExtTextOut); dExtTextOutW = new ExtTextOutWDelegate(hExtTextOut); hExtTextOutA = AutoHookCreator("gdi32.dll", "ExtTextOutA", dExtTextOutA); hExtTextOutW = AutoHookCreator("gdi32.dll", "ExtTextOutW", dExtTextOutW); hExtTextOutA.Install(); hExtTextOutW.Install(); }
static void InstallGlyphHooks() { if (Managed) { return; } dOutlineA = new GetGlyphOutlineDelegate(hGetGlyphOutlineA); dOutlineW = new GetGlyphOutlineDelegate(hGetGlyphOutlineW); OutlineA = AutoHookCreator("gdi32.dll", "GetGlyphOutlineA", dOutlineA); OutlineW = AutoHookCreator("gdi32.dll", "GetGlyphOutlineW", dOutlineW); OutlineA.Install(); OutlineW.Install(); }
static void InstallSetWindowTextHooks() { if (Managed) { return; } dSetWindowTextA = new SetWindowTextADelegate(SetWindowTextHook); dSetWindowTextW = new SetWindowTextWDelegate(SetWindowTextHook); hSetWindowTextA = AutoHookCreator("user32.dll", "SetWindowTextA", dSetWindowTextA); hSetWindowTextW = AutoHookCreator("user32.dll", "SetWindowTextW", dSetWindowTextW); hSetWindowTextA.Install(); hSetWindowTextW.Install(); }
static void InstallCreateFontHooks() { if (Managed) { return; } dCreateFontA = new CreateFontADelegate(hCreateFont); dCreateFontW = new CreateFontWDelegate(hCreateFont); hCreateFontA = AutoHookCreator("gdi32.dll", "CreateFontA", dCreateFontA); hCreateFontW = AutoHookCreator("gdi32.dll", "CreateFontW", dCreateFontW); hCreateFontA.Install(); hCreateFontW.Install(); }
static bool hSetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags) { if (!SetWindowPosHook.ImportHook) { SetWindowPosHook.Uninstall(); } bool Rst = SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags); if (!SetWindowPosHook.ImportHook) { SetWindowPosHook.Install(); } ShowIntro(hWnd); return(Rst); }
static IntPtr hCreateWindowEx(WindowStylesEx dwExStyle, string lpClassName, string lpWindowName, WindowStyles dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam) { if (!CreateWindowExWHook.ImportHook) { CreateWindowExWHook.Uninstall(); } IntPtr Result = CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); if (!CreateWindowExWHook.ImportHook) { CreateWindowExWHook.Install(); } ShowIntro(Result); return(Result); }
static bool hMoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint) { if (!MoveWindowHook.ImportHook) { MoveWindowHook.Uninstall(); } bool Rst = MoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint); if (!MoveWindowHook.ImportHook) { MoveWindowHook.Install(); } ShowIntro(hWnd); return(Rst); }
static bool hShowWindow(IntPtr hWnd, int nCmdShow) { if (!ShowWindowHook.ImportHook) { ShowWindowHook.Uninstall(); } bool Rst = ShowWindow(hWnd, nCmdShow); if (!ShowWindowHook.ImportHook) { ShowWindowHook.Install(); } if (nCmdShow != SW_HIDE) { ShowIntro(hWnd); } return(Rst); }
static void InstallIntroInjector() { if (ShowWindowHook != null || Managed) { return; } #if !DEBUG CreateWindowExADel = new CreateWindowExADelegate(hCreateWindowEx); CreateWindowExWDel = new CreateWindowExWDelegate(hCreateWindowEx); CreateWindowExAHook = AutoHookCreator("user32.dll", "CreateWindowExA", CreateWindowExADel); CreateWindowExWHook = AutoHookCreator("user32.dll", "CreateWindowExW", CreateWindowExWDel); if (HookCreateWindowEx) { CreateWindowExADel = new CreateWindowExADelegate(hCreateWindowEx); } #endif ShowWindowDel = new ShowWindowDelegate(hShowWindow); ShowWindowHook = AutoHookCreator("user32.dll", "ShowWindow", ShowWindowDel); if (HookShowWindow) { ShowWindowHook.Install(); } SetWindowPosDel = new SetWindowPosDelegate(hSetWindowPos); SetWindowPosHook = AutoHookCreator("user32.dll", "SetWindowPos", SetWindowPosDel); if (HookSetWindowPos) { SetWindowPosHook.Install(); } MoveWindowDel = new MoveWindowDelegate(hMoveWindow); MoveWindowHook = AutoHookCreator("user32.dll", "MoveWindow", MoveWindowDel); if (HookMoveWindow) { MoveWindowHook.Install(); } Log("Intro Injector Initialized...", true); }