Esempio n. 1
0
        static SetWindowTextAHook()
        {
            var funcAddr = DetourEngine.GetFunctionAddress("User32.dll", "SetWindowTextA");

            HookedInstance   = HSetWindowTextA;
            OriginalInstance = Marshal.GetDelegateForFunctionPointer <SetWindowstextADelegate>(funcAddr);

            DEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(HookedInstance));
        }
Esempio n. 2
0
        static LoadLibraryAHook()
        {
            var funcAddr = DetourEngine.GetFunctionAddress("Kernel32.dll", "LoadLibraryA");

            HookedInstance   = HLoadLibraryA;
            OriginalInstance = Marshal.GetDelegateForFunctionPointer <LoadLibraryADelegate>(funcAddr);

            DEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(HookedInstance));
        }
Esempio n. 3
0
        internal static void InstallGetModuleHandleHook()
        {
            var funcAddr = HookUtils.GetFunctionAddress("Kernel32.dll", "GetModuleHandleA");

            hookedInstance   = HGetModuleHandle;
            originalInstance = Marshal.GetDelegateForFunctionPointer <GetModuleHandleDelegate>(funcAddr);

            dEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(hookedInstance));
            dEngine.Install();

            Logger.Log("Installed GetModuleHandle hook");
        }
Esempio n. 4
0
        internal static void InstallLoadLibraryHook()
        {
            var funcAddr = HookUtils.GetFunctionAddress("Kernel32.dll", "LoadLibraryA");

            hookedInstance   = HLoadLibrary;
            originalInstance = Marshal.GetDelegateForFunctionPointer <LoadLibraryDelegate>(funcAddr);

            dEngine = new DetourEngine(funcAddr, Marshal.GetFunctionPointerForDelegate(hookedInstance));
            dEngine.Install();

            Logger.Log("Installed LoadLibrary hook");
        }