<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How the ESP trick actually works</title>
	<atom:link href="http://korupt.co.uk/?feed=rss2&#038;p=54" rel="self" type="application/rss+xml" />
	<link>http://korupt.co.uk/?p=54</link>
	<description>Disassembling logic at its best...</description>
	<lastBuildDate>Sat, 13 Feb 2010 01:35:26 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: moiciotohiz</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-630</link>
		<dc:creator>moiciotohiz</dc:creator>
		<pubDate>Tue, 07 Jul 2009 01:06:34 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-630</guid>
		<description>Excellent blog! Very interesting themes. I will often read it. Also e-mailed on rss.</description>
		<content:encoded><![CDATA[<p>Excellent blog! Very interesting themes. I will often read it. Also e-mailed on rss.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moiciotohiz</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-623</link>
		<dc:creator>moiciotohiz</dc:creator>
		<pubDate>Mon, 06 Jul 2009 01:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-623</guid>
		<description>Awesome blog! Subscribed on rss. Regular will read it. Good job.</description>
		<content:encoded><![CDATA[<p>Awesome blog! Subscribed on rss. Regular will read it. Good job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Unpacking Themida 2.0.8.0 - The World of Game Hacking</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-579</link>
		<dc:creator>Unpacking Themida 2.0.8.0 - The World of Game Hacking</dc:creator>
		<pubDate>Mon, 29 Jun 2009 05:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-579</guid>
		<description>[...] jmp to OEP is push/ret to OEP after the popad. Once at OEP, dump file and fix imports with ImpRec.  How the ESP trick actually works - KOrUPt  Of course, themida may not use this method in which case my advice would be useless. But a cool [...]</description>
		<content:encoded><![CDATA[<p>[...] jmp to OEP is push/ret to OEP after the popad. Once at OEP, dump file and fix imports with ImpRec.  How the ESP trick actually works &#8211; KOrUPt  Of course, themida may not use this method in which case my advice would be useless. But a cool [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KOrUPt</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-9</link>
		<dc:creator>KOrUPt</dc:creator>
		<pubDate>Mon, 22 Dec 2008 22:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-9</guid>
		<description>Nice to see smart people on board :)... Thanks for the comment Meh(Do you have a handle you care to use?)...

I didn&#039;t want to confuse a potential newbie reading my post so I kept the description perhaps a little too vague. I agree it is inaccurate. Thanks for taking the time to correct me on that one.

Also, I&#039;ve slightly edited your above comment and corrected a few grammatical mistakes, I hope you don&#039;t mind.

KOrUPt.</description>
		<content:encoded><![CDATA[<p>Nice to see smart people on board <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8230; Thanks for the comment Meh(Do you have a handle you care to use?)&#8230;</p>
<p>I didn&#8217;t want to confuse a potential newbie reading my post so I kept the description perhaps a little too vague. I agree it is inaccurate. Thanks for taking the time to correct me on that one.</p>
<p>Also, I&#8217;ve slightly edited your above comment and corrected a few grammatical mistakes, I hope you don&#8217;t mind.</p>
<p>KOrUPt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: meh</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-8</link>
		<dc:creator>meh</dc:creator>
		<pubDate>Mon, 22 Dec 2008 22:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-8</guid>
		<description>Yeah like metr0 noted, that section on software BP isn&#039;t entirely accurate, or at least not very clear.

int3 just triggers an interrupt(the hardware does this) causing an interrupt handler(checks the descriptor at idtr register + 8 * 3, the hardware does this too) to run (it typically notifies the parent process(debugger)), which re-replaces the 0xCC byte with the original value.

If the debugee notices this in any way other than the CC instruction being in memory before the breakpoint triggers there is a bug I guess. The context switching should be transparent to the debugee otherwise packets arriving on the network card or moving the mouse would change the registers too :). The instruction being in memory however could invalidate self CRC checks and such. But UPX has none of that.

But course, here it is indeed the fact that we want to have a data breakpoint. And hence we need to to write the address in one of the dr0-3(that&#039;s why you can only have 4) registers and set some bits in dr7 ;-).

Killboy: yeah learning RE is like &quot;breaking the magicians code&quot;. You always knew that the lady wasn&#039;t really sawed in half but... We all need to go through this at several levels of the software stack ;) So I figured I&#039;d throw in some ring0 stuff in this post to break a bit more of the magic of ollydbg :) No more magic &#039;hardware&#039; breakpoints :-)</description>
		<content:encoded><![CDATA[<p>Yeah like metr0 noted, that section on software BP isn&#8217;t entirely accurate, or at least not very clear.</p>
<p>int3 just triggers an interrupt(the hardware does this) causing an interrupt handler(checks the descriptor at idtr register + 8 * 3, the hardware does this too) to run (it typically notifies the parent process(debugger)), which re-replaces the 0xCC byte with the original value.</p>
<p>If the debugee notices this in any way other than the CC instruction being in memory before the breakpoint triggers there is a bug I guess. The context switching should be transparent to the debugee otherwise packets arriving on the network card or moving the mouse would change the registers too <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The instruction being in memory however could invalidate self CRC checks and such. But UPX has none of that.</p>
<p>But course, here it is indeed the fact that we want to have a data breakpoint. And hence we need to to write the address in one of the dr0-3(that&#8217;s why you can only have 4) registers and set some bits in dr7 <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p>Killboy: yeah learning RE is like &#8220;breaking the magicians code&#8221;. You always knew that the lady wasn&#8217;t really sawed in half but&#8230; We all need to go through this at several levels of the software stack <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  So I figured I&#8217;d throw in some ring0 stuff in this post to break a bit more of the magic of ollydbg <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  No more magic &#8216;hardware&#8217; breakpoints <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KOrUPt</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-6</link>
		<dc:creator>KOrUPt</dc:creator>
		<pubDate>Mon, 22 Dec 2008 22:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-6</guid>
		<description>Thanks for the feedback guys!... It&#039;s nice to read others opinions and get a little discussion flowing every now and then :).

@metr0: Good point, I&#039;ll edit the post accordingly later tonight. Thanks.

KOrUPt.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback guys!&#8230; It&#8217;s nice to read others opinions and get a little discussion flowing every now and then <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>@metr0: Good point, I&#8217;ll edit the post accordingly later tonight. Thanks.</p>
<p>KOrUPt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Killboy</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-5</link>
		<dc:creator>Killboy</dc:creator>
		<pubDate>Mon, 22 Dec 2008 22:07:23 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-5</guid>
		<description>This trick has been explained so many times in various tutorials, the first time I read about it was in ARTeam&#039;s Olly beginners tutorials, lena covers it and it&#039;s the topic of a bunch of threads in every decent RE forum.
Yet explanations don&#039;t stop popping up :D

If you believe the &#039;urban myth&#039;, it&#039;s like the most explained and less understood &#039;trick&#039; out there. Not sure this is true though, I just believe every halfway decent reverser feels like having to explain this trick after he actually understood how it works and loses its &#039;magic&#039;.

No criticism, just reflecting on it as I went through this myself :D</description>
		<content:encoded><![CDATA[<p>This trick has been explained so many times in various tutorials, the first time I read about it was in ARTeam&#8217;s Olly beginners tutorials, lena covers it and it&#8217;s the topic of a bunch of threads in every decent RE forum.<br />
Yet explanations don&#8217;t stop popping up <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>If you believe the &#8216;urban myth&#8217;, it&#8217;s like the most explained and less understood &#8216;trick&#8217; out there. Not sure this is true though, I just believe every halfway decent reverser feels like having to explain this trick after he actually understood how it works and loses its &#8216;magic&#8217;.</p>
<p>No criticism, just reflecting on it as I went through this myself <img src='http://korupt.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: metr0</title>
		<link>http://korupt.co.uk/?p=54&#038;cpage=1#comment-4</link>
		<dc:creator>metr0</dc:creator>
		<pubDate>Mon, 22 Dec 2008 22:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://korupt.co.uk/?p=54#comment-4</guid>
		<description>&quot;You may be wondering why we need a hardware breakpoint as oppose to a software breakpoint, the problem with software breakpoints is that our debugger places an int3 instruction(0xCC byte) at our target address, this will corrupt our registers contents… Which is not what we want.&quot;

You might also want to clearify that a software bp would just trigger on execution, which is not what would help us here (and mem bps using page guard are simply too slow).

Nice to see your blog back in action, mate!</description>
		<content:encoded><![CDATA[<p>&#8220;You may be wondering why we need a hardware breakpoint as oppose to a software breakpoint, the problem with software breakpoints is that our debugger places an int3 instruction(0xCC byte) at our target address, this will corrupt our registers contents… Which is not what we want.&#8221;</p>
<p>You might also want to clearify that a software bp would just trigger on execution, which is not what would help us here (and mem bps using page guard are simply too slow).</p>
<p>Nice to see your blog back in action, mate!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
