Exemplo n.º 1
0
            void IDkmProcessExecutionNotification.OnProcessResume(DkmProcess process, DkmProcessExecutionCounters processCounters)
            {
                var processData = DebugHelpers.GetOrCreateDataItem <NullcRemoteProcessDataItem>(process);

                // Third stage of breakpoint handling - schedule a single step so we will move from the instruction location where debug break instruction must be restored (int 3)
                if (processData.lastHitBreakpointLocation != 0)
                {
                    var singleStepRequest = DkmSingleStepRequest.Create(DebugHelpers.NullcStepperBreakpointSourceId, processData.singleStepThread);

                    singleStepRequest.EnableSingleStep();
                }
            }
Exemplo n.º 2
0
            void IDkmSingleStepCompleteReceived.OnSingleStepCompleteReceived(DkmSingleStepRequest singleStepRequest, DkmEventDescriptorS eventDescriptor)
            {
                var processData = DebugHelpers.GetOrCreateDataItem <NullcRemoteProcessDataItem>(singleStepRequest.Thread.Process);

                // Last stage of breakpoint handling - restore debug break instruction now that we have moved from the breakpoint location
                if (processData.lastHitBreakpointLocation != 0)
                {
                    // Restore breakpoint instruction
                    singleStepRequest.Thread.Process.InvisibleWriteMemory(processData.lastHitBreakpointLocation, new byte[1] {
                        0xcc
                    });

                    processData.lastHitBreakpointLocation = 0;

                    eventDescriptor.Suppress();
                }
            }