<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>OpenRCE: Blog</title>
        <link>http://www.openrce.org/rss/feeds/blog</link>
        <description>OpenRCE: The Open Reverse Code Engineering Community</description>
                <item>
            <title>Detecting debugger attach</title>
                            <pubDate>Mon, 29 Aug 2005 12:12:56 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/36/Detecting_debugger_attach</link>
                                        <author>jt &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Piotr brought up an interesting issue about userland debuggers in his blog.&lt;br /&gt;
&lt;br /&gt;
This issue is quite complicated because in windows, userland debugger attach is implemented as a thread fired by user-mode APC. This APC starts by calling ntdll!LdrInitializeThunk and then the new threads context is feeded to NtContinue. If the context eip is examined, it can be seen that it points to ntdll!DbgUiRemoteBreakin. This function then finally executes ntdll!DbgBreakPoint. So, in summary: for detecting userland debugger before DbgBreakPoint, hook can be inserted anywhere in the path from KiUserApcDispatcher -&amp;gt; DbgBreakPoint. This clearly returns to normal hook detection problem which is.. interesting.&lt;br /&gt;
</description>
                    </item>
            </channel>
</rss>
