<?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: [EXERCISE 0010] All are equal?</title>
	<atom:link href="http://www.binary-auditing.com/2009/11/exercise-0010-all-are-equal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.binary-auditing.com/2009/11/exercise-0010-all-are-equal/</link>
	<description>free training modules for people with an attitude!</description>
	<lastBuildDate>Fri, 26 Mar 2010 08:46:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: mazuki</title>
		<link>http://www.binary-auditing.com/2009/11/exercise-0010-all-are-equal/comment-page-1/#comment-373</link>
		<dc:creator>mazuki</dc:creator>
		<pubDate>Sun, 27 Dec 2009 07:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.binary-auditing.com/?p=2035#comment-373</guid>
		<description>they are not equal, but then again, it will only ever go through 1 way (hence the green lines)

if you XOR eax by itself, you will ALWAYS get a 0, never anything different, it&#039;s impossible.

so this will automatically make the zero flag set, which makes the JZ execute

then you get to mov ecx,1 then test ecx,ecx well a test is a lot like a cmp with itself, so if it&#039;s true it will jump, as a test will return 0 if it&#039;s true and set the zero flag

so you will end up with eax being 0 and ecx being 1 regardless of what parameters are pushed it seems</description>
		<content:encoded><![CDATA[<p>they are not equal, but then again, it will only ever go through 1 way (hence the green lines)</p>
<p>if you XOR eax by itself, you will ALWAYS get a 0, never anything different, it&#8217;s impossible.</p>
<p>so this will automatically make the zero flag set, which makes the JZ execute</p>
<p>then you get to mov ecx,1 then test ecx,ecx well a test is a lot like a cmp with itself, so if it&#8217;s true it will jump, as a test will return 0 if it&#8217;s true and set the zero flag</p>
<p>so you will end up with eax being 0 and ecx being 1 regardless of what parameters are pushed it seems</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: algemy</title>
		<link>http://www.binary-auditing.com/2009/11/exercise-0010-all-are-equal/comment-page-1/#comment-332</link>
		<dc:creator>algemy</dc:creator>
		<pubDate>Mon, 23 Nov 2009 18:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.binary-auditing.com/?p=2035#comment-332</guid>
		<description>From my point of view they all are equal. No real data calculation is done, just logic test to determine which way to go before exiting. They all exit the program, no matter which way you go.  

On the first box, a xor (logical exclusive or) is done, if the flag is zero goes to 40100B where an AND is done for ecx, if zero goes to the bottom box which exits the application.  If the flag is not zero, goes to 401014 where another xor is done before exiting the program.

If the flag in the first/main box is not zero, goes to 401007 where a xor is done before exiting the application.</description>
		<content:encoded><![CDATA[<p>From my point of view they all are equal. No real data calculation is done, just logic test to determine which way to go before exiting. They all exit the program, no matter which way you go.  </p>
<p>On the first box, a xor (logical exclusive or) is done, if the flag is zero goes to 40100B where an AND is done for ecx, if zero goes to the bottom box which exits the application.  If the flag is not zero, goes to 401014 where another xor is done before exiting the program.</p>
<p>If the flag in the first/main box is not zero, goes to 401007 where a xor is done before exiting the application.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
