<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RE &#8211; Adwiteeya Agrawal | Home</title>
	<atom:link href="https://adwiteeya.com/tag/re/feed/" rel="self" type="application/rss+xml" />
	<link>https://adwiteeya.com</link>
	<description>Security fanatic. Reverse Engineer and Web App Specialist.</description>
	<lastBuildDate>Fri, 12 Jul 2013 15:42:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.7</generator>
	<item>
		<title>CheckRemoteDebuggerPresent API</title>
		<link>https://adwiteeya.com/checkremotedebuggerpresent-api/</link>
					<comments>https://adwiteeya.com/checkremotedebuggerpresent-api/#comments</comments>
		
		<dc:creator><![CDATA[Adwiteeya Agrawal]]></dc:creator>
		<pubDate>Thu, 11 Jul 2013 18:21:26 +0000</pubDate>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Anti-debugging]]></category>
		<category><![CDATA[RE]]></category>
		<category><![CDATA[summer project]]></category>
		<category><![CDATA[win32 api]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">http://adwiteeya.com/blog/?p=346</guid>

					<description><![CDATA[Hi, I am currently working on anti-debugging techniques which will also be my project for this year in college.Though i know for a fact  most basic anti-debug techniques are  API based techniques, but i am still doing this post because firstly i did not find any working code and whatever non-working code was present was [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hi,</p>
<p>I am currently working on anti-debugging techniques which will also be my project for this year in college.Though i know for a fact  most basic anti-debug techniques are  API based techniques, but i am still doing this post because firstly i did not find any working code and whatever non-working code was present was also implemented locally&#8230; By the way I am really impressed by the work compiled by Tyler Shields in 2009 and he has put up some of the best resources out there!</p>
<p>This post is basically about one of those standard API&#8217;s &gt; CheckRemoteDebuggerPresent function. <span id="more-346"></span>Now there is enough stuff on msdn and other websites that you can find about its implementations and about the working of the function however for some reason they did not work for me! So here is what finally worked. And I have done a remote process example too.</p>
<p><strong>Implementation for process locally </strong></p>
<p><span style="color: #339966;">#ifndef _WIN32_WINNT</span><br />
<span style="color: #339966;">#define _WIN32_WINNT 0x0601</span><br />
<span style="color: #339966;">#endif</span><br />
<span style="color: #339966;">#include&lt;windows.h&gt;</span><br />
<span style="color: #339966;">#include&lt;stdio.h&gt;</span><br />
<span style="color: #339966;">#include&lt;conio.h&gt;</span></p>
<p>int main()<br />
{<br />
BOOL pblsPresent = FALSE;<br />
HANDLE hndle = NULL;</p>
<p>CheckRemoteDebuggerPresent(GetCurrentProcess(),&amp;pblsPresent);<br />
if(pblsPresent){<br />
printf(&#8220;<span style="color: #3366ff;">Being Debugged\n</span>&#8220;);<br />
}<br />
else{<br />
printf(&#8220;<span style="color: #3366ff;">Not being debugged\n</span>&#8220;);<br />
}<br />
getch();<br />
return 0;<br />
}</p>
<p><strong>Implementation For Remote Process (</strong>with PID 2800<strong>)</strong></p>
<p><span style="color: #339966;">#ifndef _WIN32_WINNT</span><br />
<span style="color: #339966;">#define _WIN32_WINNT 0x0601</span><br />
<span style="color: #339966;">#endif</span><br />
<span style="color: #339966;">#include&lt;windows.h&gt;</span><br />
<span style="color: #339966;">#include&lt;stdio.h&gt;</span><br />
<span style="color: #339966;">#include&lt;conio.h&gt;</span></p>
<p>int main()<br />
{<br />
BOOL pblsPresent = FALSE;<br />
HANDLE hndle = NULL;</p>
<p>hndle=OpenProcess(PROCESS_ALL_ACCESS,FALSE,2800);</p>
<p>if(hndle){<br />
printf(&#8220;<span style="color: #3366ff;">Done getting a handle \n</span>&#8220;);<br />
}else {<br />
printf(&#8220;<span style="color: #3366ff;">Invalid PID \n</span>&#8220;);<br />
}<br />
CheckRemoteDebuggerPresent(hndle,&amp;pblsPresent);<br />
if(pblsPresent){<br />
printf(&#8220;<span style="color: #3366ff;">Being Debugged\n</span>&#8220;);<br />
}<br />
else{<br />
printf(&#8220;<span style="color: #3366ff;">Not being debugged\n</span>&#8220;);<br />
}<br />
getch();<br />
return 0;<br />
}</p>
]]></content:encoded>
					
					<wfw:commentRss>https://adwiteeya.com/checkremotedebuggerpresent-api/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
