<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Race Condition</title>
	<atom:link href="http://racecondition.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://racecondition.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 29 Nov 2009 05:40:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='racecondition.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Race Condition</title>
		<link>http://racecondition.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://racecondition.wordpress.com/osd.xml" title="Race Condition" />
	<atom:link rel='hub' href='http://racecondition.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Zero, One, Else</title>
		<link>http://racecondition.wordpress.com/2009/11/29/zero-one-else/</link>
		<comments>http://racecondition.wordpress.com/2009/11/29/zero-one-else/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 05:40:51 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=70</guid>
		<description><![CDATA[Sometimes, there are only three numbers that matter. Stepping from Zero to One is when a componet is being introduced. Stepping from One to Zero is when a component is being elliminated. From these systems engineering processes, the latter is &#8230; <a href="http://racecondition.wordpress.com/2009/11/29/zero-one-else/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=70&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes, there are only three numbers that matter.</p>
<p>Stepping from Zero to One is when a componet is being introduced. Stepping from One to Zero is when a component is being elliminated. From these systems engineering processes, the latter is preferred, but the former is the reality. Still, these two processes are usually well defined, and are driven by functionality.</p>
<p>The Else is the realm of non-functional requirements, the gate through which scalability problems enter the scene. Even if Else is only 4. Tomorrow it may grow to 57.</p>
<p>The Else is where concurency becomes a problem. The Else is where one should decide which way to scale &#8211; up or sideways. The Else is when no one can speak for sure without referring to historical data. The Else is the 2 am call when all is down and nothing works because memory was upgraded, and cache miss ratio is in the sky</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=70&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/11/29/zero-one-else/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Stack traces on Linux/x86</title>
		<link>http://racecondition.wordpress.com/2009/10/16/stack-traces-on-linuxx86/</link>
		<comments>http://racecondition.wordpress.com/2009/10/16/stack-traces-on-linuxx86/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 17:59:48 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=58</guid>
		<description><![CDATA[Rewinding stack from signal handler - it is harder than you could have thought. <a href="http://racecondition.wordpress.com/2009/10/16/stack-traces-on-linuxx86/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=58&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While reading stackoverflow I recalled a little snippet I wrote 4 years ago.</p>
<p>This snippet allows the programmer to get a stack trace in C environment on Linux/x86 whenever a memory access problem happens. x86_64 is not supported yet.</p>
<pre class="brush: cpp;">

/* */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#include &lt;signal.h&gt;

#include &lt;execinfo.h&gt;

#include &lt;unistd.h&gt;

#define __USE_GNU
#include &lt;ucontext.h&gt;

typedef void signal_specific_handler(int signum, siginfo_t *pinfo, void *arg) ;

struct sigaction_pack
{
 struct sigaction         current ;
 struct sigaction         original ;
 signal_specific_handler *pspecific ;
} ;

/* we are instrumenting the first 32 signals. We are NOT instrumenting the real-time signals */
static struct sigaction_pack g_pbs_signal_actions[32] ;
static size_t max_pbs_size = 32 ;

static void* g_a_activation_record_list[64] ;
static size_t max_activation_record_count = 64 ;
static size_t activation_record_count ;

/* This is a global variable set at program start time.  It marks the  highest used stack address.  */
extern void *__libc_stack_end;

/*------------------------------------------------------------------------------
 *
 *   A short refresh on the x86 assembly
 *   -----------------------------------
 *
 *    %eip -&gt; current instruction
 *
 *    %esp -&gt; top of the stack (the used element)
 *
 *   This is the stack layout we see with every stack frame.
 *
 *           +-----------------+
 *   %esp -&gt; | local variable  |
 *           | local variable  |
 *           +-----------------+
 *   %ebp -&gt; | %ebp last frame |-+
 *           |                 | |
 *           | return address  | |
 *           |(old instruction | |
 *           |   pointer )     | |
 *           +-----------------+ |
 *           | parameters 1..  | |
 *      +----| parameters 2... |--+
 *      |    | parameters---   |
 *      |    +-----------------+
 *      |    | local variable  |
 *      |    | local variable  |
 *      |    +-----------------+
 *      + -&gt; | %ebp last frame----....
 *           |                 |
 *           | return address  |
 *           +-----------------+
 *
 *
 */

/**
 * Activation record layout
 * Used to parse stack contents while unwinding the stack.
 */
struct activation_record_layout
{
 struct activation_record_layout * next;
 void *return_address;
};

/**
 * Unwind the stack at any location.
 * This function works like the backtrace function provided by the GNU libc,
 * with the only difference that this function doesn't unwind _current_ stack.
 * Instead, it takes values of the relevant registers (EIP, EBP and ESP) as
 * parameters.
 * Thus, this function is suited for being called from a signal handler.
 */
int
rhyno_backtrace (
   void **activation_frame_array,
   int    max_size,
   void  *eip,
   void  *ebp,
   void  *esp)
{
 /* used to parse the stack */
 struct activation_record_layout *current;

 /* keeps track on visited stack trace */
 int count = 0;

 /* save the EIP into the frames list */
 activation_frame_array[count++] = eip ;

 /* Initialize the frame list with EBP */
 current = (struct activation_record_layout *) ebp;

 while (count &lt; max_size)
 {
 /* If we reach past stack pointer, or end of stack segment,
 * we have problem (possible memory overrun.)
 */
 if ((void *) current &lt; esp || (void *) current &gt; __libc_stack_end)
 break;

 /* Save the return address of frame i into the frame list */
 activation_frame_array[count++] = current-&gt;return_address;

 /* Advance the frame list pointer */
 current = current-&gt;next;
 }

 /* How many frames we had collected */
 return count;
}

void sa_segv_specific_hanlder(int signum, siginfo_t *pinfo, void *arg)
{
 /*
 Example for SEGV...
 */
 printf(&quot;  Segmentation violation: Reason: %d: %s\n&quot;,
 pinfo-&gt;si_code,
 pinfo-&gt;si_code == SEGV_MAPERR ?
 &quot;Address not mapped&quot; : pinfo-&gt;si_code == SEGV_ACCERR ?
 &quot;Invalid permissions&quot; : &quot;?????&quot;) ;
 printf(&quot;    Offending address: %p\n&quot;, pinfo-&gt;si_addr ) ;
}

void sa_bluescreen_handler(int signum, siginfo_t *pinfo, void *arg)
{

 /*
 siginfo_t {
 int      si_signo;  / * Signal number * /
 int      si_errno;  / * An errno value * /
 int      si_code;   / * Signal code * /
 pid_t    si_pid;    / * Sending process ID * /
 uid_t    si_uid;    / * Real user ID of sending process * /
 int      si_status; / * Exit value or signal * /
 clock_t  si_utime;  / * User time consumed * /
 clock_t  si_stime;  / * System time consumed * /
 sigval_t si_value;  / * Signal value * /
 int      si_int;    / * POSIX.1b signal * /
 void *   si_ptr;    / * POSIX.1b signal * /
 void *   si_addr;   / * Memory location which caused fault * /
 int      si_band;   / * Band event * /
 int      si_fd;     / * File descriptor * /
 }
 */
 printf(&quot;Got deadly signal %d, following information (%p) is available:\n&quot;,
 signum,pinfo ) ;

 printf(&quot; Signal %d (code %d, errno %d) send by process %d (uid %d)\n&quot;,
 pinfo-&gt;si_signo,
 pinfo-&gt;si_code,
 pinfo-&gt;si_errno,
 pinfo-&gt;si_pid,
 pinfo-&gt;si_uid ) ;

 /* Call message specific handler.
 For example, the segmentation fault handler will
 print the offending address
 */
 if (g_pbs_signal_actions[signum].pspecific != NULL)
 {
 (*g_pbs_signal_actions[signum].pspecific)(signum,pinfo,arg) ;
 }

 if ( arg == NULL )
 {
 printf(&quot;No register/stack information is available\n&quot;) ;
 }
 else
 {
 printf(&quot;Important CPU Registers:\n&quot; ) ;
 printf(&quot;CS:  %012p DS:  %012p  SS:  %012p \n&quot;,
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_CS],
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_DS],
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_SS]
 ) ;

 printf(&quot;EIP: %012p EBP: %012p  ESP: %012p\n&quot;,
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_EIP],
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_EBP],
 ((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_ESP]
 ) ;

 printf(&quot;\n\nStack Trace:\n&quot;) ;

 /*------------------------------------------------------------------------------
 * Collect activation records in format similar to that of
 * glibc's `backtrace', but use the foreign stack.
 */
 activation_record_count = rhyno_backtrace(
 g_a_activation_record_list,
 max_activation_record_count,
 (void*)(((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_EIP]),
 (void*)(((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_EBP]),
 (void*)(((ucontext_t*)(arg))-&gt;uc_mcontext.gregs[REG_ESP])
 ) ;

 /*------------------------------------------------------------------------------
 * Use internal glibc reporting mechanism to convert
 * activation records to symbolic names (requires -rdynamic linker flag)
 */
 backtrace_symbols_fd(g_a_activation_record_list,activation_record_count,1) ;

 } /* register information */

 /* propagate the signal to the original handler */
 if ( g_pbs_signal_actions[signum].original &amp;&amp;
 (g_pbs_signal_actions[signum].original.sa_sigaction != NULL ))
 {
 printf(&quot;\n\nPropagating the signal %d to the original handler\n&quot;,
 signum) ;
 g_pbs_signal_actions[signum].original.sa_sigaction(signum,pinfo,arg)  ;
 }
 else
 {
 printf(&quot;No original handler is registered for singal %d, continuing\n&quot;,
 signum ) ;
 }
}

int register_signal_handlers()
{
 int signum ;
 int result = -1 ;

 for ( signum = 0 ; signum &lt; max_pbs_size ; ++signum)
 {
 /* zero the signal action */
 memset(&amp;g_pbs_signal_actions[signum].current,0,sizeof (struct sigaction)) ;

 /* register the generic handler */
 g_pbs_signal_actions[signum].current.sa_sigaction = sa_bluescreen_handler ;

 /* turn on the flag that tells the runtime to invoke the extended signal handler,
 see man sigaction for details */
 g_pbs_signal_actions[signum].current.sa_flags |= SA_SIGINFO ;

 /* Register the signal handler, store the original signal handler for propagation */
 result = sigaction(signum,&amp;g_pbs_signal_actions[signum].current,
 &amp;g_pbs_signal_actions[signum].original) ;
 /* Report result */
 printf (&quot;-- Registered signal handler for signal %d, result %d, handler %p original handler %p \n&quot;, signum,result,
 g_pbs_signal_actions[signum].current.sa_sigaction,
 g_pbs_signal_actions[signum].original.sa_sigaction) ;
 }

 g_pbs_signal_actions[SIGSEGV].pspecific = sa_segv_specific_hanlder ;

 return result ;
}

/* Function prototype. Here we will do THINGS */
int malicious_code(int) ;

int
main (int argc, char* argv[], char* envp[])
{
 int sleep_interval = 300 ;
 /* Very important - register the handlers */
 if ( argc &gt; 1 )
 register_signal_handlers() ;

 sleep(sleep_interval) ;
 malicious_code(10) ;

 return 0 ;
}

int malicious_code(int arg)
{
 if ( ! arg )
 {
 int * garbage_pointer = (int*)441231324;
 return *((int*)(garbage_pointer)) ;
 }
 else
 {
 return malicious_code(--arg) ;
 }
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=58&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/10/16/stack-traces-on-linuxx86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Leak Prevention and Birthday Attacks</title>
		<link>http://racecondition.wordpress.com/2009/09/25/data-leak-prevention-and-birthday-attacks/</link>
		<comments>http://racecondition.wordpress.com/2009/09/25/data-leak-prevention-and-birthday-attacks/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 04:39:35 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=54</guid>
		<description><![CDATA[If the potential "extruder" - the person who wants to get the information out from the organization is willing to get away with it - can slightly influence the white lists, he can use the Birthday Attack to mask sensitive bits as legalese, which provide plenty of opportunity for meddling by being inhumanely long and unreadable. Once fingerprint for the sensitive information collide with fingerprint for the legalese, the "extruder" can safely circumvent DLP system. <a href="http://racecondition.wordpress.com/2009/09/25/data-leak-prevention-and-birthday-attacks/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=54&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Data Leak Prevention is set of technologies used to monitor information that is leaving corporate network, and taking actions in case sensitive information &#8220;leaves the building&#8221;. Detection of sensitive information is done usually using pattern matching with checksums (e.g. credit card numbers, which have quite a bit of redundant information for validation), content proximity heuristics (e.g. US social security numbers, which <strong>don&#8217;t </strong>have any redundant information for validation, and without taking content into equation can be recognized as Canadian driver license numbers), digital fingerprints and the combination of the above.</p>
<p>Birthday Attack is a way to meddle with digital signatures to greatly reduce key strength. This attack is based on (and takes its name from) the <a href="http://en.wikipedia.org/wiki/Birthday_problem">Birthday Paradox</a>. It resorts to slightly tweaking (by inserting commas, reordering words and using synonyms) two documents &#8211; one which is considered to be correct, and one which is not &#8211; until both have same digital signature. Once digital signatures collide, one can use the &#8220;good&#8221; document (e.g. request for a day off) to generate digital signature, and then use &#8220;bad&#8221; document (e.g. approval for fund transfer) as legitimate. The Birthday Attack reduces key depth by two, effectively turning 64bit digital signatures int 32bit.</p>
<p>Returning to the DLP problem. Usually, corporations have some sort of legal banners, footers, headers and sidebars, which comprise all kinds of disclaimers, terms, conditions and threats. As these are usually not considered sensitive, good fingerprinting schemas will contain &#8220;black lists&#8221; for &#8220;sensitive&#8221; fingerprints, along with &#8220;white lists&#8221; for insensitive fingerprints.</p>
<p>If the potential &#8220;extruder&#8221; &#8211; the person who wants to get the information out from the organization is willing to get away with it &#8211; can slightly influence the white lists, he can use the Birthday Attack to mask sensitive bits as legalese, which provide plenty of opportunity for meddling by being inhumanely long and unreadable. Once fingerprint for the sensitive information collide with fingerprint for the legalese, the &#8220;extruder&#8221; can safely circumvent DLP system.</p>
<p>The DLP system, in order to prevent this kind of attack, should do at least one of following:</p>
<ul>
<li>Disallow meddling with white lists (keep lawyers on track)</li>
<li>Use hash functions with sufficient key depth, so that keys will be cryptographically resistant to BA. For example, 2^64 is pretty strong key depth; this suggests that  hash function with key depth of 128 will be used.</li>
<li>Combine fingerprints with context information. Seeing one fingerprint from a banner in the middle of neutral text should set some bits on</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=54&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/09/25/data-leak-prevention-and-birthday-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Autonomous Software, circa 1997</title>
		<link>http://racecondition.wordpress.com/2009/09/11/autonomous-software-circa-1997/</link>
		<comments>http://racecondition.wordpress.com/2009/09/11/autonomous-software-circa-1997/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 23:39:54 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=50</guid>
		<description><![CDATA[Take your software, put it in a box, throw it out of window. Sometimes, throwing the software out of the window is not act of frustration. Sometimes, it is just a part of the requirements. In particular, if you put &#8230; <a href="http://racecondition.wordpress.com/2009/09/11/autonomous-software-circa-1997/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=50&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Take your software, put it in a box, throw it out of window.</p>
<p>Sometimes, throwing the software out of the window is not act of frustration. Sometimes, it is just a part of the requirements. In particular, if you put inside the box some tricky hardware, and throw it hard enough, it may reach other planets.</p>
<p>However, one must make sure the software works while being thrown out of window, to reach the final destination.</p>
<p>I am referring, of course, to the Pathfinder project. The <a href="http://research.microsoft.com/en-us/um/people/mbj/mars_pathfinder/authoritative_account.html">Authoritative Account</a> on the <a href="http://research.microsoft.com/en-us/um/people/mbj/mars_pathfinder/Mars_Pathfinder.html">infamous software failure</a> is a must read for software engineers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=50&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/09/11/autonomous-software-circa-1997/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Art of Leadership</title>
		<link>http://racecondition.wordpress.com/2009/09/10/art-of-leadership/</link>
		<comments>http://racecondition.wordpress.com/2009/09/10/art-of-leadership/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 04:59:08 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=48</guid>
		<description><![CDATA[In the Santa Cruz mountains, they would say: &#8220;Ben Zander is full of awesome&#8221;. Ben Zander is famous conductor.  I have to admit, I did not know he also writes books. Not until we went to a book store, where &#8230; <a href="http://racecondition.wordpress.com/2009/09/10/art-of-leadership/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=48&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the Santa Cruz mountains, they would say: &#8220;Ben Zander is full of awesome&#8221;.</p>
<p>Ben Zander is famous conductor.  I have to admit, I did not know he also writes books. Not until we went to a book store, where my wife found  little yellow book, called <a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/Art-Possibility-Transforming-Professional-Personal/dp/0142001104">&#8220;The Art of Possibility&#8221;</a> by Ben and Rosamund Zander.</p>
<p>&#8220;I have to read this. Ben Zander is a great writer&#8221;, she said.</p>
<p>Ben Zander is great conductor. And a great writer. And a great teacher.  The little yellow book has changed the way I tell people what has to be done.</p>
<p>Ben starts by telling, that &#8220;everything&#8221; is &#8220;invented.&#8221; Our perception is subjective, and, in some form, &#8220;invented.&#8221; By changing the perception, we can change our reactions and our actions, this is the preach.</p>
<p>As experienced teacher, Ben sets a homework &#8211; exercises for changing our perception. These are not easy, not at all. These excercizes work, though. Slowly, more and more possibilities unfold.</p>
<p>As <a href="http://www.bikejames.com/strength/the-persuit-of-mastery-in-the-gym-and-on-the-trail/">the rule of 10,000</a> tells us,  it would take 10,000 exercises to master this kind of emotion control. Ben does not leave us at this kind of emotion control, but rather goes on and explains, how a leader can unfold possibilities to these whom he leads.</p>
<p>I really glad my wife gave me this book.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=48&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/09/10/art-of-leadership/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Reflecting on the poor performance on Saturday</title>
		<link>http://racecondition.wordpress.com/2009/06/04/reflecting-on-the-poor-performance-on-saturday/</link>
		<comments>http://racecondition.wordpress.com/2009/06/04/reflecting-on-the-poor-performance-on-saturday/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 20:20:29 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=45</guid>
		<description><![CDATA[The reason behind my poor performance was more mental than physical. I crashed by pushing the envelope too much, which was caused by anxiety, which was caused by lack of confidence. Next race I will stick to the game plan &#8230; <a href="http://racecondition.wordpress.com/2009/06/04/reflecting-on-the-poor-performance-on-saturday/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=45&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The reason behind my poor performance was more mental than physical. I crashed by pushing the envelope too much, which was caused by anxiety, which was caused by lack of confidence.</p>
<p>Next race I will stick to the game plan and will</p>
<p>Dr. Cohn writes in <a href="http://www.racerxvt.com/virtual_trainer/mental_game.html" target="_self">his article on mental abilities for motocross racers</a> about mental tune-up before the race.  He highlights the following points to cover:</p>
<ul>
<li><span style="font-family:Arial;"><strong>confidence</strong></span></li>
<li><span style="font-family:Arial;"><strong>focus</strong></span></li>
<li><span style="font-family:Arial;"><strong>ability to perform </strong><strong><strong>naturally and </strong>instinctively</strong></span></li>
<li><span style="font-family:Arial;"><strong>relax and try less when you want to win badly</strong></span></li>
<li><span style="font-family:Arial;"><strong>handle errors</strong></span></li>
<li><span style="font-family:Arial;"><strong>mental prep</strong></span></li>
</ul>
<p>While these suggestions are more for a motocross racer, I find all of these very important for XC racing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=45&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/06/04/reflecting-on-the-poor-performance-on-saturday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Sour race at CCCX #8</title>
		<link>http://racecondition.wordpress.com/2009/06/01/sour-race-at-cccx-8/</link>
		<comments>http://racecondition.wordpress.com/2009/06/01/sour-race-at-cccx-8/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 02:00:59 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[Racing]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=42</guid>
		<description><![CDATA[5/30, really bad race day. I arrived to the race venue slightly late. After registration I started warmup with a few little sprints on pavement, then moved on to the singletrack. Lots of sand, and really fast course. Standing in &#8230; <a href="http://racecondition.wordpress.com/2009/06/01/sour-race-at-cccx-8/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=42&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>5/30, really bad race day. I arrived to the race venue slightly late. After registration I started warmup with a few little sprints on pavement, then moved on to the singletrack. Lots of sand, and really fast course.</p>
<p>Standing in line before the start, I stretched legs, did a few squats and made sure the bike is in right gear for the fast start.  Juniors started at 9.03, we went off one minute later.</p>
<p>Just before the singletrack I was 4th in position, but I sprinted into 2nd. Then we started gaining speed, passing slow Juniors. The course was flat, I was not working too hard, remembering to pace myself. The first 5 miles the race went rather well. I followed Wade from the team, and this was fun.</p>
<p>Then I overbaked a turn, and fell really hard on my right hip.  After a few minutes of pain and misery, I crawled back to the bike, and started pedalling. I was passed by almost everyone, except for the slowest Juniors. I was actually riding  with left leg only, the right leg refused to act.</p>
<p>At the lap I was asked whether I need a medic. I said &#8220;yes&#8221;, then I thought  and said, &#8220;no, dammit, I am going on for 2 laps.&#8221; Well, maybe thinking was not involved there.</p>
<p>The second was horribly painful, but I sort of passed a few kids and women <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  At the lap gate I decided to go for another lap.</p>
<p>Then my bike decided that I need a rest. The next thing I knew was that I was standing in a side of a trail, trying to pull the chain out of the rear wheel. Somehow the chain has been pushed in between the cassette and the hub flange, twisted ninety degrees and stuck there. After five minutes of trying to pull the chain the old way, I unfastened the chain (yay to PowerLinks) to two parts, pulled as hard as I can while standing on the frame, and bingo &#8211; the chain was free. I fastened the chain into whole (yay again to PowerLinks),  and resumed the race.</p>
<p>The universe was made of pain.</p>
<p>When I was closing to the lap, I heard some people talking behind my back. I was sure these were faster riders that lapped me, so I pulled to the side.</p>
<p>- &#8220;Are you racing? You are so slow&#8230;&#8221; one of those riders asked.</p>
<p>- &#8220;Yes&#8221; I muttered,</p>
<p>- &#8220;Don&#8217;t pay attention to us, go ahead! This is the last climb, it&#8217;s all downhill from here! Relax, and push&#8221; &#8211; the rider cheered me.</p>
<p>Push push push push push, damn.  When I passed the lap gate, I almost fell from the bike.</p>
<p>That was one painful race.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=42&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/06/01/sour-race-at-cccx-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>The Grand Unified Theorem of Reverse Engineering</title>
		<link>http://racecondition.wordpress.com/2009/05/26/the-grand-unified-theorem-of-reverse-engineering/</link>
		<comments>http://racecondition.wordpress.com/2009/05/26/the-grand-unified-theorem-of-reverse-engineering/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:33:17 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=27</guid>
		<description><![CDATA[The Grand Unified Theorem of Software Engineering is not a theorem, actually. It&#8217;s a joke, with a grain of truth in it. It states that &#8220;You can solve every problem with another level of abstraction, except for the problem of &#8230; <a href="http://racecondition.wordpress.com/2009/05/26/the-grand-unified-theorem-of-reverse-engineering/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=27&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <strong>Grand Unified Theorem of Software Engineering</strong> is not a theorem, actually. It&#8217;s a joke, with a grain of truth in it. It states that <em>&#8220;You can solve every problem with another level of abstraction, except for the problem of too many levels of abstraction.&#8221; </em></p>
<p>The <strong>Grand Unified Theorem of Reverse Engineering </strong>is not a theorem either. This joke refers to the above mock theorem, by stating that <em>&#8220;You can find answer to any question by breaking another level of abstraction, except for the problem of having no useable abstraction to start with&#8221;</em></p>
<p>Some would say that the former refers to Math, while the latter refers to Science. Some other would say exactly the opposite.</p>
<p><img class="alignright" title="Half Dome Monolith" src="http://homepage.mac.com/patholleran/ParkVision/Yosemite/Yo-038.jpg" alt="Yosemite Half Dome at sunset" width="358" height="239" /></p>
<p>My daily job includes a fair share of researching implementations of ad-hoc defined network protocols. This process is tedious and sometimes frustrating, yet sometimes it brings its <em>&#8220;Aha!&#8221;</em> moments. Sometimes I like to compare reverse engineering with hiking in the mountains. Lots of striding in even pace, intermixed with moments of excitement. Just like the natural wonders protect themselves from visitors by steep trails and annoying weather, so do software designs hide behind mundane details. Just like in hiking, the excitement of seeing the monolith of architecture, when it reveals itself, ,  </p>
<p>Modern computer architectures make learning protocols both easier and harder. Java, Python or .NET programs have very rich runtime environment, which brings structure and metainformation to start with. On the other hand, &#8220;native&#8221; or &#8220;unmanaged&#8221; code do not have the same structure? or has it? </p>
<p>While working with native code, it&#8217;s very imporatant to undestand the assumptions that were taken when the code was written. Is the code multi-platform? In this case, chances are the software was written in the &#8220;stratified&#8221; way: specifics of different platforms are abstracted out into common APIs. Is the code network specific? In this case, probably it will use Berkeley Sockets API or its equivalent. </p>
<p>Short list of tools I have to use routinely:</p>
<ul>
<li>Wireshark, the protocol analyzer</li>
<li>IDA Pro, the interactive disassembler </li>
<li>dumpbin, which is actually a binary process visualizer</li>
<li>VMWare, which is a great way to set up an environment</li>
</ul>
<p>Some other tools I use infrequently:</p>
<ul>
<li>SCAPY, the interactive network protocol client</li>
<li>OllyDbg, the debugger</li>
</ul>
<p>In general, the process of reversing application consists of trial and error, in understanding the processes and implementation.  This is where VMWare Snapshots become very useful feature. </p>
<p>Ilfak Guilfanov, the author of IDA interactive disassembler, has a blog: <a href="http://www.hexblog.com" target="_self">www.hexblog.com</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=27&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/05/26/the-grand-unified-theorem-of-reverse-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>

		<media:content url="http://homepage.mac.com/patholleran/ParkVision/Yosemite/Yo-038.jpg" medium="image">
			<media:title type="html">Half Dome Monolith</media:title>
		</media:content>
	</item>
		<item>
		<title>Unicode Byte Order Detection</title>
		<link>http://racecondition.wordpress.com/2009/05/13/unicode-byte-order-detection/</link>
		<comments>http://racecondition.wordpress.com/2009/05/13/unicode-byte-order-detection/#comments</comments>
		<pubDate>Wed, 13 May 2009 20:58:19 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[unicode]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=21</guid>
		<description><![CDATA[...Assuming [Unicode byte stream of unknown byte order] represents character stream, there's certain probability that adjacent characters belong to same word. This probability clearly depends on the document: for a math text in English, some words will be in English, some in Greek and some will be special symbols. On the other hand, a biology text in Romanian will include Romanian words intermixed with biology terms in Latin (probably, in italic).
...
We can use this to create fast and universal byte order detector for arbitrary Unicode byte stream <a href="http://racecondition.wordpress.com/2009/05/13/unicode-byte-order-detection/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=21&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Once in a while I run into the following problem: give a stream of bytes, which are know to represent Unicode characters, what is the correct byte order?</p>
<p>Assuming that the Unicode byte stream is valid Unicode stream, we can clearly see that if character C<em>i </em>is in certain byte order, then the next character, C<em>i+1</em> will be in same encoding as well, unless a byte order mark (BOM) specifies the byte order for following bytes.  Moreover, assuming the Unicode byte stream represents character stream, there&#8217;s certain probability that adjacent characters belong to same word.</p>
<p>Same words are usually written in same language, which implies same Unicode code page. In other words: in human text, number of different code pages will be low.</p>
<p>This is important property, which we are going to exploit.</p>
<p>This number of different code pages clearly depends on the document: for a math text in English, some words will be in English, some in Greek and some will be special symbols. On the other hand, a biology text in Romanian will include Romanian words intermixed with biology terms in Latin (probably, in italic).</p>
<p>The location of codepage bytes is governed by the byte order used by the Unicode byte stream. By determining, which bytes are used for codepages, we can detect the byte order. </p>
<p>The algorithm is easy:</p>
<ol>
<li>take a sampling buffer, <strong>_buf  </strong>from the stream. The size of <strong>_buf </strong>should be sufficiently large for detection, but not too large so to slow the algorithm down. 64 bytes sounds like a good guess.</li>
<li>For a first pass: 
<ol>
<li>Allocate 2 hash sets: <strong>LO_BYTE</strong> and <strong>HI_BYTE</strong></li>
<li>Iterate over the <strong>_buf </strong>in 2 byte offset increments (stored in <strong>offset</strong>). Insert <strong>_buf[offset] </strong>to <strong>HI_BYTE </strong>and <strong>_buf[offset+1] </strong>to <strong>LO_BYTE </strong></li>
</ol>
</li>
<li>For a second pass:
<ol>
<li>Allocate 2 hash sets: <strong>LO_NIBBLE </strong>and <strong>HI_NIBBLE</strong></li>
<li>Iterate over the <strong>_buf </strong>in 4 byte offset <strong>offset. </strong>Insert (<strong>_buf[offset]&amp;0xFF)&lt;&lt;8|_buf[offset+1]&amp;0xFF</strong> to <strong>HI_NIBBLE </strong>and <strong>_buf[offset+2]&amp;0xFF)&lt;&lt;8|_buf[offset+3]&amp;0xFF </strong>to <strong>LO_NIBBLE </strong></li>
</ol>
</li>
<li>Chose the hash set <strong>best </strong>with lowest number of different entries <strong>nbest</strong>.
<ol>
<li>if <strong>nbest </strong>&gt; <em>EXPECTED_NUMBER_OF_LANGUAGES </em> probably the encoding is <strong>UTF8</strong></li>
<li>otherwise, if <strong>best </strong>is <strong>LO_BYTE, </strong>the encoding is <strong>UTF-16LE </strong></li>
<li>otherwise, if <strong>best </strong>is <strong>HI_BYTE, </strong>the encoding is <strong>UTF-16BE</strong></li>
<li>otherwise, if <strong>best </strong>is <strong>HI_NIBBLE, </strong>the encoding is <strong>UTF-32BE</strong></li>
<li>otherwise, if <strong>best </strong>is <strong>LO_NIBBLE, </strong>the encoding is <strong>UTF-32LE</strong></li>
<li>otherwise, check your implementation, it probably contains a bug.</li>
</ol>
</li>
</ol>
<p>Of course, if the <strong>BOM </strong>(byte order mark) is present, the whole issue of detecting the encoding becomes moot.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=21&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/05/13/unicode-byte-order-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>
	</item>
		<item>
		<title>Sea Otter Classic</title>
		<link>http://racecondition.wordpress.com/2009/04/24/sea-otter-classic-2/</link>
		<comments>http://racecondition.wordpress.com/2009/04/24/sea-otter-classic-2/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 04:32:48 +0000</pubDate>
		<dc:creator>omershapira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://racecondition.wordpress.com/?p=16</guid>
		<description><![CDATA[This weekend I competed at Sea Otter Classic Cross Country race. I did not have the time to pre-ride the course. This was too bad, because there were lots of sections I held down speed, just becase I was not &#8230; <a href="http://racecondition.wordpress.com/2009/04/24/sea-otter-classic-2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=16&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This weekend I competed at Sea Otter Classic Cross Country race.</p>
<p>I did not have the time to pre-ride the course. This was too bad, because there were lots of sections I held down speed, just becase I was not sure what&#8217;s coming next.   Before the race I did 35 minute warmup, which did wonders to my legs. </p>
<p>The course was sandy, with numerous sections of foot deep sand. <img class="size-medium wp-image-17 alignright" title="48039-164-007f" src="http://racecondition.files.wordpress.com/2009/04/48039-164-007f.jpg?w=199&#038;h=300" alt="48039-164-007f" width="199" height="300" /></p>
<p>We started at the Laguna Seca motor-racing track, where the whole field just accelerated up.  It was great fun just being in a wave of 50 riders, swaying from side to side as the track turned.</p>
<p>I was feeling good on climbs, although was constantly bugged by a mechanical &#8211; my chain kept sliding between the cassette and the spokes. I had to stop 5 times to pull the chain out, losing a few minutes in total. </p>
<p>In the beginning I tried to see how aggressively I can corner, and apparently I can corner with more gusto than technique. After the first crash, I decided to stay within the &#8220;safe&#8221; limits. </p>
<p>Another crash happened on the &#8220;technical descent section&#8221; where I was totally scared by the ruts.</p>
<p>After these two, I rode rather steadily.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/racecondition.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/racecondition.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/racecondition.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=racecondition.wordpress.com&amp;blog=7362374&amp;post=16&amp;subd=racecondition&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://racecondition.wordpress.com/2009/04/24/sea-otter-classic-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69edbed0ae7d496e65981570afdea26a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">omershapira</media:title>
		</media:content>

		<media:content url="http://racecondition.files.wordpress.com/2009/04/48039-164-007f.jpg?w=199" medium="image">
			<media:title type="html">48039-164-007f</media:title>
		</media:content>
	</item>
	</channel>
</rss>
