示例#1
0
        public ModuleManager(DkmProcess process)
        {
            _process  = process;
            _pyrtInfo = process.GetPythonRuntimeInfo();

            LoadInitialPythonModules();
            LocalComponent.CreateRuntimeDllFunctionBreakpoint(_pyrtInfo.DLLs.Python, "PyCode_New", PythonDllBreakpointHandlers.PyCode_New, enable: true, debugStart: true);
            LocalComponent.CreateRuntimeDllFunctionBreakpoint(_pyrtInfo.DLLs.Python, "PyCode_NewEmpty", PythonDllBreakpointHandlers.PyCode_NewEmpty, enable: true, debugStart: true);
        }
        private void AddStepInGate(StepInGateHandler handler, DkmNativeModuleInstance module, string funcName, bool hasMultipleExitPoints)
        {
            var gate = new StepInGate {
                Handler = handler,
                HasMultipleExitPoints = hasMultipleExitPoints,
                Breakpoint            = LocalComponent.CreateRuntimeDllFunctionBreakpoint(module, funcName,
                                                                                          (thread, frameBase, vframe, retAddr) => handler(thread, frameBase, vframe, useRegisters: thread.Process.Is64Bit()))
            };

            _stepInGates.Add(gate);
        }