Esempio n. 1
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. 2
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");
        }