> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/antidebugging-methods/isintelhardwarebreakpointpresent.md).

# IsIntelHardwareBreakpointPresent

```
BOOL IsIntelHardwareBreakpointPresent(VOID)
{
	BOOL bFlag = FALSE;
	PCONTEXT Context = NULL;

	Context = (PCONTEXT)VirtualAlloc(NULL, sizeof(CONTEXT), MEM_COMMIT, PAGE_READWRITE);
	if (Context == NULL)
		return FALSE;

	ZeroMemory(Context, sizeof(Context));

	Context->ContextFlags = CONTEXT_DEBUG_REGISTERS;

	if (!GetThreadContext(GetCurrentThreadNoForward(), Context))
		goto EXIT_ROUTINE;

	if (Context->Dr0 || Context->Dr1 || Context->Dr2 || Context->Dr3)
		bFlag = TRUE;

EXIT_ROUTINE:

	if (Context)
		VirtualFree(Context, 0, MEM_RELEASE);

	return bFlag;
}
```
