Debug Registers, Hardware Breakpoints

Created the Friday 13 November 2020. Updated 2 weeks, 4 days ago.

Hardware breakpoints allow a debugger to pause execution at specific memory addresses without modifying the program code. They are stored in special CPU registers (DR0 through DR3 on Intel CPUs).

For anti-debugging, malware can inspect the values of these debug registers. If any of the registers contain a non-empty value, it indicates that a hardware breakpoint has been set by a debugger.

A common way to capture this information is by calling RtlCaptureContext(), which retrieves the current thread’s execution context, including the debug registers. The malware can then check DR0–DR3. If one of them is populated, it signals the presence of an active debugger using hardware breakpoints.


Technique Identifiers

U0127 B0001.005

Technique Tag

DR0


Code Snippets

Detection Rules

Additional Resources

External Links

The resources provided below are associated links that will give you even more detailed information and research on current evasion technique. It is important to note that, while these resources may be helpful, it is important to exercise caution when following external links. As always, be careful when clicking on links from unknown sources, as they may lead to malicious content.


Sleeping Alien

Subscribe to our Newsletter

Don't miss out on the latest and greatest updates from us! Subscribe to our newsletter and be the first to know about exciting content and future updates.