Esempio n. 1
0
        public static DkmRuntimeInstructionBreakpoint CreateRuntimeDllFunctionBreakpoint(DkmNativeModuleInstance moduleInstance, string funcName, RuntimeDllBreakpointHandler handler, bool enable = false, bool debugStart = false)
        {
            var addr = moduleInstance.GetFunctionAddress(funcName, debugStart);

            return(CreateBreakpoint(moduleInstance.Process, addr, handler, enable));
        }
Esempio n. 2
0
        private static DkmRuntimeInstructionBreakpoint CreateBreakpoint(DkmProcess process, ulong addr, RuntimeDllBreakpointHandler handler, bool enable)
        {
            var runtimeBreakpoints = process.GetOrCreateDataItem(() => new RuntimeDllBreakpoints());
            var bp = process.CreateBreakpoint(Guids.LocalComponentGuid, addr);

            if (enable)
            {
                bp.Enable();
            }
            runtimeBreakpoints.Handlers.Add(bp.UniqueId, handler);
            return(bp);
        }