<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-14788166</id><updated>2012-01-03T00:04:11.487+01:00</updated><category term='visualization'/><category term='astronomy'/><category term='tools'/><category term='linguistics'/><category term='vacation'/><category term='idapython'/><category term='pefile'/><category term='security'/><category term='basic blocks'/><category term='programming'/><category term='reverse engineering'/><category term='astrophysics'/><category term='analysis recipes'/><category term='ida2sql'/><category term='travel'/><category term='economics'/><category term='pythonika'/><category term='python'/><category term='BinNavi'/><category term='mathematics'/><category term='code opimization'/><category term='pydot'/><category term='training'/><category term='science'/><category term='bindiff'/><category term='humor'/><title type='text'>Ero Carrera's blog</title><subtitle type='html'>Rantings on whatever I'm tinkering with...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.dkbza.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default?start-index=101&amp;max-results=100'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>111</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14788166.post-2746721275865833963</id><published>2009-07-01T19:37:00.007+02:00</published><updated>2009-07-08T20:26:12.815+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='idapython'/><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='analysis recipes'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Polip and entry point obfuscation</title><content type='html'>A while ago, on a visit to an Anti-Virus lab, we started playing with some Polip samples. One of the analysts mentioned how tedious was in some cases to find the obfuscated entry-point in files infected with Polip.&lt;br /&gt;&lt;br /&gt;We looked into a few samples of the malware, observing how the transfer of control to Polip code happens. As we read through the code, I started seeing some patterns. &lt;br /&gt;In the cases we looked at, Polip always added a new section to the end of the infected executable. Then it chose some call within the original application and modified it to jump to the virus code, later on resuming execution in the original target of the call. Keeping, in that way, the original functionality of the infected application, just with a small detour.&lt;br /&gt;&lt;br /&gt;Needless to say, it would be very tedious to manually find the redirected call(s) within an infected executable, but really easy with some scripting. Using IDAPython and the knowledge about how the jumps to the malicious code look like, we can easily come up with something that will quickly list them for us.&lt;br /&gt;&lt;br /&gt;Let's take a look at the structure of the executable. The code of the standard application will, in most cases, reside in a single segment named &lt;i&gt;CODE&lt;/i&gt;, &lt;i&gt;.text&lt;/i&gt; or something along the lines. The code of the virus will reside in a segment appended to the end of the file.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/SlFP-H9P7DI/AAAAAAAACpI/3rA0XH6HN_E/s1600-h/Pollip+Infected+File.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 254px;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/SlFP-H9P7DI/AAAAAAAACpI/3rA0XH6HN_E/s400/Pollip+Infected+File.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5355149360626658354" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hence, if we could make a simple script that checks every single code reference that crosses segment boundaries, we would be able to list the transfers of control to the virus. Some other references might come up depending on the executable, but with some additional filtering, we will get just a few, with Polip's entry point(s) among them.&lt;br /&gt;&lt;br /&gt;The idea in pseudo-code could look something like the following:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;for each segment in the executable:&lt;br /&gt;&amp;nbsp;&amp;nbsp;for each function if the segment:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for each instruction in the function:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for each code reference from the instruction:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if the reference points to another segment and both source and target segments are marked executable then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print 'Possible obfuscated entry point found'&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And in IDAPython... well, not all that different:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;for segment in idautils.Segments():&lt;br /&gt;&amp;nbsp;&amp;nbsp;for func_start in idautils.Functions(segment, idc.SegEnd(segment)) :        &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for head in Heads(func_start, FindFuncEnd(func_start)):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for ref in list( CodeRefsFrom(head, 0) ):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if SegName(ref) != SegName(func_start) and GetSegmentAttr( ref, SEGATTR_PERM ) &amp; 0x1 and GetSegmentAttr( func_start, SEGATTR_PERM ) &amp; 0x1:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print '%08x: intersegment reference to %08x' % (head, ref)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Polip also finds cavities within the "standard" text section and places chunks of itself there. For those cases this simple idea of looking for inter-segment code references won't yield anything. Fortunately, most of the code lies in the extra section and studying the references from that code is almost trivial to find the chunks that Polip inserted in the cavities... it's just a few more lines of IDAPython left as an exercise for the reader... ;-)&lt;br /&gt;&lt;br /&gt;Just want to remind anyone interested that BlackHat Vegas is coming in a few weeks and &lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram Amini&lt;/a&gt; and I will be teaching &lt;a href="https://www.blackhat.com/html/bh-usa-09/train-bh-usa-09-pa.html"&gt;our training, "Reverse Engineering on Windows: Application in Malicious Code Analysis "&lt;/a&gt; . If you want learn about how to build this kind of automation among other things, we would love to have you in our class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2746721275865833963?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2746721275865833963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2746721275865833963' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2746721275865833963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2746721275865833963'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/07/polip-and-entry-point-obfuscation.html' title='Polip and entry point obfuscation'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/SlFP-H9P7DI/AAAAAAAACpI/3rA0XH6HN_E/s72-c/Pollip+Infected+File.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4719952483107898187</id><published>2009-05-04T19:32:00.004+02:00</published><updated>2012-01-03T00:03:34.233+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Thanks Fravia! Rest In Peace</title><content type='html'>Yesterday, May 3rd, the great &lt;a href="http://fravia.com/index.html"&gt;Fravia&lt;/a&gt; &lt;a href="http://fravia.com/swansong.htm"&gt;passed away&lt;/a&gt;. &lt;br /&gt;He ran his legendary fravia pages and searchlores. A lot of people in the reverse engineering world are (and will be) definitely indebted to him for his teachings. He will definitely will be missed.&lt;br /&gt;&lt;br /&gt;Some friends notes on the sad news &lt;a href="http://sexy.pandas.es/blog/2009/05/04/ciao-maestro/"&gt;here&lt;/a&gt;, &lt;a href="http://blog.48bits.com/?p=342"&gt;here&lt;/a&gt; and &lt;a href="http://www.2113.ch/phplab/mbs.php3/mb001?num=1241367858&amp;amp;thread=1241367858"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4719952483107898187?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4719952483107898187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4719952483107898187' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4719952483107898187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4719952483107898187'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/05/thanks-fravia-rip.html' title='Thanks Fravia! Rest In Peace'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3750137076564516747</id><published>2009-01-23T18:44:00.003+01:00</published><updated>2009-01-23T18:50:52.377+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>More syscall ordinals</title><content type='html'>Daniel Reynaud has improved on the script I &lt;a herf="http://blog.dkbza.org/2008/03/digging-up-system-call-ordinals.html"&gt;described&lt;/a&gt; a while ago and &lt;a href="http://indefinitestudies.org/2009/01/22/digging-up-system-calls-ordinals-on-xp-x64/"&gt;has posted&lt;/a&gt; on &lt;a href="http://indefinitestudies.org/"&gt;his blog&lt;/a&gt; the system call ordinals for Windows XP SP2 x64.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3750137076564516747?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3750137076564516747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3750137076564516747' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3750137076564516747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3750137076564516747'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/01/more-syscall-ordinals.html' title='More syscall ordinals'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2723490943804140660</id><published>2009-01-23T01:58:00.002+01:00</published><updated>2009-01-23T02:06:37.562+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile and LOAD_CONFIG</title><content type='html'>Following a conversation in twitter I've noticed &lt;a href="http://code.google.com/p/pefile/ "&gt;pefile&lt;/a&gt; was lacking support for parsing one data directory in the PE format that is rather interesting, the &lt;a href="http://msdn.microsoft.com/en-us/library/ms680328(VS.85).aspx"&gt;IMAGE_LOAD_CONFIG_DIRECTORY&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've added support for it and fixed a few small bugs and released it as &lt;a href="http://code.google.com/p/pefile/downloads/list"&gt;pefile-1.2.10-60&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now one can access this structure's fields like, for instance, pe.DIRECTORY_ENTRY_LOAD_CONFIG.struct.SecurityCookie or pe.DIRECTORY_ENTRY_LOAD_CONFIG.struct.SEHandlerTable and also modify their values and write the result to a new PE file, all the usual handling &amp; mangling that pefile allows.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2723490943804140660?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2723490943804140660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2723490943804140660' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2723490943804140660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2723490943804140660'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/01/pefile-and-loadconfig.html' title='pefile and LOAD_CONFIG'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2457796022368917555</id><published>2009-01-08T17:39:00.004+01:00</published><updated>2009-01-08T18:02:34.158+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Tips and tricks</title><content type='html'>A couple of interesting things I've found out lately:&lt;br /&gt;&lt;br /&gt;When packaging the latest &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; I noticed the dot-underscore files in the tar.gz.  If one extracts the contents there are no such files to be found (if you're working on OSX) while they will show up in other operating systems. Those dot-underscore files are OSX way of storing the &lt;a href="http://en.wikipedia.org/wiki/Resource_fork"&gt;resource fork&lt;/a&gt; (metainformaion). While it might be handy to keep it around when moving files between Macs, it's not nice to have such dot-underscore files show up in other systems. How to get rid of them is not too well documented. &lt;br /&gt;&lt;br /&gt;There are two oddly named environment variables (they changed between OSX versions) that control the creation of such files. Setting the following envionment variables to 'true' will make &lt;i&gt;tar&lt;/i&gt; not create those dot-underscore files when archiving a file with a resource fork.&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;COPYFILE_DISABLE&lt;br /&gt;COPY_EXTENDED_ATTRIBUTES_DISABLE&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;One can just set them in the python setup.py script, so when the source distribution is created, no resource forks are dumped into those files.&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;import os&lt;br /&gt;os.environ['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'&lt;br /&gt;os.environ['COPYFILE_DISABLE'] = 'true'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;In my case it was &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt; that was using a resource fork to store some metainformation about the Python files I was working with.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now a useful tip for &lt;a href="http://subversion.tigris.org/"&gt;subversion&lt;/a&gt;. I always knew CVS and subversion had to have such feature but never was able to find how to use, I finally tracked it down.&lt;br /&gt;&lt;br /&gt;This might not be knew to anyone that has spent some time with svn... but was to me. The things is, I was sure there had to be a comfortable way of having SVN automatically add the revision number to the source code. That would allow to have version numbers with a revision appended to them automatically, which would make lots of things much nicer, like tracking errors with specific versions.&lt;br /&gt;&lt;br /&gt;To achieve that, one can use &lt;a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html"&gt;subversion keywords&lt;/a&gt;. SVN will replace those keywords with the appropriate information. In this case the cool one is "$LastChangedRevision$", whereever we write it, it will get replaced by "$LastChangedRevision: XXX $" where XXX is the revision number.&lt;br /&gt;&lt;br /&gt;You need to tell subversion you want it to replace that keyword in a given file(s). To do that just issue a: &lt;i&gt;svn propset svn:keywords "Rev" path/to/the/file&lt;/i&gt; to set the property on that file.&lt;br /&gt;&lt;br /&gt;A practical example for Python code would be:&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;__revision__ = "$LastChangedRevision$"&lt;br /&gt;__version__ = '%d' % int( __revision__[21:-2] )&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;The keyword would be replaced as described above and then we can fetch the revision number and add it to the version number transparently. Subversion will handle it cleanly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2457796022368917555?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2457796022368917555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2457796022368917555' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2457796022368917555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2457796022368917555'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/01/tips-and-tricks.html' title='Tips and tricks'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5947201635966828786</id><published>2009-01-07T17:58:00.003+01:00</published><updated>2009-01-07T18:08:42.561+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>Updated pefile</title><content type='html'>I've just released &lt;a href="http://code.google.com/p/pefile/downloads/list"&gt;pefile-1.2.10-56&lt;/a&gt; which besides some new functionality it also fixes bugs for a few extreme cases and incorporates some performance improvements, the biggest of which is the one in the generation of the textual representation of the file. dump_info() is now much faster than it used to be.&lt;br /&gt;This version adds onto the features provided by version 1.2.9 which introduced the ability to test and generate checksums for the PE file among a few other things.&lt;br /&gt; &lt;br /&gt;Please refer to &lt;a href="http://code.google.com/p/pefile/"&gt;pefile's homepage&lt;/a&gt; for a detailed list of the changes.&lt;br /&gt;&lt;br /&gt;Also, to get started with &lt;a href="http://code.google.com/p/pefile"&gt;pefile&lt;/a&gt; it's often useful to take a look at usage examples. There's a &lt;a href="http://code.google.com/p/pefile/wiki/UsageExamples"&gt;wiki page&lt;/a&gt; in the project's page showing a few different recipes on how to go about doing different tasks. Some as simple as, for instance, extracing a DLL's exported symbols...&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;import pefile&lt;br /&gt;pe =  pefile.PE(‘/path/to/pefile.exe’)&lt;br /&gt;&lt;br /&gt;for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print hex(pe.OPTIONAL_HEADER.ImageBase + exp.address), exp.name, exp.ordinal&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;An all the way into more complex examples.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5947201635966828786?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5947201635966828786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5947201635966828786' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5947201635966828786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5947201635966828786'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2009/01/updated-pefile.html' title='Updated pefile'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-7675451166227376539</id><published>2008-10-21T14:29:00.001+02:00</published><updated>2008-10-21T14:31:19.871+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Thoughts on "Using dual-mappings to evade automated unpackers"</title><content type='html'>&lt;a href="http://www.uninformed.org/?v=10"&gt;Uninformed 10&lt;/a&gt; was released recently. On it Skape brings about a simple, yet beautiful and powerful idea. The &lt;a href="http://www.uninformed.org/?v=10&amp;a=1"&gt;paper itself&lt;/a&gt; is short and concise but a quick summary would be along the lines of: some generic unpackers use, either as their main technique or as an heuristic, the tracking of memory writes and whenever the execution flow hits those written areas an  assumption is made that unpacked (or self-modifying code) has been reached. This is an over-simplification because of multi-staged unpackers and other details, but will suffice for the sake of the discussion. Skape basically introduces a technique by which he's able to write into a range of virtual addresses an execute from another range, both pointing to the same real data.&lt;br /&gt;&lt;br /&gt;This is a well supported technique and nothing strange of itself. It is its use what is creative and rather amusing as it breaks the assumption mentioned earlier. Given that no writes are seen in the area of memory that will be executed. The technique relies on the possibility of having several virtual addresses refer the same physical memory. The &lt;a href="http://en.wikipedia.org/wiki/Memory_management_unit"&gt;Memory Management Unit (MMU)&lt;/a&gt; allows pages of virtual memory to map to common physical locations in order to avoid, for instance, the need of having multiple copies of shared components between different processes.&lt;br /&gt;&lt;br /&gt;Some of the tools having trouble with this trick can't really do much about it but other tools he mentions in the paper should have no issue handling it in some way or another.&lt;br /&gt;&lt;br /&gt;I've been working with Bochs for a few years. The technique should be (and is) easily defeatable by tools providing a bird's eye perspective like &lt;a href="http://bochs.sourceforge.net/"&gt;Bochs&lt;/a&gt; or by tools running in kernel mode.&lt;br /&gt;&lt;br /&gt;Analyzing the generally one-to-one mapping of virtual-to-physical memory to find a one-to-many relationship is not all that difficult, and the case where a set of virtually mapped pages receive writes and not much more and another set pointing to the same physical ranges is only (or mostly just) executed should be easy to determine. That'd be a simple heuristic but attempting to defeat it by writing to the execute-only mapping would break down the whole idea...&lt;br /&gt;&lt;br /&gt;It's definitely a beatiful idea but it's easy to detect if you're on the right spot. &lt;br /&gt;&lt;br /&gt;One can take a quick look at it if you have &lt;a href="http://en.wikipedia.org/wiki/WinDbg"&gt;Windbg&lt;/a&gt; lying around. Just connect to your test machine running a test process that implements the code that Skape outlines.&lt;br /&gt;&lt;br /&gt;Do a quick process listing to find it by issuing:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;!process 0 0&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Then, take a look at the &lt;b&gt;Cid&lt;/b&gt; of the process of interest and get its details with:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;!process &amp;lt;Cid&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In that listing the page directory base &lt;b&gt;DirBase&lt;/b&gt; will be given. With that we can tell Windbg to do the mapping of a virtual address using the virtual-to-physical mapping of that process by pasing the directory base to the &lt;b&gt;!vtop&lt;/b&gt; command. In my case the &lt;b&gt;DirBase&lt;/b&gt; of my process was &lt;i&gt;f5a&lt;/i&gt; and I'll instruct Windbg to give me the corresponding physical address to which the virtual addresses 0x419000 and 0x519000 are mapped (those addresses are specific to the example code I wrote implementing skape's idea)&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;lkd&gt; !vtop f5a 0x419000&lt;br /&gt;Pdi 1 Pti 19&lt;br /&gt;00419000 14a79000 pfn(14a79)&lt;br /&gt;lkd&gt; !vtop f5a 0x519000&lt;br /&gt;Pdi 1 Pti 119&lt;br /&gt;00519000 14a79000 pfn(14a79)&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;As you can see both lead to the same physical location &lt;i&gt; 14a79000&lt;/i&gt;. So it's easy to see this from kernel mode by walking the page directory of a process under surveillance. &lt;br /&gt;&lt;br /&gt;If you want to see all physical-virtual mappings the following command provides that:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;!ptov f5a&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I've also implemented detection of this trick in some Python scripts I've developed for my Python-weaponized Bochs environment. &lt;i&gt;On that front. I have an up-to-date patch for Bochs (improved from what I introduced at HitB in Dubai). While I hope to be able to eventually work with the Bochs developers to merge it anyone that wants to give it a shot it welcome to shoot me an email... &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I'll be talking on packers and their techniques on the forthcoming &lt;a href="http://conference.hackinthebox.org/hitbsecconf2008kl/"&gt;Hack in the Box&lt;/a&gt; in Kuala Lumpur. I'll be there next week and later in November at &lt;a href="http://www.powerofcommunity.net/home.html"&gt;Power Of Community&lt;/a&gt; in Korea.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-7675451166227376539?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/7675451166227376539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=7675451166227376539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7675451166227376539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7675451166227376539'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/10/thoughts-on-using-dual-mappings-to.html' title='Thoughts on &quot;Using dual-mappings to evade automated unpackers&quot;'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8249239766746121069</id><published>2008-04-16T15:29:00.002+02:00</published><updated>2008-04-16T15:40:46.294+02:00</updated><title type='text'>Twitter in Dubai</title><content type='html'>This is how it looks...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/SAX_3ip-BmI/AAAAAAAAB2A/LbBY47JWjRA/s1600-h/twitter_dubai.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/SAX_3ip-BmI/AAAAAAAAB2A/LbBY47JWjRA/s400/twitter_dubai.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5189835475275089506" /&gt;&lt;/a&gt;&lt;br /&gt;Funnily enough, it seemed to be reachable through Dubai's airport wifi. Also the iPhone's Twinkle application can get to it, but I guess it's using some API and not accessing the main site.&lt;br /&gt;&lt;br /&gt;I think it's the first time I'm in a country blocking a site like Twitter... I'd have thought other sites such as Myspace would also be blocked but apparently aren't.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8249239766746121069?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8249239766746121069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8249239766746121069' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8249239766746121069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8249239766746121069'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/04/twitter-in-dubai.html' title='Twitter in Dubai'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/SAX_3ip-BmI/AAAAAAAAB2A/LbBY47JWjRA/s72-c/twitter_dubai.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5972187915732331201</id><published>2008-04-05T19:31:00.004+02:00</published><updated>2008-04-08T01:26:56.300+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Running around</title><content type='html'>It's been a few crazy weeks for me. A few weeks ago I finally moved back to the wonderful &lt;a href="http://en.wikipedia.org/wiki/Barcelona"&gt;Barcelona&lt;/a&gt; and trying to get settled in between trips to &lt;a href="http://www.sourceboston.com/"&gt;SOURCE Boston&lt;/a&gt;, &lt;a href="http://www.blackhat.com/html/bh-europe-08/train-bh-eu-08-index.html"&gt;BlackHat Amsterdam&lt;/a&gt; and now &lt;a href="http://www.rsaconference.com/2008/US/home.aspx"&gt;RSA in San Francisco&lt;/a&gt;... and next week is going to be &lt;a href="http://conference.hitb.org/hitbsecconf2008dubai/"&gt;HitB in Dubai&lt;/a&gt; where I'll be showing a new tool I've put together. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sourceboston.com/"&gt;SOURCE Boston&lt;/a&gt; was a really interesting event, impeccably organized and with really great speakers and atmosphere. The technical level of the talks I could see was great, but missed the first day of conference because of tight scheduling. The materials will be coming out &lt;a href="http://www.sourceboston.com/sessions/"&gt;here&lt;/a&gt;. It was the first installment and sure hope will be the first of many, as it was really fun and enjoyable.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.blackhat.com/html/bh-europe-08/train-bh-eu-08-index.html"&gt;BlackHat Amsterdam&lt;/a&gt; I was teaching the training with &lt;a href="http://pedram.openrce.org/blog/"&gt;Pedram Amini&lt;/a&gt;. We got some good feedback and the course should be seeing some good updates in &lt;a href="http://www.blackhat.com/html/bh-usa-08/train-bh-usa-08-index.html"&gt;Las Vegas&lt;/a&gt; later in the summer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5972187915732331201?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5972187915732331201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5972187915732331201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5972187915732331201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5972187915732331201'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/04/running-around.html' title='Running around'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6495079821893274399</id><published>2008-03-06T21:12:00.005+01:00</published><updated>2008-03-07T12:26:19.465+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='idapython'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Digging up system call ordinals</title><content type='html'>Today I was hacking a small tool and I needed a list of all the system call ordinals corresponding to the APIs exported by &lt;i&gt;NTDLL.DLL&lt;/i&gt;. A bit of googling didn't come up with anything too interesting so I wrote a small &lt;a href="http://code.google.com/p/idapython/"&gt;IDAPython&lt;/a&gt; script to harvest them out of a disassembly of &lt;i&gt;NTDLL.DLL&lt;/i&gt;.&lt;br /&gt;The script will simply iterate through every segment and every function and try to find the byte pattern corresponding to the prolog of API functions calling the stub doing the &lt;a href="http://www.nynaeve.net/?p=48"&gt;SYSENTER, SYSCALL or INT 2Eh&lt;/a&gt;.&lt;br /&gt;At least in Windows XP SP2 they will have the form: &lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td style="width: 30%;"&gt;MOV eax, XX&lt;/td&gt;&lt;td&gt;&lt;i&gt;where XX is the syscall ordinal&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MOV edx, 7FFE0300h&lt;/td&gt;&lt;td&gt;&lt;i&gt;the stub doing the transition to kernel mode, the actual code reached depends on the underlying processor&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CALL [edx]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;Those instructions correspond to the byte sequence 'B8 ? 00 00 00 BA 00 03 FE 7F'. I'll just tell &lt;a href="http://code.google.com/p/idapython/"&gt;IDAPython&lt;/a&gt; to look for it at the beginning of each function and, if found, I'll extract the value of the system call ordinal and the name of the function and print a list of them:      &lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;syscall_ordinal_code = 'b8 ? 00 00 00 ba 00 03 fe 7f'&lt;br /&gt;&lt;br /&gt;for seg in Segments():&lt;br /&gt;&amp;nbsp;&amp;nbsp;for func in Functions(seg, SegEnd(seg)):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;address = FindBinary(func, SEARCH_DOWN, syscall_ordinal_code)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if address == func:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print '%08x: Syscall ordinal %04x for %s (%s)' % (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func, Dword(func+1), Name(func), Comment(func))&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;And the outcome of running the script on &lt;a href="http://www.hex-rays.com/idapro/"&gt;IDA&lt;/a&gt; with &lt;i&gt;NTDLL.DLL&lt;/i&gt; looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid black;height:400px;overflow:auto;"&gt;7c90d379: Syscall ordinal 0000 for ZwAcceptConnectPort (NtAcceptConnectPort)&lt;br /&gt;7c90d38e: Syscall ordinal 0001 for ZwAccessCheck (NtAccessCheck)&lt;br /&gt;7c90d3a3: Syscall ordinal 0002 for ZwAccessCheckAndAuditAlarm (NtAccessCheckAndAuditAlarm)&lt;br /&gt;7c90d3b8: Syscall ordinal 0003 for ZwAccessCheckByType (NtAccessCheckByType)&lt;br /&gt;7c90d3cd: Syscall ordinal 0004 for ZwAccessCheckByTypeAndAuditAlarm (NtAccessCheckByTypeAndAuditAlarm)&lt;br /&gt;7c90d3e2: Syscall ordinal 0005 for ZwAccessCheckByTypeResultList (NtAccessCheckByTypeResultList)&lt;br /&gt;7c90d3f7: Syscall ordinal 0006 for ZwAccessCheckByTypeResultListAndAuditAlarm (NtAccessCheckByTypeResultListAndAuditAlarm)&lt;br /&gt;7c90d40c: Syscall ordinal 0007 for ZwAccessCheckByTypeResultListAndAuditAlarmByHandle (NtAccessCheckByTypeResultListAndAuditAlarmByHandle)&lt;br /&gt;7c90d421: Syscall ordinal 0008 for ZwAddAtom (NtAddAtom)&lt;br /&gt;7c90d436: Syscall ordinal 0009 for ZwAddBootEntry (NtAddBootEntry)&lt;br /&gt;7c90d44b: Syscall ordinal 000a for ZwAdjustGroupsToken (NtAdjustGroupsToken)&lt;br /&gt;7c90d460: Syscall ordinal 000b for ZwAdjustPrivilegesToken (NtAdjustPrivilegesToken)&lt;br /&gt;7c90d475: Syscall ordinal 000c for ZwAlertResumeThread (NtAlertResumeThread)&lt;br /&gt;7c90d48a: Syscall ordinal 000d for ZwAlertThread (NtAlertThread)&lt;br /&gt;7c90d49f: Syscall ordinal 000e for ZwAllocateLocallyUniqueId (NtAllocateLocallyUniqueId)&lt;br /&gt;7c90d4b4: Syscall ordinal 000f for ZwAllocateUserPhysicalPages (NtAllocateUserPhysicalPages)&lt;br /&gt;7c90d4c9: Syscall ordinal 0010 for ZwAllocateUuids (NtAllocateUuids)&lt;br /&gt;7c90d4de: Syscall ordinal 0011 for ZwAllocateVirtualMemory (NtAllocateVirtualMemory)&lt;br /&gt;7c90d4f3: Syscall ordinal 0012 for ZwAreMappedFilesTheSame (NtAreMappedFilesTheSame)&lt;br /&gt;7c90d508: Syscall ordinal 0013 for ZwAssignProcessToJobObject (NtAssignProcessToJobObject)&lt;br /&gt;7c90d51d: Syscall ordinal 0014 for ZwCallbackReturn (NtCallbackReturn)&lt;br /&gt;7c90d532: Syscall ordinal 0015 for ZwCancelDeviceWakeupRequest (NtCancelDeviceWakeupRequest)&lt;br /&gt;7c90d547: Syscall ordinal 0016 for ZwCancelIoFile (NtCancelIoFile)&lt;br /&gt;7c90d55c: Syscall ordinal 0017 for ZwCancelTimer (NtCancelTimer)&lt;br /&gt;7c90d571: Syscall ordinal 0018 for ZwClearEvent (NtClearEvent)&lt;br /&gt;7c90d586: Syscall ordinal 0019 for ZwClose (NtClose)&lt;br /&gt;7c90d59b: Syscall ordinal 001a for ZwCloseObjectAuditAlarm (NtCloseObjectAuditAlarm)&lt;br /&gt;7c90d5b0: Syscall ordinal 001b for ZwCompactKeys (NtCompactKeys)&lt;br /&gt;7c90d5c5: Syscall ordinal 001c for ZwCompareTokens (NtCompareTokens)&lt;br /&gt;7c90d5da: Syscall ordinal 001d for ZwCompleteConnectPort (NtCompleteConnectPort)&lt;br /&gt;7c90d5ef: Syscall ordinal 001e for ZwCompressKey (NtCompressKey)&lt;br /&gt;7c90d604: Syscall ordinal 001f for ZwConnectPort (NtConnectPort)&lt;br /&gt;7c90d619: Syscall ordinal 0020 for ZwContinue (NtContinue)&lt;br /&gt;7c90d62e: Syscall ordinal 0021 for ZwCreateDebugObject (NtCreateDebugObject)&lt;br /&gt;7c90d643: Syscall ordinal 0022 for ZwCreateDirectoryObject (NtCreateDirectoryObject)&lt;br /&gt;7c90d658: Syscall ordinal 0023 for ZwCreateEvent (NtCreateEvent)&lt;br /&gt;7c90d66d: Syscall ordinal 0024 for ZwCreateEventPair (NtCreateEventPair)&lt;br /&gt;7c90d682: Syscall ordinal 0025 for ZwCreateFile (NtCreateFile)&lt;br /&gt;7c90d697: Syscall ordinal 0026 for ZwCreateIoCompletion (NtCreateIoCompletion)&lt;br /&gt;7c90d6ac: Syscall ordinal 0027 for ZwCreateJobObject (NtCreateJobObject)&lt;br /&gt;7c90d6c1: Syscall ordinal 0028 for ZwCreateJobSet (NtCreateJobSet)&lt;br /&gt;7c90d6d6: Syscall ordinal 0029 for ZwCreateKey (NtCreateKey)&lt;br /&gt;7c90d6eb: Syscall ordinal 002a for ZwCreateMailslotFile (NtCreateMailslotFile)&lt;br /&gt;7c90d700: Syscall ordinal 002b for ZwCreateMutant (NtCreateMutant)&lt;br /&gt;7c90d715: Syscall ordinal 002c for ZwCreateNamedPipeFile (NtCreateNamedPipeFile)&lt;br /&gt;7c90d72a: Syscall ordinal 002d for ZwCreatePagingFile (NtCreatePagingFile)&lt;br /&gt;7c90d73f: Syscall ordinal 002e for ZwCreatePort (NtCreatePort)&lt;br /&gt;7c90d754: Syscall ordinal 002f for ZwCreateProcess (NtCreateProcess)&lt;br /&gt;7c90d769: Syscall ordinal 0030 for ZwCreateProcessEx (NtCreateProcessEx)&lt;br /&gt;7c90d77e: Syscall ordinal 0031 for ZwCreateProfile (NtCreateProfile)&lt;br /&gt;7c90d793: Syscall ordinal 0032 for ZwCreateSection (NtCreateSection)&lt;br /&gt;7c90d7a8: Syscall ordinal 0033 for ZwCreateSemaphore (NtCreateSemaphore)&lt;br /&gt;7c90d7bd: Syscall ordinal 0034 for ZwCreateSymbolicLinkObject (NtCreateSymbolicLinkObject)&lt;br /&gt;7c90d7d2: Syscall ordinal 0035 for ZwCreateThread (NtCreateThread)&lt;br /&gt;7c90d7e7: Syscall ordinal 0036 for ZwCreateTimer (NtCreateTimer)&lt;br /&gt;7c90d7fc: Syscall ordinal 0037 for ZwCreateToken (NtCreateToken)&lt;br /&gt;7c90d811: Syscall ordinal 0038 for ZwCreateWaitablePort (NtCreateWaitablePort)&lt;br /&gt;7c90d826: Syscall ordinal 0039 for ZwDebugActiveProcess (NtDebugActiveProcess)&lt;br /&gt;7c90d83b: Syscall ordinal 003a for ZwDebugContinue (NtDebugContinue)&lt;br /&gt;7c90d850: Syscall ordinal 003b for ZwDelayExecution (NtDelayExecution)&lt;br /&gt;7c90d865: Syscall ordinal 003c for ZwDeleteAtom (NtDeleteAtom)&lt;br /&gt;7c90d87a: Syscall ordinal 003d for ZwDeleteBootEntry (NtDeleteBootEntry)&lt;br /&gt;7c90d88f: Syscall ordinal 003e for ZwDeleteFile (NtDeleteFile)&lt;br /&gt;7c90d8a4: Syscall ordinal 003f for ZwDeleteKey (NtDeleteKey)&lt;br /&gt;7c90d8b9: Syscall ordinal 0040 for ZwDeleteObjectAuditAlarm (NtDeleteObjectAuditAlarm)&lt;br /&gt;7c90d8ce: Syscall ordinal 0041 for ZwDeleteValueKey (NtDeleteValueKey)&lt;br /&gt;7c90d8e3: Syscall ordinal 0042 for ZwDeviceIoControlFile (NtDeviceIoControlFile)&lt;br /&gt;7c90d8f8: Syscall ordinal 0043 for ZwDisplayString (NtDisplayString)&lt;br /&gt;7c90d90d: Syscall ordinal 0044 for ZwDuplicateObject (NtDuplicateObject)&lt;br /&gt;7c90d922: Syscall ordinal 0045 for ZwDuplicateToken (NtDuplicateToken)&lt;br /&gt;7c90d937: Syscall ordinal 0046 for ZwEnumerateBootEntries (NtEnumerateBootEntries)&lt;br /&gt;7c90d94c: Syscall ordinal 0047 for ZwEnumerateKey (NtEnumerateKey)&lt;br /&gt;7c90d961: Syscall ordinal 0048 for ZwEnumerateSystemEnvironmentValuesEx (NtEnumerateSystemEnvironmentValuesEx)&lt;br /&gt;7c90d976: Syscall ordinal 0049 for ZwEnumerateValueKey (NtEnumerateValueKey)&lt;br /&gt;7c90d98b: Syscall ordinal 004a for ZwExtendSection (NtExtendSection)&lt;br /&gt;7c90d9a0: Syscall ordinal 004b for ZwFilterToken (NtFilterToken)&lt;br /&gt;7c90d9b5: Syscall ordinal 004c for ZwFindAtom (NtFindAtom)&lt;br /&gt;7c90d9ca: Syscall ordinal 004d for ZwFlushBuffersFile (NtFlushBuffersFile)&lt;br /&gt;7c90d9df: Syscall ordinal 004e for ZwFlushInstructionCache (NtFlushInstructionCache)&lt;br /&gt;7c90d9f4: Syscall ordinal 004f for ZwFlushKey (NtFlushKey)&lt;br /&gt;7c90da09: Syscall ordinal 0050 for ZwFlushVirtualMemory (NtFlushVirtualMemory)&lt;br /&gt;7c90da1e: Syscall ordinal 0051 for ZwFlushWriteBuffer (NtFlushWriteBuffer)&lt;br /&gt;7c90da33: Syscall ordinal 0052 for ZwFreeUserPhysicalPages (NtFreeUserPhysicalPages)&lt;br /&gt;7c90da48: Syscall ordinal 0053 for ZwFreeVirtualMemory (NtFreeVirtualMemory)&lt;br /&gt;7c90da5d: Syscall ordinal 0054 for ZwFsControlFile (NtFsControlFile)&lt;br /&gt;7c90da72: Syscall ordinal 0055 for ZwGetContextThread (NtGetContextThread)&lt;br /&gt;7c90da87: Syscall ordinal 0056 for ZwGetDevicePowerState (NtGetDevicePowerState)&lt;br /&gt;7c90da9c: Syscall ordinal 0057 for ZwGetPlugPlayEvent (NtGetPlugPlayEvent)&lt;br /&gt;7c90dab1: Syscall ordinal 0058 for ZwGetWriteWatch (NtGetWriteWatch)&lt;br /&gt;7c90dac6: Syscall ordinal 0059 for ZwImpersonateAnonymousToken (NtImpersonateAnonymousToken)&lt;br /&gt;7c90dadb: Syscall ordinal 005a for ZwImpersonateClientOfPort (NtImpersonateClientOfPort)&lt;br /&gt;7c90daf0: Syscall ordinal 005b for ZwImpersonateThread (NtImpersonateThread)&lt;br /&gt;7c90db05: Syscall ordinal 005c for ZwInitializeRegistry (NtInitializeRegistry)&lt;br /&gt;7c90db1a: Syscall ordinal 005d for ZwInitiatePowerAction (NtInitiatePowerAction)&lt;br /&gt;7c90db2f: Syscall ordinal 005e for ZwIsProcessInJob (NtIsProcessInJob)&lt;br /&gt;7c90db44: Syscall ordinal 005f for ZwIsSystemResumeAutomatic (NtIsSystemResumeAutomatic)&lt;br /&gt;7c90db59: Syscall ordinal 0060 for ZwListenPort (NtListenPort)&lt;br /&gt;7c90db6e: Syscall ordinal 0061 for ZwLoadDriver (NtLoadDriver)&lt;br /&gt;7c90db83: Syscall ordinal 0062 for ZwLoadKey (NtLoadKey)&lt;br /&gt;7c90db98: Syscall ordinal 0063 for ZwLoadKey2 (NtLoadKey2)&lt;br /&gt;7c90dbad: Syscall ordinal 0064 for ZwLockFile (NtLockFile)&lt;br /&gt;7c90dbc2: Syscall ordinal 0065 for ZwLockProductActivationKeys (NtLockProductActivationKeys)&lt;br /&gt;7c90dbd7: Syscall ordinal 0066 for ZwLockRegistryKey (NtLockRegistryKey)&lt;br /&gt;7c90dbec: Syscall ordinal 0067 for ZwLockVirtualMemory (NtLockVirtualMemory)&lt;br /&gt;7c90dc01: Syscall ordinal 0068 for ZwMakePermanentObject (NtMakePermanentObject)&lt;br /&gt;7c90dc16: Syscall ordinal 0069 for ZwMakeTemporaryObject (NtMakeTemporaryObject)&lt;br /&gt;7c90dc2b: Syscall ordinal 006a for ZwMapUserPhysicalPages (NtMapUserPhysicalPages)&lt;br /&gt;7c90dc40: Syscall ordinal 006b for ZwMapUserPhysicalPagesScatter (NtMapUserPhysicalPagesScatter)&lt;br /&gt;7c90dc55: Syscall ordinal 006c for ZwMapViewOfSection (NtMapViewOfSection)&lt;br /&gt;7c90dc6a: Syscall ordinal 006d for ZwModifyBootEntry (NtModifyBootEntry)&lt;br /&gt;7c90dc7f: Syscall ordinal 006e for ZwNotifyChangeDirectoryFile (NtNotifyChangeDirectoryFile)&lt;br /&gt;7c90dc94: Syscall ordinal 006f for ZwNotifyChangeKey (NtNotifyChangeKey)&lt;br /&gt;7c90dca9: Syscall ordinal 0070 for ZwNotifyChangeMultipleKeys (NtNotifyChangeMultipleKeys)&lt;br /&gt;7c90dcbe: Syscall ordinal 0071 for ZwOpenDirectoryObject (NtOpenDirectoryObject)&lt;br /&gt;7c90dcd3: Syscall ordinal 0072 for ZwOpenEvent (NtOpenEvent)&lt;br /&gt;7c90dce8: Syscall ordinal 0073 for ZwOpenEventPair (NtOpenEventPair)&lt;br /&gt;7c90dcfd: Syscall ordinal 0074 for ZwOpenFile (NtOpenFile)&lt;br /&gt;7c90dd12: Syscall ordinal 0075 for ZwOpenIoCompletion (NtOpenIoCompletion)&lt;br /&gt;7c90dd27: Syscall ordinal 0076 for ZwOpenJobObject (NtOpenJobObject)&lt;br /&gt;7c90dd3c: Syscall ordinal 0077 for ZwOpenKey (NtOpenKey)&lt;br /&gt;7c90dd51: Syscall ordinal 0078 for ZwOpenMutant (NtOpenMutant)&lt;br /&gt;7c90dd66: Syscall ordinal 0079 for ZwOpenObjectAuditAlarm (NtOpenObjectAuditAlarm)&lt;br /&gt;7c90dd7b: Syscall ordinal 007a for ZwOpenProcess (NtOpenProcess)&lt;br /&gt;7c90dd90: Syscall ordinal 007b for ZwOpenProcessToken (NtOpenProcessToken)&lt;br /&gt;7c90dda5: Syscall ordinal 007c for ZwOpenProcessTokenEx (NtOpenProcessTokenEx)&lt;br /&gt;7c90ddba: Syscall ordinal 007d for ZwOpenSection (NtOpenSection)&lt;br /&gt;7c90ddcf: Syscall ordinal 007e for ZwOpenSemaphore (NtOpenSemaphore)&lt;br /&gt;7c90dde4: Syscall ordinal 007f for ZwOpenSymbolicLinkObject (NtOpenSymbolicLinkObject)&lt;br /&gt;7c90ddf9: Syscall ordinal 0080 for ZwOpenThread (NtOpenThread)&lt;br /&gt;7c90de0e: Syscall ordinal 0081 for ZwOpenThreadToken (NtOpenThreadToken)&lt;br /&gt;7c90de23: Syscall ordinal 0082 for ZwOpenThreadTokenEx (NtOpenThreadTokenEx)&lt;br /&gt;7c90de38: Syscall ordinal 0083 for ZwOpenTimer (NtOpenTimer)&lt;br /&gt;7c90de4d: Syscall ordinal 0084 for ZwPlugPlayControl (NtPlugPlayControl)&lt;br /&gt;7c90de62: Syscall ordinal 0085 for ZwPowerInformation (NtPowerInformation)&lt;br /&gt;7c90de77: Syscall ordinal 0086 for ZwPrivilegeCheck (NtPrivilegeCheck)&lt;br /&gt;7c90de8c: Syscall ordinal 0087 for ZwPrivilegeObjectAuditAlarm (NtPrivilegeObjectAuditAlarm)&lt;br /&gt;7c90dea1: Syscall ordinal 0088 for ZwPrivilegedServiceAuditAlarm (NtPrivilegedServiceAuditAlarm)&lt;br /&gt;7c90deb6: Syscall ordinal 0089 for ZwProtectVirtualMemory (NtProtectVirtualMemory)&lt;br /&gt;7c90decb: Syscall ordinal 008a for ZwPulseEvent (NtPulseEvent)&lt;br /&gt;7c90dee0: Syscall ordinal 008b for ZwQueryAttributesFile (NtQueryAttributesFile)&lt;br /&gt;7c90def5: Syscall ordinal 008c for ZwQueryBootEntryOrder (NtQueryBootEntryOrder)&lt;br /&gt;7c90df0a: Syscall ordinal 008d for ZwQueryBootOptions (NtQueryBootOptions)&lt;br /&gt;7c90df1f: Syscall ordinal 008e for ZwQueryDebugFilterState (NtQueryDebugFilterState)&lt;br /&gt;7c90df34: Syscall ordinal 008f for ZwQueryDefaultLocale (NtQueryDefaultLocale)&lt;br /&gt;7c90df49: Syscall ordinal 0090 for ZwQueryDefaultUILanguage (NtQueryDefaultUILanguage)&lt;br /&gt;7c90df5e: Syscall ordinal 0091 for ZwQueryDirectoryFile (NtQueryDirectoryFile)&lt;br /&gt;7c90df73: Syscall ordinal 0092 for ZwQueryDirectoryObject (NtQueryDirectoryObject)&lt;br /&gt;7c90df88: Syscall ordinal 0093 for ZwQueryEaFile (NtQueryEaFile)&lt;br /&gt;7c90df9d: Syscall ordinal 0094 for ZwQueryEvent (NtQueryEvent)&lt;br /&gt;7c90dfb2: Syscall ordinal 0095 for ZwQueryFullAttributesFile (NtQueryFullAttributesFile)&lt;br /&gt;7c90dfc7: Syscall ordinal 0096 for ZwQueryInformationAtom (NtQueryInformationAtom)&lt;br /&gt;7c90dfdc: Syscall ordinal 0097 for ZwQueryInformationFile (NtQueryInformationFile)&lt;br /&gt;7c90dff1: Syscall ordinal 0098 for ZwQueryInformationJobObject (NtQueryInformationJobObject)&lt;br /&gt;7c90e006: Syscall ordinal 0099 for ZwQueryInformationPort (NtQueryInformationPort)&lt;br /&gt;7c90e01b: Syscall ordinal 009a for ZwQueryInformationProcess (NtQueryInformationProcess)&lt;br /&gt;7c90e030: Syscall ordinal 009b for ZwQueryInformationThread (NtQueryInformationThread)&lt;br /&gt;7c90e045: Syscall ordinal 009c for ZwQueryInformationToken (NtQueryInformationToken)&lt;br /&gt;7c90e05a: Syscall ordinal 009d for ZwQueryInstallUILanguage (NtQueryInstallUILanguage)&lt;br /&gt;7c90e06f: Syscall ordinal 009e for ZwQueryIntervalProfile (NtQueryIntervalProfile)&lt;br /&gt;7c90e084: Syscall ordinal 009f for ZwQueryIoCompletion (NtQueryIoCompletion)&lt;br /&gt;7c90e099: Syscall ordinal 00a0 for ZwQueryKey (NtQueryKey)&lt;br /&gt;7c90e0ae: Syscall ordinal 00a1 for ZwQueryMultipleValueKey (NtQueryMultipleValueKey)&lt;br /&gt;7c90e0c3: Syscall ordinal 00a2 for ZwQueryMutant (NtQueryMutant)&lt;br /&gt;7c90e0d8: Syscall ordinal 00a3 for ZwQueryObject (NtQueryObject)&lt;br /&gt;7c90e0ed: Syscall ordinal 00a4 for ZwQueryOpenSubKeys (NtQueryOpenSubKeys)&lt;br /&gt;7c90e102: Syscall ordinal 00a5 for ZwQueryPerformanceCounter (NtQueryPerformanceCounter)&lt;br /&gt;7c90e117: Syscall ordinal 00a6 for ZwQueryQuotaInformationFile (NtQueryQuotaInformationFile)&lt;br /&gt;7c90e12c: Syscall ordinal 00a7 for ZwQuerySection (NtQuerySection)&lt;br /&gt;7c90e141: Syscall ordinal 00a8 for ZwQuerySecurityObject (NtQuerySecurityObject)&lt;br /&gt;7c90e156: Syscall ordinal 00a9 for ZwQuerySemaphore (NtQuerySemaphore)&lt;br /&gt;7c90e16b: Syscall ordinal 00aa for ZwQuerySymbolicLinkObject (NtQuerySymbolicLinkObject)&lt;br /&gt;7c90e180: Syscall ordinal 00ab for ZwQuerySystemEnvironmentValue (NtQuerySystemEnvironmentValue)&lt;br /&gt;7c90e195: Syscall ordinal 00ac for ZwQuerySystemEnvironmentValueEx (NtQuerySystemEnvironmentValueEx)&lt;br /&gt;7c90e1aa: Syscall ordinal 00ad for ZwQuerySystemInformation (NtQuerySystemInformation&lt;br /&gt;RtlGetNativeSystemInformation)&lt;br /&gt;7c90e1bf: Syscall ordinal 00ae for ZwQuerySystemTime (NtQuerySystemTime)&lt;br /&gt;7c90e1d4: Syscall ordinal 00af for ZwQueryTimer (NtQueryTimer)&lt;br /&gt;7c90e1e9: Syscall ordinal 00b0 for ZwQueryTimerResolution (NtQueryTimerResolution)&lt;br /&gt;7c90e1fe: Syscall ordinal 00b1 for ZwQueryValueKey (NtQueryValueKey)&lt;br /&gt;7c90e213: Syscall ordinal 00b2 for ZwQueryVirtualMemory (NtQueryVirtualMemory)&lt;br /&gt;7c90e228: Syscall ordinal 00b3 for ZwQueryVolumeInformationFile (NtQueryVolumeInformationFile)&lt;br /&gt;7c90e23d: Syscall ordinal 00b4 for ZwQueueApcThread (NtQueueApcThread)&lt;br /&gt;7c90e252: Syscall ordinal 00b5 for ZwRaiseException (NtRaiseException)&lt;br /&gt;7c90e267: Syscall ordinal 00b6 for ZwRaiseHardError (NtRaiseHardError)&lt;br /&gt;7c90e27c: Syscall ordinal 00b7 for ZwReadFile (NtReadFile)&lt;br /&gt;7c90e291: Syscall ordinal 00b8 for ZwReadFileScatter (NtReadFileScatter)&lt;br /&gt;7c90e2a6: Syscall ordinal 00b9 for ZwReadRequestData (NtReadRequestData)&lt;br /&gt;7c90e2bb: Syscall ordinal 00ba for ZwReadVirtualMemory (NtReadVirtualMemory)&lt;br /&gt;7c90e2d0: Syscall ordinal 00bb for ZwRegisterThreadTerminatePort (NtRegisterThreadTerminatePort)&lt;br /&gt;7c90e2e5: Syscall ordinal 00bc for ZwReleaseMutant (NtReleaseMutant)&lt;br /&gt;7c90e2fa: Syscall ordinal 00bd for ZwReleaseSemaphore (NtReleaseSemaphore)&lt;br /&gt;7c90e30f: Syscall ordinal 00be for ZwRemoveIoCompletion (NtRemoveIoCompletion)&lt;br /&gt;7c90e324: Syscall ordinal 00bf for ZwRemoveProcessDebug (NtRemoveProcessDebug)&lt;br /&gt;7c90e339: Syscall ordinal 00c0 for ZwRenameKey (NtRenameKey)&lt;br /&gt;7c90e34e: Syscall ordinal 00c1 for ZwReplaceKey (NtReplaceKey)&lt;br /&gt;7c90e363: Syscall ordinal 00c2 for ZwReplyPort (NtReplyPort)&lt;br /&gt;7c90e378: Syscall ordinal 00c3 for ZwReplyWaitReceivePort (NtReplyWaitReceivePort)&lt;br /&gt;7c90e38d: Syscall ordinal 00c4 for ZwReplyWaitReceivePortEx (NtReplyWaitReceivePortEx)&lt;br /&gt;7c90e3a2: Syscall ordinal 00c5 for ZwReplyWaitReplyPort (NtReplyWaitReplyPort)&lt;br /&gt;7c90e3b7: Syscall ordinal 00c6 for ZwRequestDeviceWakeup (NtRequestDeviceWakeup)&lt;br /&gt;7c90e3cc: Syscall ordinal 00c7 for ZwRequestPort (NtRequestPort)&lt;br /&gt;7c90e3e1: Syscall ordinal 00c8 for ZwRequestWaitReplyPort (NtRequestWaitReplyPort)&lt;br /&gt;7c90e3f6: Syscall ordinal 00c9 for ZwRequestWakeupLatency (NtRequestWakeupLatency)&lt;br /&gt;7c90e40b: Syscall ordinal 00ca for ZwResetEvent (NtResetEvent)&lt;br /&gt;7c90e420: Syscall ordinal 00cb for ZwResetWriteWatch (NtResetWriteWatch)&lt;br /&gt;7c90e435: Syscall ordinal 00cc for ZwRestoreKey (NtRestoreKey)&lt;br /&gt;7c90e44a: Syscall ordinal 00cd for ZwResumeProcess (NtResumeProcess)&lt;br /&gt;7c90e45f: Syscall ordinal 00ce for ZwResumeThread (NtResumeThread)&lt;br /&gt;7c90e474: Syscall ordinal 00cf for ZwSaveKey (NtSaveKey)&lt;br /&gt;7c90e489: Syscall ordinal 00d0 for ZwSaveKeyEx (NtSaveKeyEx)&lt;br /&gt;7c90e49e: Syscall ordinal 00d1 for ZwSaveMergedKeys (NtSaveMergedKeys)&lt;br /&gt;7c90e4b3: Syscall ordinal 00d2 for ZwSecureConnectPort (NtSecureConnectPort)&lt;br /&gt;7c90e4c8: Syscall ordinal 00d3 for ZwSetBootEntryOrder (NtSetBootEntryOrder)&lt;br /&gt;7c90e4dd: Syscall ordinal 00d4 for ZwSetBootOptions (NtSetBootOptions)&lt;br /&gt;7c90e4f2: Syscall ordinal 00d5 for ZwSetContextThread (NtSetContextThread)&lt;br /&gt;7c90e507: Syscall ordinal 00d6 for ZwSetDebugFilterState (NtSetDebugFilterState)&lt;br /&gt;7c90e51c: Syscall ordinal 00d7 for ZwSetDefaultHardErrorPort (NtSetDefaultHardErrorPort)&lt;br /&gt;7c90e531: Syscall ordinal 00d8 for ZwSetDefaultLocale (NtSetDefaultLocale)&lt;br /&gt;7c90e546: Syscall ordinal 00d9 for ZwSetDefaultUILanguage (NtSetDefaultUILanguage)&lt;br /&gt;7c90e55b: Syscall ordinal 00da for ZwSetEaFile (NtSetEaFile)&lt;br /&gt;7c90e570: Syscall ordinal 00db for ZwSetEvent (NtSetEvent)&lt;br /&gt;7c90e585: Syscall ordinal 00dc for ZwSetEventBoostPriority (NtSetEventBoostPriority)&lt;br /&gt;7c90e59a: Syscall ordinal 00dd for ZwSetHighEventPair (NtSetHighEventPair)&lt;br /&gt;7c90e5af: Syscall ordinal 00de for ZwSetHighWaitLowEventPair (NtSetHighWaitLowEventPair)&lt;br /&gt;7c90e5c4: Syscall ordinal 00df for ZwSetInformationDebugObject (NtSetInformationDebugObject)&lt;br /&gt;7c90e5d9: Syscall ordinal 00e0 for ZwSetInformationFile (NtSetInformationFile)&lt;br /&gt;7c90e5ee: Syscall ordinal 00e1 for ZwSetInformationJobObject (NtSetInformationJobObject)&lt;br /&gt;7c90e603: Syscall ordinal 00e2 for ZwSetInformationKey (NtSetInformationKey)&lt;br /&gt;7c90e618: Syscall ordinal 00e3 for ZwSetInformationObject (NtSetInformationObject)&lt;br /&gt;7c90e62d: Syscall ordinal 00e4 for ZwSetInformationProcess (NtSetInformationProcess)&lt;br /&gt;7c90e642: Syscall ordinal 00e5 for ZwSetInformationThread (NtSetInformationThread)&lt;br /&gt;7c90e657: Syscall ordinal 00e6 for ZwSetInformationToken (NtSetInformationToken)&lt;br /&gt;7c90e66c: Syscall ordinal 00e7 for ZwSetIntervalProfile (NtSetIntervalProfile)&lt;br /&gt;7c90e681: Syscall ordinal 00e8 for ZwSetIoCompletion (NtSetIoCompletion)&lt;br /&gt;7c90e696: Syscall ordinal 00e9 for ZwSetLdtEntries (NtSetLdtEntries)&lt;br /&gt;7c90e6ab: Syscall ordinal 00ea for ZwSetLowEventPair (NtSetLowEventPair)&lt;br /&gt;7c90e6c0: Syscall ordinal 00eb for ZwSetLowWaitHighEventPair (NtSetLowWaitHighEventPair)&lt;br /&gt;7c90e6d5: Syscall ordinal 00ec for ZwSetQuotaInformationFile (NtSetQuotaInformationFile)&lt;br /&gt;7c90e6ea: Syscall ordinal 00ed for ZwSetSecurityObject (NtSetSecurityObject)&lt;br /&gt;7c90e6ff: Syscall ordinal 00ee for ZwSetSystemEnvironmentValue (NtSetSystemEnvironmentValue)&lt;br /&gt;7c90e714: Syscall ordinal 00ef for ZwSetSystemEnvironmentValueEx (NtSetSystemEnvironmentValueEx)&lt;br /&gt;7c90e729: Syscall ordinal 00f0 for ZwSetSystemInformation (NtSetSystemInformation)&lt;br /&gt;7c90e73e: Syscall ordinal 00f1 for ZwSetSystemPowerState (NtSetSystemPowerState)&lt;br /&gt;7c90e753: Syscall ordinal 00f2 for ZwSetSystemTime (NtSetSystemTime)&lt;br /&gt;7c90e768: Syscall ordinal 00f3 for ZwSetThreadExecutionState (NtSetThreadExecutionState)&lt;br /&gt;7c90e77d: Syscall ordinal 00f4 for ZwSetTimer (NtSetTimer)&lt;br /&gt;7c90e792: Syscall ordinal 00f5 for ZwSetTimerResolution (NtSetTimerResolution)&lt;br /&gt;7c90e7a7: Syscall ordinal 00f6 for ZwSetUuidSeed (NtSetUuidSeed)&lt;br /&gt;7c90e7bc: Syscall ordinal 00f7 for ZwSetValueKey (NtSetValueKey)&lt;br /&gt;7c90e7d1: Syscall ordinal 00f8 for ZwSetVolumeInformationFile (NtSetVolumeInformationFile)&lt;br /&gt;7c90e7e6: Syscall ordinal 00f9 for ZwShutdownSystem (NtShutdownSystem)&lt;br /&gt;7c90e7fb: Syscall ordinal 00fa for ZwSignalAndWaitForSingleObject (NtSignalAndWaitForSingleObject)&lt;br /&gt;7c90e810: Syscall ordinal 00fb for ZwStartProfile (NtStartProfile)&lt;br /&gt;7c90e825: Syscall ordinal 00fc for ZwStopProfile (NtStopProfile)&lt;br /&gt;7c90e83a: Syscall ordinal 00fd for ZwSuspendProcess (NtSuspendProcess)&lt;br /&gt;7c90e84f: Syscall ordinal 00fe for ZwSuspendThread (NtSuspendThread)&lt;br /&gt;7c90e864: Syscall ordinal 00ff for ZwSystemDebugControl (NtSystemDebugControl)&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; As somebody pointed out in the comments, there's a &lt;a href="http://www.metasploit.com/users/opcode/syscalls.html"&gt;really good compilation of system call ordinals&lt;/a&gt; up at &lt;a href="http://www.metasploit.com/"&gt;Metasploit's site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6495079821893274399?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6495079821893274399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6495079821893274399' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6495079821893274399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6495079821893274399'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/digging-up-system-call-ordinals.html' title='Digging up system call ordinals'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8185656039336979030</id><published>2008-03-04T03:37:00.004+01:00</published><updated>2008-03-04T06:41:22.920+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Recon 2008</title><content type='html'>So, it seems that after a year off &lt;a href="http://recon.cx/2008/index.html"&gt;Recon is coming back in 2008&lt;/a&gt;. I attended last time it was held and was one of the best conferences I've been to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8185656039336979030?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8185656039336979030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8185656039336979030' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8185656039336979030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8185656039336979030'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/recon-2008.html' title='Recon 2008'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5481221518221944693</id><published>2008-03-02T22:03:00.003+01:00</published><updated>2008-03-02T22:14:30.830+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Old interviews with members of 29A</title><content type='html'>The guys at &lt;a href="http://www.hispasec.com/"&gt;Hispasec&lt;/a&gt; &lt;a href="http://blog.hispasec.com/laboratorio/273"&gt;managed to dig up some old interviews&lt;/a&gt; with members &lt;a href="http://blog.hispasec.com/laboratorio/images/noticias/griyo.pdf"&gt;GriYo&lt;/a&gt; and &lt;a href="http://blog.hispasec.com/laboratorio/images/noticias/mistersandman.pdf"&gt;MrSandman&lt;/a&gt; of the &lt;a href="http://www.29a.net/"&gt;legendary group 29A&lt;/a&gt; that recently announced was closing shop. Definitely worth a read if you can handle spanish.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5481221518221944693?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5481221518221944693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5481221518221944693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5481221518221944693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5481221518221944693'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/03/old-interviews-with-members-of-29a.html' title='Old interviews with members of 29A'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2632248383162570762</id><published>2008-02-19T18:54:00.005+01:00</published><updated>2008-02-19T19:59:02.681+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>badass debugger + badass toy = geek pr0n</title><content type='html'>Today I finally got working a hacked-together minimal version of the iPhone debugger client for &lt;a href="http://www.zynamics.com/index.php?page=binnavi"&gt;BinNavi&lt;/a&gt;. It's heavily based on Patrick Walton's (with HD's updates) &lt;a href="http://blog.metasploit.com/2007/10/cracking-iphone-part-2.html"&gt;weasel debugger&lt;/a&gt;. Once tied to BinNavi debug client framework the whole client-server interaction is trivial.&lt;br /&gt;&lt;br /&gt;It feels just right, the best looking debugger together with the slickest device.. recipe for fun.. ;-)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/R7sbvUlJenI/AAAAAAAAB0E/_RjiluVY0M0/s1600-h/binnavi_does_iphone.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/R7sbvUlJenI/AAAAAAAAB0E/_RjiluVY0M0/s400/binnavi_does_iphone.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755497130097266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/R7sbwElJeoI/AAAAAAAAB0M/mlHvArrgbNY/s1600-h/iphone_binnavi.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/R7sbwElJeoI/AAAAAAAAB0M/mlHvArrgbNY/s400/iphone_binnavi.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755510014999170" /&gt;&lt;/a&gt;&lt;br /&gt;The test application is &lt;i&gt;telnet&lt;/i&gt; on the iPhone. On the iPhone's screen is the debug output from BinNavi's debug client. &lt;i&gt;telnet&lt;/i&gt; is launched from an ssh session in OSX, where &lt;a href="http://www.zynamics.com/index.php?page=binnavi"&gt;BinNavi&lt;/a&gt; is running.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/R7sbxUlJepI/AAAAAAAAB0U/tUPhqMPqTWQ/s1600-h/iphone_debug_client.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/R7sbxUlJepI/AAAAAAAAB0U/tUPhqMPqTWQ/s400/iphone_debug_client.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5168755531489835666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For anybody trying to link Mach's debugging interface with a C++ iPhone application, remember the &lt;b&gt;extern "C"&lt;/b&gt; when defining &lt;b&gt;boolean_t exc_server(mach_msg_header_t *in, mach_msg_header_t *out);&lt;/b&gt; (which is not defined in the header files, as pointed in weasel's source code). Otherwise you'll get a nasty "Undefined symbols" message when linking.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;extern "C"&lt;/b&gt; is also needed for &lt;b&gt;catch_exception_raise(...)&lt;/b&gt; so &lt;b&gt;exc_server&lt;/b&gt; can call it to handle exceptions. Documented &lt;a href="http://cl-debian.alioth.debian.org/repository/pvaneynd/bzr-moved/sbcl/doc/internals-notes/mach-exception-handler-notes"&gt;here&lt;/a&gt;.&lt;br /&gt;(I've used the standard iPhone toolchain on Debian, this is running on the firmware 1.1.3)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2632248383162570762?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2632248383162570762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2632248383162570762' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2632248383162570762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2632248383162570762'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/02/badass-debugger-badass-toy-geek-pr0n.html' title='badass debugger + badass toy = geek pr0n'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/R7sbvUlJenI/AAAAAAAAB0E/_RjiluVY0M0/s72-c/binnavi_does_iphone.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5691212332217023979</id><published>2008-02-14T23:53:00.002+01:00</published><updated>2008-02-15T00:01:34.348+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='pydot'/><title type='text'>pydot 1.0.2 ... that took long</title><content type='html'>Finally! it was long due. Here it is &lt;a href="http://code.google.com/p/pydot/"&gt;pydot 1.0.2&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Some weeks ago I started updating the code to support all the attributes and enhancements in GraphViz 2.16. In attempting to make it pass all the regression tests some severe shortcomings it had became apparent. &lt;br /&gt;pydot users had also provided with insight into how to improve performance by redesigning the way the data for the objects is stored internally. All in all, the limitations I was facing led me to rewrite the whole core of pydot, which took much longer than I wanted but I feel it was well worth it as it's orders of magnitude better than the last release 0.9. &lt;br /&gt;&lt;br /&gt;Performance-wise the new pydot stores graphs and their objects using a hierarchy of nested dictionaries and lists. Graph, Node, Edge objects are mere proxies to the data and are created on demand. So that now it's possible to have a graph with a 1 million edges and there will not be a single Edge instance (only if requested, then they will be created on demand, mapping the data and providing with all the methods to act on the data in the global dictionary). &lt;br /&gt;Storing a graph with 1 million edges in pydot 1.0 has approximately the same memory requirements (~813MiB) as dealing with one with only 40.000 edges in pydot 0.9 (~851MiB), the 40.000 edges graph needs ~35MiB in pydot 1.0 . Handling graphs should be much faster, as no linear searches are performed in &lt;a href="http://code.google.com/p/pydot/"&gt;pydot 1.0.2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5691212332217023979?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5691212332217023979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5691212332217023979' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5691212332217023979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5691212332217023979'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2008/02/pydot-102-that-took-long.html' title='pydot 1.0.2 ... that took long'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5625894698439188386</id><published>2007-12-19T21:46:00.000+01:00</published><updated>2007-12-21T16:18:02.055+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>Exe_Dump_Utility, a web-enabled pefile</title><content type='html'>Gregory Piñero has put together &lt;a href="http://utilitymill.com/utility/Exe_Dump_Utility"&gt;Exe_Dump_Utility, a web-based version of pefile&lt;/a&gt;. Now it's possible to obtain the whole set of information processed by &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; online, without the need to install it. Neat!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5625894698439188386?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5625894698439188386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5625894698439188386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5625894698439188386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5625894698439188386'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/12/exedumputility-web-enabled-pefile.html' title='Exe_Dump_Utility, a web-enabled pefile'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5622375788078610635</id><published>2007-12-05T13:00:00.000+01:00</published><updated>2007-12-05T13:01:33.856+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='humor'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>xkcd: Python</title><content type='html'>&lt;a href="http://xkcd.com/353/"&gt;&lt;img style="display:block; width:400px; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://imgs.xkcd.com/comics/python.png" border="0" alt="Network" /&gt;&lt;/a&gt;&lt;br /&gt;So true&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5622375788078610635?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5622375788078610635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5622375788078610635' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5622375788078610635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5622375788078610635'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/12/xkcd-python.html' title='xkcd: Python'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8386413663603370162</id><published>2007-11-30T00:03:00.000+01:00</published><updated>2007-11-30T01:33:11.635+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Take Two: Packers, Time and Google Groups</title><content type='html'>I just &lt;b&gt;had&lt;/b&gt; to do it... This morning I read about &lt;a href="http://timepedia.org/chronoscope/"&gt;chronoscope&lt;/a&gt; in a &lt;a href="http://google-code-updates.blogspot.com/2007/11/chronoscope-2-2-5-with-gwt-and-android.html"&gt;post in the Google Code Blog&lt;/a&gt; and I could not help myself from wanting to tinker with it.&lt;br /&gt;&lt;br /&gt;I wrote a &lt;a href="http://www.wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt; function to export a time-series of the format (timestamp, value) into the &lt;a href="http://timepedia.org/chronoscope/docs/gwt/intro/"&gt;dataset format&lt;/a&gt; used by &lt;a href="http://timepedia.org/chronoscope/"&gt;chronoscope&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;Epoch[date_] := &lt;br /&gt;&amp;nbsp;&amp;nbsp;ToString[AbsoluteTime[DateList[ToString[date]]] -&lt;br /&gt;&amp;nbsp;&amp;nbsp;AbsoluteTime[DateList["1970"]]];&lt;br /&gt;&lt;br /&gt;ChronoscopeJsExport = Function[ {datasetName, id, label, axis, data},&lt;br /&gt;&amp;nbsp;&amp;nbsp;jsData = datasetName &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;" = {\nId: \"" &lt;&gt; ToString[id] &lt;&gt; "\", \n" &lt;&gt; "domain: [" &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;StringJoin[ Riffle[ Map[ Epoch, data[[All, 1]] ], ", "] ] &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;"], \n" &lt;&gt; "range: [" &lt;&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;StringJoin[&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Riffle[ Map[ ToString, data[[All, 2]] ], ", "] ] &lt;&gt; "], \n" &lt;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;"label: \"" &lt;&gt; ToString[label] &lt;&gt; "\", \n" &lt;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;"axis: \"" &lt;&gt; ToString[axis] &lt;&gt; "\"\n};";&lt;br /&gt;&amp;nbsp;&amp;nbsp;jsData&lt;br /&gt;];&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And ran it through the &lt;a href="http://blog.dkbza.org/2007/11/packers-time-and-google-groups.html"&gt;packer time-series I harvested from Google Groups&lt;/a&gt;. Then I picked some widget demo code  and put it all together in a mash-up. The results of the quick hack are here... much nicer to visualize than in the previous post. (and it's interactive!)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use the mouse-wheel to zoom&lt;/li&gt;&lt;li&gt;Drag the plot left/right to browse around different date ranges&lt;/li&gt;&lt;li&gt;You can pick any packer and the data will be plotted against the previously selected one&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;object type="text/html" width="475" height="700" data="http://dkbza.org/misc/chronoscope_packer_data.html"&gt;&lt;br /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8386413663603370162?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8386413663603370162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8386413663603370162' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8386413663603370162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8386413663603370162'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/take-two-packers-time-and-google-groups.html' title='Take Two: Packers, Time and Google Groups'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4336215011112694114</id><published>2007-11-28T09:52:00.000+01:00</published><updated>2007-11-28T10:03:05.198+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='humor'/><title type='text'>xkcd: Network</title><content type='html'>&lt;a href="http://xkcd.com/350/"&gt;&lt;img style="display:block; width:400px; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://imgs.xkcd.com/comics/network.png" border="0" alt="Network" /&gt;&lt;/a&gt;&lt;br /&gt;Simply brilliant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4336215011112694114?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4336215011112694114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4336215011112694114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4336215011112694114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4336215011112694114'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/xkcd-network.html' title='xkcd: Network'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2188082067533501487</id><published>2007-11-25T23:56:00.000+01:00</published><updated>2007-11-26T13:07:35.043+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.8</title><content type='html'>And yet another one. &lt;a href="http://code.google.com/p/pefile/"&gt;pefile 1.2.8&lt;/a&gt; comes with the usual few bugfixes and a slew of enhancements. Some of them are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;One can now "relocate" the image by invoking &lt;i&gt;relocate_image(ImageBase)&lt;/i&gt; with a new ImageBase the PE file's relocations will be applied to produce the relocated image.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Section entropy is computed faster (thanks to &lt;a href="http://d-dome.net/"&gt;Gergely&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MD5, SHA-1, SHA-256, SHA-512 hashes are calculated on a per-section basis (thanks Jim Clausing for the suggestion)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Improved (rather fixed) handling of Unicode strings when parsing the resources information&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For more details and downloads head to &lt;a href="http://code.google.com/p/pefile/"&gt;pefile's project page&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2188082067533501487?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2188082067533501487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2188082067533501487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2188082067533501487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2188082067533501487'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/pefile-128.html' title='pefile 1.2.8'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1840008397153329270</id><published>2007-11-25T17:10:00.000+01:00</published><updated>2007-11-25T22:06:21.375+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><title type='text'>Right, Left, Right, Right, Left... and the Dancing Girl</title><content type='html'>Lately &lt;a href="http://www.news.com.au/perthnow/story/0,21598,22492511-5005375,00.html"&gt;a animation&lt;/a&gt; of a woman has been going around. The animation shows a rotating silhouette, the catch is that it can be perceived to be rotating clockwise or counter-clockwise. It tends to be a bit hard to change the perception of the direction of rotation once one particular direction has been recognized (at least in my personal case), I've read that for some people it switches direction more or less randomly, after looking at it for a while.&lt;br /&gt;I was curious as to why it works, whether I could reproduce the trick and if I could make myself see her rotating in one direction or the other at will.&lt;br /&gt;&lt;br /&gt;The why it works is relatively straightforward. Whether the rotation is clockwise or counter-clockwise is impossible to say if it happens in the same plane as where the viewer's viewpoint lays and there's no feeling of depth. The brain needs the perspective in order to tell the direction for sure, perspective will make the objects that are father look smaller and the ones closer bigger, that will help the brain discriminate one direction over the other. The dancing woman has been created in such way that it appears to have some perspective, yet it's still ambiguous (and you can see things jumping strangely at rotation as a result of this composition, just pay attention at the magical stretch of the arm closer to the body when it passes in front/behind)&lt;br /&gt;&lt;br /&gt;It's easy to reproduce, just look at this example I quickly put together. With perspective it can be easily said whether it rotates in one direction or the other. We can either display it by setting the viewpoint above or directly in front with with a large aperture angle that exaggerates the perspective.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/wgW2Xnc7Uq4&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/wgW2Xnc7Uq4&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/uXDwCOsbSpA&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/uXDwCOsbSpA&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Then, if we now we set the viewpoint in front, yet so far that the projection lines become nearly parallel so that we lose the sense of perspective. It becomes much harder to tell the direction of motion and it's even possible to see it going both directions.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/983tpOT10xY&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/983tpOT10xY&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Then regarding the choosing at will of one direction over the other... I figured out that given that the only thing preventing my brain from deciding is the ambiguity caused by lack of information that would bias some layer of my neural networks to decide clockwise/counter-clockwise... I went really high tech and starting moving my finger in front of the dancing woman in the direction I wanted to see her to rotate... that seems to solve the ambiguity and I can make her turn one way or another at will...&lt;br /&gt;&lt;br /&gt;I wonder if the trick works for other people too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1840008397153329270?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1840008397153329270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1840008397153329270' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1840008397153329270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1840008397153329270'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/right-left-right-right-left-and-dancing.html' title='Right, Left, Right, Right, Left... and the Dancing Girl'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3471989003892184177</id><published>2007-11-21T22:44:00.000+01:00</published><updated>2007-11-22T12:32:17.687+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Packers, Time and Google Groups</title><content type='html'>The other day I was talking with a friend and the discussion went into when certain anti-disassembly, anti-debug, etc. techniques might have appeared. That's bound to be difficult because tricks are usually simultaneously discovered by different people.&lt;br /&gt;&lt;br /&gt;So I though, a trick will usually be regarded as "common" once it gets implemented in some packer, as those try to make analysis difficult and will attempt to embedded whichever tricks are good/popular within the underground at the time in order to make the reverse engineering process as cumbersome as possible. Therefore if I could somehow place packers in time I'd have a starting point...&lt;br /&gt;&lt;br /&gt;That led me to remember about Google Groups. It's possible to make queries restricted to date ranges and the archives go back to 1981. I quickly put together a script to scan with a one-month window through 1981 to 2007 for a set of popular packers.&lt;br /&gt;&lt;br /&gt;The most painful part of the whole process was to fool Google... they sure do not like robots... whenever they get a bunch of very simply automated queries they'll server back a "403 Forbidden" telling queries look like coming from a virus or spyware app...&lt;br /&gt;But my script is good, it's no evil spyware... so I got into the mood of working my way around the checks. I needed to do quite some queries (&gt; 10K) so I better make it believe I'm not a robot. Besides finding the right timing for the queries (too often will make Google sad) I had to distribute the search over a few hosts, randomize headers and User-Agents and the query itself (just throw in some randomized, "orthogonal" (nothing to do with your query) search terms). After that the script was good to go...&lt;br /&gt;&lt;br /&gt;So, after mining the news groups for popular packer names ( the search string was, most of the time, "&lt;packer name&gt; exe" plus the "randomized" terms ) I got a cute small data set to throw into Mathematica...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/R0SqoAFLRdI/AAAAAAAABvQ/T-QIaa6Ar68/s1600-h/plot_1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/R0SqoAFLRdI/AAAAAAAABvQ/T-QIaa6Ar68/s400/plot_1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417079302407634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0SqogFLReI/AAAAAAAABvY/CMplWj0JS1o/s1600-h/plot_2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0SqogFLReI/AAAAAAAABvY/CMplWj0JS1o/s400/plot_2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417087892342242" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/R0SqowFLRfI/AAAAAAAABvg/jhFp5kOEYIc/s1600-h/plot_3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/R0SqowFLRfI/AAAAAAAABvg/jhFp5kOEYIc/s400/plot_3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417092187309554" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/R0SqpQFLRgI/AAAAAAAABvo/QfniIZ5fdYc/s1600-h/plot_4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/R0SqpQFLRgI/AAAAAAAABvo/QfniIZ5fdYc/s400/plot_4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417100777244162" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0SqpgFLRhI/AAAAAAAABvw/bSZ6pgczXaY/s1600-h/plot_5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0SqpgFLRhI/AAAAAAAABvw/bSZ6pgczXaY/s400/plot_5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417105072211474" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5QFLRiI/AAAAAAAABv4/tB4dlcUMd4w/s1600-h/plot_6.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5QFLRiI/AAAAAAAABv4/tB4dlcUMd4w/s400/plot_6.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417375655151138" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5gFLRjI/AAAAAAAABwA/iyNv5U4VLsI/s1600-h/plot_7.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5gFLRjI/AAAAAAAABwA/iyNv5U4VLsI/s400/plot_7.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417379950118450" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5wFLRkI/AAAAAAAABwI/STkfLYszBJA/s1600-h/plot_8.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/R0Sq5wFLRkI/AAAAAAAABwI/STkfLYszBJA/s400/plot_8.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5135417384245085762" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The results will have some inaccuracies, as it's possible some of the terms appeared in some news post not related to the packers. Yet I think they look plausible. When the volume of hits is high enough or constant over time it feels like it would indicate the approximate release date of the packer in question, or at least the first public discussion about it which, I would tend to think, will not necessarily be too far apart.&lt;br /&gt;If someone can either corroborate or refute the data I'll be glad to hear.&lt;br /&gt;&lt;br /&gt;I also did some test overlaying virus release times in order to try to spot correlations between big outbreaks and news-posts about packers, but I couldn't see anything particularly significant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3471989003892184177?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3471989003892184177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3471989003892184177' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3471989003892184177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3471989003892184177'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/11/packers-time-and-google-groups.html' title='Packers, Time and Google Groups'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/R0SqoAFLRdI/AAAAAAAABvQ/T-QIaa6Ar68/s72-c/plot_1.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6152583006559881121</id><published>2007-10-12T13:47:00.000+02:00</published><updated>2007-10-12T13:47:38.871+02:00</updated><title type='text'>OpenRCE.org goodies</title><content type='html'>By popular demand I've added OpenRCE.org T-Shirts and other goodies to the &lt;a href="http://www.cafepress.com/dkbza"&gt;online store&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.cafepress.com/dkbza"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/Rw9eU67aR0I/AAAAAAAABIw/QnYRrnVLkt0/s400/cafepress.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5120415014852380482" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope you like them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6152583006559881121?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6152583006559881121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6152583006559881121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6152583006559881121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6152583006559881121'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/10/openrceorg-goodies.html' title='OpenRCE.org goodies'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/Rw9eU67aR0I/AAAAAAAABIw/QnYRrnVLkt0/s72-c/cafepress.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-9118532346551516385</id><published>2007-10-12T10:21:00.000+02:00</published><updated>2007-10-12T10:40:42.108+02:00</updated><title type='text'>More iPhone hacking by HD Moore</title><content type='html'>He's &lt;a href="http://blog.metasploit.com/2007/10/cracking-iphone-part-1.html"&gt;wrote more on hacking&lt;/a&gt; the &lt;a href="http://www.apple.com/iphone/"&gt;iPhone&lt;/a&gt; on &lt;a href="http://blog.metasploit.com/"&gt;Metasplot's blog&lt;/a&gt;. Definitely worth a read. I'm dying to read part two.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-9118532346551516385?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/9118532346551516385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=9118532346551516385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9118532346551516385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9118532346551516385'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/10/more-iphone-hacking-by-hd-moore.html' title='More iPhone hacking by HD Moore'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-9014034853036913573</id><published>2007-09-26T10:03:00.000+02:00</published><updated>2007-09-26T10:20:23.805+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Metasploit on the iPhone</title><content type='html'>A nice &lt;a href="http://blog.metasploit.com/2007/09/root-shell-in-my-pocket-and-maybe-yours.html"&gt;write-up on the iPhone&lt;/a&gt; has been posted in &lt;a href="http://blog.metasploit.com/"&gt;Metasploit&lt;/a&gt;'s blog.&lt;br /&gt;&lt;br /&gt;My favorite point...&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Every process runs as root. MobileSafari, MobileMail, even the Calculator, all run with full root privileges. Any security flaw in any iPhone application can lead to a complete system compromise. A rootkit takes on a whole new meaning when the attacker has access to the camera, microphone, contact list, and phone hardware. Couple this with "always-on" internet access over EDGE and you have a perfect spying device.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-9014034853036913573?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/9014034853036913573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=9014034853036913573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9014034853036913573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/9014034853036913573'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/metasploit-on-iphone.html' title='Metasploit on the iPhone'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3707515393038240137</id><published>2007-09-18T09:19:00.000+02:00</published><updated>2007-09-18T09:26:29.343+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Hex-Rays unleashed</title><content type='html'>&lt;a href="http://www.hex-rays.com/compare.shtml"&gt;Hex-Rays&lt;/a&gt;, &lt;a href="http://www.hexblog.com/"&gt;Ilfak Guilfanov&lt;/a&gt;'s decompiler, has been &lt;a href="http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=104&amp;STORY=/www/story/09-17-2007/0004663594&amp;EDATE="&gt;unleashed&lt;/a&gt;. I have had the chance of playing a bit with the beta and it is really impressive, to say the least. This will save so many hours to reverse engineers...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ru99Kvi09nI/AAAAAAAABIQ/60T-19WHeb4/s1600-h/ilfak_hex_rays.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ru99Kvi09nI/AAAAAAAABIQ/60T-19WHeb4/s400/ilfak_hex_rays.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5111441725603509874" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3707515393038240137?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3707515393038240137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3707515393038240137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3707515393038240137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3707515393038240137'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/hex-rays-unleashed.html' title='Hex-Rays unleashed'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/Ru99Kvi09nI/AAAAAAAABIQ/60T-19WHeb4/s72-c/ilfak_hex_rays.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3569831047101234819</id><published>2007-09-17T12:58:00.000+02:00</published><updated>2007-09-17T13:12:36.831+02:00</updated><title type='text'>Un-bricking the Garmin GPSmap 60CS</title><content type='html'>A while ago I managed to brick my trustworthy &lt;a href="https://buy.garmin.com/shop/shop.do?pID=6447"&gt;GPSmap 60CS&lt;/a&gt; when I was trying to update its firmware (don't try doing it from within a virtual machine if you can avoid it, unless you have a feeling for adventure ;) ).&lt;br /&gt;It was bad enough that it would not even give any signs of life when trying to turn it on.&lt;br /&gt;&lt;br /&gt;So I called Garmin Europe to see how much would it cost to get it repaired... and it was steep enough that I &lt;i&gt;had&lt;/i&gt; to Google for a solution for a bit longer... and luckily enough I found a sneaky &lt;a href="http://www.malsingmaps.com/wiki/index.php/Garmin_GPSMAP_60CSx#2._60Cx_is_.22bricked.22._It_will_not_even_turn_on."&gt;way of reloading the firmware&lt;/a&gt; that actually worked!&lt;br /&gt;&lt;br /&gt;Now it's back alive!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3569831047101234819?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3569831047101234819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3569831047101234819' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3569831047101234819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3569831047101234819'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/un-bricking-garmin-60cs.html' title='Un-bricking the Garmin GPSmap 60CS'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-225182886864546815</id><published>2007-09-09T23:40:00.000+02:00</published><updated>2007-09-11T14:03:31.632+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='code opimization'/><title type='text'>Reverse engineering a compiler-produced artifact</title><content type='html'>In our training, &lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; and I deal with some very simple compiler optimizations or artifacts. Although they represent the same semantics that the programmer defined in the original source code, those optimizations are sometimes cumbersome to convert back to a meaningful high-level representation.&lt;br /&gt;&lt;br /&gt;The other day I was just studying a piece of code and bumped into a relatively common pattern. The code I was looking at was supposed to represent a division of a function's argument by a constant. But in the disassembled code I was studying I could only see a multiplication. This can be slightly confusing unless one has seen a bit more assembly than what is healthy and remembers some of the compiler-produced fun that goes on...&lt;br /&gt;&lt;br /&gt;A couple of things to remember:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Compilers &lt;b&gt;love&lt;/b&gt; to work with multiples of 2. The processor can can just &lt;a href="http://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts"&gt;shift registers left and right&lt;/a&gt; (shifting is incredibly fast, that is moving the contents of a register left or right padding with o or 1 as appropriate). Shifting to the left for multiplication by 2 and towards the right for division by 2 (this is akin to having a number in base 10 and multiplying by 10 by adding zeros to the right and dividing by by removing the rightmost digit).&lt;/li&gt;&lt;li&gt;Compilers &lt;b&gt;hate&lt;/b&gt; to use the division instruction. The division takes a lot of steps, or cycles, for the CPU to complete. Hence they will avoid to use it at all cost.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The code looked like this:&lt;br /&gt;(&lt;i&gt;irrelevant interleaved code left out&lt;/i&gt;)&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="border: 2px outset gray; width: 100%; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;mov     ecx, [esp+4+arg_4]&lt;br /&gt;mov     eax, 66666667h&lt;br /&gt;imul    ecx&lt;br /&gt;sar     edx, 3&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In the snippet we can see function argument being multiplied by 0x66666667, and the result being stored as a 64 bit value in EDX:EAX (topmost 32 bits in EDX, the lower 32 in EAX)&lt;/li&gt;&lt;li&gt;Then the top 32 bits are shifted (&lt;a href="http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift"&gt;"arithmetically"&lt;/a&gt;) to the right. That is, divided by 2 thrice, same as 2^3 = 8. Effectively dividing the value by 8.&lt;/li&gt;&lt;li&gt;But the division is applied only to the top 32 bits, ignoring the lower 32. That could be understood to also mean that, by taking the topmost 32 bits and ignoring the bottom ones, the result of the multiplication is implicitly being divided by 2^32. (That's only guessed by the subsequent usage of the value just obtained, there's never again a reference to the lower 32bits, so I assume that they are discarded)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;What do we have so far?&lt;br /&gt;&lt;br /&gt;[ (Value * 0x66666667) / 2^32 ] / 2^3 ]&lt;br /&gt;&lt;br /&gt;But, what's that 0x66666667? why to multiply by something so large and then divide?&lt;br /&gt;The reason is that such computation allows the processor to keep most of the precision of the division it is trying to perform, still obtaining an integer in the end but without having to resort to using floating point arithmetic (which is far slower)&lt;br /&gt;&lt;br /&gt;Let's do an example in base 10. Imagine that you only can multiply and divide by 10 (shifting numbers left and right) and we want to divide a number by 30. By shifting we can only divide by 10, 100, 1000, etc&lt;br /&gt;&lt;br /&gt;But we have that: Value/30 = value * 1/3 * 1/10&lt;br /&gt;&lt;br /&gt;Given that, represented as an integer, 1/3 would produce 0 we can "scale" it by multiplying by a large constant that later, once we are done, we divide by to get the value we're after. Given that the easiest for us is to multiply/divide by 10, we can "scale" 1/3 and make it 100000/3 which approximately equals 33333, which is a nice integer value. We would want to make this value as large as it fits in our registers in order to be as precise as possible. The bigger it is the more precision it will retain for subsequent operations.&lt;br /&gt;&lt;br /&gt;Value/30 = ( Value*33333 ) / 1000000&lt;br /&gt;&lt;br /&gt;Hence, we now have a clue now of where that 0x66666667 value might be coming from. Given that the processor works in base 2. We can assume that it's going to prefer multiples of 2. Also, given that it will try to obtain the largest value that fits in a 32bit register, that gives us an idea of the range of the power-of-two in use. We can get there with a bit of trial and error (We want to obtain an integer as a result of dividing a power of two by 0x66666667).&lt;br /&gt;&lt;br /&gt;2.0^33/0x66666667 = 4.9999999982537702 ~= 5&lt;br /&gt;&lt;br /&gt;Therefore:&lt;br /&gt;&lt;br /&gt;0x66666667 ~= 2^33/5&lt;br /&gt;&lt;br /&gt;So, in the end we get to&lt;br /&gt;&lt;br /&gt;( [ (Value * 2^33)/5] /2^32 ) / 2^3&lt;br /&gt;&lt;br /&gt;And with some algebra it simplifies to:&lt;br /&gt;&lt;br /&gt;Value / (5*2^2) =  Value/20&lt;br /&gt;&lt;br /&gt;Effectively dividing the value by 20, without actually using the division instruction. That's to the extent that compilers will go to avoid using the division instruction...&lt;br /&gt;&lt;br /&gt;Reverse engineering is fun isn't it?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; Given that this is a relatively old and well known optimization strategy it's only natural that it had been discussed before. It was just brought to my attention that Ilfak had &lt;a href="http://hexblog.com/2005/11/do_you_know_the_division_opera.html"&gt;blogged about a similar optimization&lt;/a&gt; and &lt;a href="http://www.hackersdelight.org/divcMore.pdf"&gt;this chapter (PDF)&lt;/a&gt; from &lt;a href="http://www.hackersdelight.org/"&gt;Hacker's Delight&lt;/a&gt; provides more details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-225182886864546815?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/225182886864546815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=225182886864546815' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/225182886864546815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/225182886864546815'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/09/reverse-engineering-compiler-produced.html' title='Reverse engineering a compiler-produced artifact'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2124705691794449654</id><published>2007-08-28T00:32:00.000+02:00</published><updated>2007-09-10T13:31:39.400+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Visualizations of the Portable Executable Format</title><content type='html'>I've always found that clear diagramming and laying out of complicated information makes it much more accessible and understandable.&lt;br /&gt;When I started looking into the Portable Executable format I found it really helpful to lay out all the headers and structures I was trying to understand, to visualize how they relate to each other and the information they contain.&lt;br /&gt;The resulting diagrams have been available under the &lt;a href="https://www.openrce.org/reference_library/papers/"&gt;corresponding section in OpenRCE&lt;/a&gt; for a some time already.&lt;br /&gt;&lt;br /&gt;Now, given the feedback I received about some of those, I decided to put them up in an &lt;a href="http://cafepress.com/dkbza/"&gt;online store&lt;/a&gt; so people can get the real posters, high-resolution, updated and redesigned versions of those diagrams.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.cafepress.com/dkbza.162471691"&gt;Portable Executable Format poster&lt;/a&gt; has been updated to display the modified structures of the PE32+ format, while the &lt;a href="http://www.cafepress.com/dkbza.164084665"&gt;Portable Executable Format. A File Walkthrough&lt;/a&gt; depicts the basic headers on top of a raw byte representation of an actual executable file.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RuUq-E85HDI/AAAAAAAABFA/QVewy0WVUTc/s1600-h/posters.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RuUq-E85HDI/AAAAAAAABFA/QVewy0WVUTc/s400/posters.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5108536598291094578" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2124705691794449654?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2124705691794449654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2124705691794449654' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2124705691794449654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2124705691794449654'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/visualizations-of-portable-executable.html' title='Visualizations of the Portable Executable Format'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ppb6-5N0H80/RuUq-E85HDI/AAAAAAAABFA/QVewy0WVUTc/s72-c/posters.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-733521791226131716</id><published>2007-08-23T18:30:00.000+02:00</published><updated>2007-08-23T18:34:15.454+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>PyDbg hacks</title><content type='html'>&lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; just posted on his &lt;a href="https://www.openrce.org/blog/browse/pedram"&gt;OpenRCE blog&lt;/a&gt; some awesome &lt;a href="https://www.openrce.org/blog/view/869/PyDbg_Hacks"&gt;PyDBG hacks&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-733521791226131716?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/733521791226131716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=733521791226131716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/733521791226131716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/733521791226131716'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/pydbg-hacks.html' title='PyDbg hacks'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-300070473255864683</id><published>2007-08-22T16:49:00.000+02:00</published><updated>2007-08-22T16:53:45.647+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='astrophysics'/><category scheme='http://www.blogger.com/atom/ns#' term='astronomy'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><title type='text'>Google Sky</title><content type='html'>Google has just &lt;a href="http://www.gearthblog.com/blog/archives/2007/08/google_earth_42_rele.html"&gt;released Google Earth 4.2&lt;/a&gt; and it comes with an extremely cool new feature, Google Sky.&lt;br /&gt;It provides layers for all kind of astronomical objects and astrophysical features like &lt;a href="http://en.wikipedia.org/wiki/Gravitational_lensing"&gt;gravitational lenses&lt;/a&gt;. It even has the &lt;a href="http://en.wikipedia.org/wiki/Hubble_Ultra_Deep_Field"&gt;Ultra Deep Field&lt;/a&gt; image sets from the Hubble. This is simply gorgeous, I could play with it for hours...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-300070473255864683?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/300070473255864683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=300070473255864683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/300070473255864683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/300070473255864683'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/google-sky.html' title='Google Sky'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-47907989251790988</id><published>2007-08-22T01:25:00.000+02:00</published><updated>2007-08-23T18:33:54.573+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.7</title><content type='html'>Just pushed out an &lt;a href="http://code.google.com/p/pefile/downloads/list"&gt;updated version&lt;/a&gt; of &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; with some minor enhancements and fixes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added additional IMAGE_SUBSYSTEM_* flags&lt;/li&gt;&lt;li&gt;Added processing of the Optional Header's DllCharacteristics&lt;/li&gt;&lt;li&gt;Time/date fileds are now reported as UTC times&lt;/li&gt;&lt;li&gt;Added warning message for suspicious entry point addresses&lt;/li&gt;&lt;li&gt;Several minor parsing bugs fixed&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-47907989251790988?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/47907989251790988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=47907989251790988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/47907989251790988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/47907989251790988'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/pefile-127.html' title='pefile 1.2.7'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-726876752688614611</id><published>2007-08-21T20:29:00.000+02:00</published><updated>2007-08-23T18:34:35.139+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Great Python overview</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Alex_Martelli"&gt;Alex Martelli&lt;/a&gt; gave a talk in the &lt;a href="http://www.baypiggies.net/"&gt;Baypiggies&lt;/a&gt; meeting providing a great overview of Python. Check out the &lt;a href="http://video.google.com/videoplay?docid=1135114630744003385"&gt;video&lt;/a&gt; and &lt;a href="http://www.aleax.it/goo_py4prog.pdf"&gt;slides&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-726876752688614611?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/726876752688614611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=726876752688614611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/726876752688614611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/726876752688614611'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/great-python-overview.html' title='Great Python overview'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-518150536496252666</id><published>2007-08-10T02:05:00.000+02:00</published><updated>2007-08-23T20:01:15.700+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><category scheme='http://www.blogger.com/atom/ns#' term='ida2sql'/><title type='text'>Black Hat Slides</title><content type='html'>Although originally &lt;a href="http://addxorrol.blogspot.com/"&gt;Halvar Flake&lt;/a&gt; and I were supposed to present together in a quick turbo-talk at &lt;a href="http://www.blackhat.com/html/bh-usa-07/bh-usa-07-index.html"&gt;Black Hat&lt;/a&gt; in Las Vegas, he unfortunately couldn't make it to the conference for reasons that &lt;a href="http://addxorrol.blogspot.com/2007/07/ive-been-denied-entry-to-us-essentially.html"&gt;have been already discussed&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I ended up sticking mostly to the original plan for the talk and presented some Python tools to automate reverse engineering and analysis processes.&lt;br /&gt;&lt;br /&gt;I've just put the slides up &lt;a href="http://dkbza.org/data/BlackHat 2007 - Ero Carrera, 4x5.pdf"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-518150536496252666?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/518150536496252666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=518150536496252666' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/518150536496252666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/518150536496252666'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/black-hat-slides.html' title='Black Hat Slides'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5142727460357014240</id><published>2007-08-10T01:04:00.001+02:00</published><updated>2007-08-10T01:38:18.888+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.6</title><content type='html'>It's finally here! Took longer than I expected because of all the enhancements and because I decided to move pefile to &lt;a href="http://code.google.com/p/pefile/"&gt;Google Code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Besides access to the &lt;a href="http://code.google.com/p/pefile/source"&gt;source code&lt;/a&gt; through their subversion server, they also have a really cute &lt;a href="http://code.google.com/p/pefile/w/list"&gt;wiki&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've added documentation and &lt;a href="http://code.google.com/p/pefile/wiki/UsageExamples"&gt;examples&lt;/a&gt; and it should make it easier for people to contribute ideas and improvements.&lt;br /&gt;&lt;br /&gt;I introduced some of the new features of &lt;a href="http://code.google.com/p/pefile/"&gt;pefile&lt;/a&gt; in &lt;a href="http://www.blackhat.com/html/bh-usa-07/bh-usa-07-speakers.html#Carrera"&gt;my turbo-talk&lt;/a&gt; in the last &lt;a href="http://www.blackhat.com/html/bh-usa-07/bh-usa-07-index.html"&gt;Black Hat&lt;/a&gt; in Las Vegas.&lt;br /&gt;&lt;br /&gt;Besides some bugfixes, &lt;a href="http://code.google.com/p/pefile/"&gt;pefile-1.2.6&lt;/a&gt; can now parse &lt;a href="http://peid.tk/"&gt;PEiD&lt;/a&gt;'s signatures, it will report on the entropy of each section and will display more warnings for suspicious values found when parsing PE files. Just check the example dumps of &lt;a href="http://code.google.com/p/pefile/wiki/FullDumpTinyPE"&gt;Tiny PE&lt;/a&gt; and &lt;a href="http://code.google.com/p/pefile/wiki/FullDump0x90"&gt;0x90.exe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Information on how to use the &lt;a href="http://peid.tk/"&gt;PEiD&lt;/a&gt; signature matching can be found &lt;a href="http://code.google.com/p/pefile/wiki/PEiDSignatures"&gt;here&lt;/a&gt;. I posted a while ago on &lt;a href="http://blog.dkbza.org/2007/06/pefile-and-packer-detection.html"&gt;what can be done&lt;/a&gt; with the signature parsing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5142727460357014240?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5142727460357014240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5142727460357014240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5142727460357014240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5142727460357014240'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/08/pefile-126.html' title='pefile 1.2.6'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6421825073770143056</id><published>2007-07-25T12:02:00.000+02:00</published><updated>2007-07-25T12:07:16.532+02:00</updated><title type='text'>Supercomputing done with style</title><content type='html'>I was just reading through a list of the &lt;a href="http://funnyhub.blogspot.com/2007/07/top-7-most-powerful-supercomputers-in.html"&gt;top 7 supercomputers&lt;/a&gt; and just saw this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.bsc.es/media/368.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="http://www.bsc.es/media/368.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.bsc.es/media/364.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="http://www.bsc.es/media/364.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That's some style putting together a supercomputer, what a location!&lt;br /&gt;It's the &lt;a href="http://www.bsc.es/plantillaA.php?cat_id=5"&gt;MareNostrum&lt;/a&gt; in Barcelona.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6421825073770143056?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6421825073770143056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6421825073770143056' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6421825073770143056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6421825073770143056'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/supercomputing-done-with-style.html' title='Supercomputing done with style'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5039773310111987369</id><published>2007-07-14T20:46:00.000+02:00</published><updated>2007-07-14T20:46:31.777+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>BlackHat Vegas is nearly here...</title><content type='html'>I'll be there, teaching with &lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; a couple of rounds (weekend and week) of our training, &lt;a href="http://www.blackhat.com/html/bh-usa-07/train-bh-us-07-pa.html"&gt;Reverse Engineering on Windows: Application in Malicious Code Analysis&lt;/a&gt;. And then ranting together with &lt;a href="http://addxorrol.blogspot.com/"&gt;Halvar&lt;/a&gt; in a turbo talk, &lt;a href="http://www.blackhat.com/html/bh-usa-07/bh-usa-07-speakers.html#Flake"&gt;4 x 5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RpkWjC6m3vI/AAAAAAAAAr8/ruLnvGnXXoQ/s1600-h/pedram+amini+and+ero+carrera,+training.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RpkWjC6m3vI/AAAAAAAAAr8/ruLnvGnXXoQ/s400/pedram+amini+and+ero+carrera,+training.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5087122045425606386" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&lt;i&gt;Pedram and myself "live on stage"&lt;/i&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;For the people more into cutting edge vulnerability research, Halvar will also be doing his &lt;a href="http://www.blackhat.com/html/bh-usa-07/train-bh-us-07-hf.html"&gt;Analyzing Software for Security Vulnerabilities&lt;/a&gt;. Feel free to grab any of us during the conference if you have any questions regarding &lt;b&gt;BinDiff&lt;/b&gt;, &lt;b&gt;BinNavi&lt;/b&gt; or &lt;b&gt;VxClass&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;And now that I am in the mood of advertising things, be sure to check &lt;a href="https://www.openrce.org/event_calendar/"&gt;OpenRCE's event calendar&lt;/a&gt;, you can even subscribe to the &lt;a href="https://www.openrce.org/event_calendar/events.ics"&gt;iCal&lt;/a&gt; feed. I try to keep it up to date with whatever events fall into my ears. If anyone knows of more, please let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5039773310111987369?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5039773310111987369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5039773310111987369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5039773310111987369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5039773310111987369'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/blackhat-vegas-is-nearly-here.html' title='BlackHat Vegas is nearly here...'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RpkWjC6m3vI/AAAAAAAAAr8/ruLnvGnXXoQ/s72-c/pedram+amini+and+ero+carrera,+training.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-7108698915570768814</id><published>2007-07-07T22:41:00.000+02:00</published><updated>2007-07-07T22:41:46.235+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><title type='text'>Windows XP and Bochs</title><content type='html'>This might be of interest for anyone out there attempting to get Windows XP to install inside &lt;a href="http://bochs.sf.net/"&gt;Bochs&lt;/a&gt; with no luck.&lt;br /&gt;&lt;br /&gt;I had not been able to get it to install in any recent version, for one reason or another it always failed during install with a problem regarding the "catalogs" (error message was along the lines of &lt;i&gt;"Setup failed to install the product catalogs. This is a fatal error."&lt;/i&gt;). No matter what options I had compiled in Bochs.&lt;br /&gt;&lt;br /&gt;I had got it to install in the past... a long long time ago, so I figured out that I might get lucky with other versions of Bochs, so I started trying. 1.4.1 nothing, 2.0.2 nothing, 2.1.1 nothing (trying all of them with different configuration options, that took a while)... but finally got to 2.2.6 and bingo! it made it through with no errors! Once installed the image runs just fine in the latest incarnation of Bochs. Here it is,  Bochs running Windows XP on Fedora running inside Parallels on my OS X...&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro_tj_YcB8I/AAAAAAAAAr0/29ON9HXLLw4/s1600-h/virtualization_and_emulation.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro_tj_YcB8I/AAAAAAAAAr0/29ON9HXLLw4/s400/virtualization_and_emulation.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5084543706889717698" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&lt;i&gt;Virtualization(emulation) = madness^2 ?&lt;/i&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;I hope this saves somebody from hours of compiling, recompiling and reinstalling...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-7108698915570768814?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/7108698915570768814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=7108698915570768814' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7108698915570768814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7108698915570768814'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/windows-xp-and-bochs.html' title='Windows XP and Bochs'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro_tj_YcB8I/AAAAAAAAAr0/29ON9HXLLw4/s72-c/virtualization_and_emulation.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3430530282762778052</id><published>2007-07-06T02:59:00.000+02:00</published><updated>2007-08-23T20:01:15.701+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pythonika'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>Scanning data for entropy anomalies II</title><content type='html'>Recently &lt;a href="https://www.openrce.org/profile/view/phantal"&gt;Phantal&lt;/a&gt; (aka &lt;i&gt;Brian&lt;/i&gt;) left &lt;a href="http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html#comments"&gt;some comments&lt;/a&gt; on my blog and in &lt;a href="https://www.openrce.org/forums/posts/478#1715"&gt;OpenRCE&lt;/a&gt; on some calculations he did following up on my post &lt;a href="http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html"&gt;Scanning data for entropy anomalies&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;He develops the algorithm aiming at improving the execution speed of the entropy "scanner" example I had shown. I ran through his steps and arrived to the same conclusions he did on his latest comment. I just thought it'd be worth showing his work as a separate post rather than just a comment.&lt;br /&gt;&lt;br /&gt;His idea is, by looking into the standard definition of  &lt;a href="http : // en.wikipedia.org/wiki/Information_entropy]"&gt;entropy&lt;/a&gt; , to isolate all that doesn't change in the expression when the window slides and just update the entropy, instead of blindly recalculating it's value from scratch for each offset of the scan window.&lt;br /&gt;&lt;br /&gt;Shannon' s entropy, usually represented as H, takes the following form if we work with the 256 possible byte values as the symbols : &lt;br /&gt;&lt;br /&gt;&lt;img src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAPYcByI/AAAAAAAAAqk/TZmk7wHTGCU/s400/Scanning+data+for+entropy+anomalies+II_1.gif"  alt=""id="BLOGGER_PHOTO_ID_5083874589639706402" /&gt;&lt;br /&gt;&lt;br /&gt;where p(b) is the probability of the occurrence of a given byte.&lt;br /&gt;&lt;br /&gt;H, the entropy, will tend towards its maximum value, 8, if the data has the maximum possible entropy. In such case the probability of each byte occurring would be the same &lt;img src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAPYcBzI/AAAAAAAAAqs/QMrKfD8Asis/s400/Scanning+data+for+entropy+anomalies+II_2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874589639706418" /&gt; which produces &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAPYcB0I/AAAAAAAAAq0/28VraTGCP08/s1600-h/Scanning+data+for+entropy+anomalies+II_3.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAPYcB0I/AAAAAAAAAq0/28VraTGCP08/s400/Scanning+data+for+entropy+anomalies+II_3.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874589639706434" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note that, although this is usually thought of as measuring the "amount of randomness", it is not that much the case. A sequence of bytes starting at 0 and increasing until 255 going through all the values in order would reach the maximum entropy value 8, even that it is all but random.&lt;br /&gt;&lt;br /&gt;The probability &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAfYcB1I/AAAAAAAAAq8/7vqP-tz_EyY/s1600-h/Scanning+data+for+entropy+anomalies+II_4.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAfYcB1I/AAAAAAAAAq8/7vqP-tz_EyY/s400/Scanning+data+for+entropy+anomalies+II_4.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874593934673746" /&gt;&lt;/a&gt; of a given byte appearing in our window can also be expressed as &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAfYcB2I/AAAAAAAAArE/eouOPHgsAtM/s1600-h/Scanning+data+for+entropy+anomalies+II_5.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAfYcB2I/AAAAAAAAArE/eouOPHgsAtM/s400/Scanning+data+for+entropy+anomalies+II_5.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874593934673762" /&gt;&lt;/a&gt;. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB3I/AAAAAAAAArM/MJZfxrvvV1w/s1600-h/Scanning+data+for+entropy+anomalies+II_6.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB3I/AAAAAAAAArM/MJZfxrvvV1w/s400/Scanning+data+for+entropy+anomalies+II_6.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874868812580722" /&gt;&lt;/a&gt; being the number of times the byte appears within the window and &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB4I/AAAAAAAAArU/Gqgh5vvCiBY/s1600-h/Scanning+data+for+entropy+anomalies+II_7.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB4I/AAAAAAAAArU/Gqgh5vvCiBY/s400/Scanning+data+for+entropy+anomalies+II_7.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874868812580738" /&gt;&lt;/a&gt; the width of the window.&lt;br /&gt;&lt;br /&gt;The expression for the entropy can be expanded as follows&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB5I/AAAAAAAAArc/ER0veYLaS5A/s1600-h/Scanning+data+for+entropy+anomalies+II_8.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQfYcB5I/AAAAAAAAArc/ER0veYLaS5A/s400/Scanning+data+for+entropy+anomalies+II_8.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874868812580754" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The entropy after sliding the window, &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQvYcB6I/AAAAAAAAArk/LDc_rZv2TLo/s1600-h/Scanning+data+for+entropy+anomalies+II_9.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQvYcB6I/AAAAAAAAArk/LDc_rZv2TLo/s400/Scanning+data+for+entropy+anomalies+II_9.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874873107548066" /&gt;&lt;/a&gt;, will have the same sum expansion except for two terms, the ones of the bytes going out and entering the window. We can then just update those and recalculate the expression by first removing the old values for the incoming and outgoing bytes and then adding the new values for both, after updating their count.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQvYcB7I/AAAAAAAAArs/sIMhtmKib6s/s1600-h/Scanning+data+for+entropy+anomalies+II_10.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Ro2NQvYcB7I/AAAAAAAAArs/sIMhtmKib6s/s400/Scanning+data+for+entropy+anomalies+II_10.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083874873107548082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and that's all. Now on to some implementations in Mathematica and Python (but creating a Mathematica function with &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt;). His implementation in C can be found in &lt;a href="http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html#comments"&gt;the comments&lt;/a&gt; of the previous post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;EntropyScan = Function[{Data, WindowScanSize},&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;SummationTerm [Prob_] := If[Prob &gt; 0, Prob Log[2, Prob], 0];&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Get the initial chunk and calculate the entropy *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;CurrentChunk = Data[[ Range[1, WindowScanSize] ]];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Calculate initial byte count and probabilities *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;ByteCounts = Table[Count[CurrentChunk, i - 1], {i, 1, 256}];&lt;br /&gt;&amp;nbsp;&amp;nbsp;ByteProbs = Table[ByteCounts[[i]]/WindowScanSize, {i, 1, 256}];&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;FilteredByteProbs = Select[ByteProbs, # &gt; 0 &amp;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;H = - Total[&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Table[FilteredByteProbs[[i]] Log[2, FilteredByteProbs[[i]]],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{i, 1, Length[FilteredByteProbs]}]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;Entropies = {H};&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Slide the window and recalculate for incoming and outgoing bytes *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;For[offset = 1, offset + WindowScanSize &lt;= Length[Data], offset++,&lt;br /&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Get incoming and outgoing bytes *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteOut = Data[[offset]] + 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteIn = Data[[offset + WindowScanSize]] + 1;&lt;br /&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Get the old probabilities *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OldValByteOut = SummationTerm[ByteProbs[[ByteOut]]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OldValByteIn = SummationTerm[ByteProbs[[ByteIn]]];&lt;br /&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Update counters and values *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteCounts[[ByteOut]]--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteCounts[[ByteIn]]++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteProbs[[ByteOut]] = ByteCounts[[ByteOut]]/WindowScanSize;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteProbs[[ByteIn]] = ByteCounts[[ByteIn]]/WindowScanSize;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Get the new probabilities *)&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValByteOut = SummationTerm[ByteProbs[[ByteOut]]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValByteIn = SummationTerm[ByteProbs[[ByteIn]]];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;(* Update the entropy *)&lt;/b&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;H = H + OldValByteOut + OldValByteIn - ValByteIn - ValByteOut;&lt;br /&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Entropies = Append[Entropies, H];&lt;br /&gt;&amp;nbsp;&amp;nbsp;];&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;Entropies&lt;br /&gt;];&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;Py["import math"]&lt;br /&gt;&lt;br /&gt;EntropyScanPython = PyFunction["\&lt;&lt;br /&gt;def entropy_scan(args):&lt;br /&gt;&amp;nbsp;&amp;nbsp;data = args[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;window_size = float(args[1])&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;summation_term = lambda p: p*math.log(p,2) if p&gt;0 else 0&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;current_chunk = data[:int(window_size)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;byte_counts = [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;len(filter(lambda a:a==i, current_chunk))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for i in range(256)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;byte_probs = [byte_counts[i]/window_size for i in range(256)]&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;H = -sum(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[byte_probs[i]*math.log(byte_probs[i], 2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for i in range(256) if byte_probs[i]&gt;0])&lt;br /&gt;&amp;nbsp;&amp;nbsp;entropies = [H]&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;for offset in range(len(data)-window_size):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte_out, byte_in = data[offset], data[int(offset+window_size)]&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;old_val_byte_out = summation_term(byte_probs[byte_out])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;old_val_byte_in = summation_term(byte_probs[byte_in])&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte_counts[byte_out] -= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte_counts[byte_in] += 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte_probs[byte_out] = byte_counts[byte_out]/window_size;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte_probs[byte_in] = byte_counts[byte_in]/window_size;&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val_byte_out = summation_term(byte_probs[byte_out])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val_byte_in = summation_term(byte_probs[byte_in])&lt;br /&gt;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;H = H + old_val_byte_out + old_val_byte_in - val_byte_out - val_byte_in&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;entropies.append(H)&lt;br /&gt;&amp;nbsp;&amp;nbsp;return entropies&lt;br /&gt;\&gt;"];&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3430530282762778052?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3430530282762778052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3430530282762778052' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3430530282762778052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3430530282762778052'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/scanning-data-for-entropy-anomalies-ii.html' title='Scanning data for entropy anomalies II'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/Ro2NAPYcByI/AAAAAAAAAqk/TZmk7wHTGCU/s72-c/Scanning+data+for+entropy+anomalies+II_1.gif' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2647595177517025735</id><published>2007-07-04T10:34:00.001+02:00</published><updated>2007-07-04T11:00:18.557+02:00</updated><title type='text'>iPhone restore image on the loose</title><content type='html'>Just getting my morning coffee and browsing through the news feeds I bumped into a post  pointing to the &lt;a href="http://www.osxbook.com/blog/2007/07/01/iphone-restore-image/"&gt;iPhone's restore image&lt;/a&gt;. Apparently it's been making the rounds for a couple of days already.&lt;br /&gt;&lt;br /&gt;On July 2nd there was a &lt;a href="http://seclists.org/fulldisclosure/2007/Jul/0014.html"&gt;thread on Full Disclosure&lt;/a&gt; already discussing the contents. Of special interest seems the password protected 82MB image "694-5262-39.dmg", likely to contain the whole of iPhone's software. People seem to be already attempting to crack it open. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RotfWvYcBrI/AAAAAAAAApU/ldtMVx9gpiA/s1600-h/IMG_0546.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RotfWvYcBrI/AAAAAAAAApU/ldtMVx9gpiA/s400/IMG_0546.jpg" border="0" alt="iPhone madness in San Francisco Apple Store"id="BLOGGER_PHOTO_ID_5083261448698463922" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also a couple of UNIX passwords for two user accounts &lt;a href="http://www.builderau.com.au/blogs/byteclub/viewblogpost.htm?p=339270810"&gt;were cracked&lt;/a&gt; but that might be of limited use.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RotfW_YcBsI/AAAAAAAAApc/0nVo9SOg1cc/s1600-h/IMG_0562.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RotfW_YcBsI/AAAAAAAAApc/0nVo9SOg1cc/s400/IMG_0562.jpg" border="0" alt="iPhone madness in San Francisco Apple Store"id="BLOGGER_PHOTO_ID_5083261452993431234" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The photos are from the iPhone launch in San Francisco on the 28th of June. That was something worth seeing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2647595177517025735?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2647595177517025735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2647595177517025735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2647595177517025735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2647595177517025735'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/iphone-image.html' title='iPhone restore image on the loose'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/RotfWvYcBrI/AAAAAAAAApU/ldtMVx9gpiA/s72-c/IMG_0546.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6015589888414197001</id><published>2007-07-03T23:53:00.000+02:00</published><updated>2007-07-04T00:09:46.991+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='economics'/><title type='text'>Talk and visualization of third world statistics by Hans Rosling</title><content type='html'>A friend just pointed me to a &lt;a href="http://www.ted.com/talks/view/id/92"&gt;great talk, titled &lt;i&gt;"Debunking third-world myths with the best stats you've ever seen"&lt;/i&gt;,&lt;/a&gt; by &lt;a href="http://en.wikipedia.org/wiki/Hans_Rosling"&gt;Hans Rosling&lt;/a&gt;, the founder of &lt;a href="http://www.gapminder.org/"&gt;Gapminder&lt;/a&gt;.&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;!--cut and paste--&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="285" id="VE_Player" align="middle"&gt;&lt;param name="movie" value="http://static.videoegg.com/ted/flash/loader.swf"&gt;&lt;PARAM NAME="FlashVars" VALUE="bgColor=FFFFFF&amp;file=http://static.videoegg.com/ted/movies/HANSROSLING_high.flv&amp;autoPlay=false&amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;forcePlay=false&amp;logo=&amp;allowFullscreen=true"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="wmode" value="window"&gt;&lt;embed src="http://static.videoegg.com/ted/flash/loader.swf" FlashVars="bgColor=FFFFFF&amp;file=http://static.videoegg.com/ted/movies/HANSROSLING_high.flv&amp;autoPlay=false&amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;forcePlay=false&amp;logo=&amp;allowFullscreen=true" quality="high" allowScriptAccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" width="320" height="285" name="VE_Player" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;I like their dynamic visualization of statistical data. In my opinion, adding the time dimension to the data definitely allows to extract a better understanding of the evolution of the systems under study, and this is an excellent example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6015589888414197001?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6015589888414197001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6015589888414197001' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6015589888414197001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6015589888414197001'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/07/talk-and-visualization-of-third-world.html' title='Talk and visualization of third world statistics by Hans Rosling'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4245979712665315501</id><published>2007-06-29T07:58:00.000+02:00</published><updated>2007-06-29T18:47:51.609+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linguistics'/><title type='text'>The Powerset Demo Day</title><content type='html'>I just had the luck of being invited, together with forty other people, to the first public demo of what the guys at &lt;a href="http://www.powerset.com/"&gt;Powerset&lt;/a&gt; are building up. The demo was in their headquarters in San Francisco. It was fairly impressive, to put it mildly.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RoUxX_YcBqI/AAAAAAAAApI/ZMHHE6j7CZ8/s1600-h/Powerset+HQs.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RoUxX_YcBqI/AAAAAAAAApI/ZMHHE6j7CZ8/s400/Powerset+HQs.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5081522042778158754" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;They showed demos of all what they've been blogging about, like &lt;a href="http://blog.powerset.com/2007/6/22/who-proved-fermats-last-theorem"&gt;this&lt;/a&gt; or &lt;a href="http://blog.powerset.com/2007/6/16/what-did-steve-jobs-say-about-the-ipod"&gt;this&lt;/a&gt; and some other new applications.&lt;br /&gt;&lt;br /&gt;I also had a chance to talk to some of the core &lt;a href="http://blog.powerset.com/2007/6/21/powerset-to-launch-front-end-on-ruby"&gt;Ruby developers&lt;/a&gt;, the search ranking engineers and the linguists working there and it's really an incredible team. One can smell the excitement floating in the air about what they do.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RoUxW_YcBoI/AAAAAAAAAo4/WuX7UEmDVJM/s1600-h/IMG_0535.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RoUxW_YcBoI/AAAAAAAAAo4/WuX7UEmDVJM/s400/IMG_0535.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5081522025598289538" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blognewcomb.com/blog/"&gt;Steve Newcomb&lt;/a&gt; and others commented on different sides of their technology and the company itself. &lt;a hef="http://deliberateambiguity.typepad.com/"&gt;Mark Johnson&lt;/a&gt; introduced a &lt;i&gt;just out of the oven&lt;/i&gt; Powerlabs, to give a taste of what's coming in September. It'll be possible to generate mash-ups using their natural language processing and understanding technology which, in my humble opinion, I think it's going to truly open the doors to a new generation of clever semantic tools. They aim to being really open about their system and to let people interact with it. Another side in which they also want to be open is in their contribution back to the open source community from which they build a lot of their infrastructure.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RoUxXPYcBpI/AAAAAAAAApA/kjz914_20Ts/s1600-h/IMG_0537.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RoUxXPYcBpI/AAAAAAAAApA/kjz914_20Ts/s400/IMG_0537.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5081522029893256850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From seeing their demos, it really looks like they are are taking search, among other things, to a new level by not indexing keywords but actually indexing "concepts" that they extract by semantically parsing the searchable data. If they find "dog" in a sentence they will associate also "mammal", "animal", "pet" allowing for real abstraction when performing searches.&lt;br /&gt;They combine that with normal search ranking techniques to obtain impressive results. &lt;br /&gt;&lt;br /&gt;It really creates new ways of interacting with the data to be searched. Queries like "What politician died from a disease?" or "What disease killed a politician?" work flawlessly even when there are no references to die or kill in the text. Their natural language engine understands that "died from" equals to "killed by" and relates to "deceased" or "pass away". It really knows about those concepts abstractly and the semantic relations in the search query.&lt;br /&gt;&lt;br /&gt;Powerlabs, the social site aimed at letting people play with their technology that will be launched in September, already has more that 10000 members signed up , so definitely there's a growing community interested in their developments.&lt;br /&gt;&lt;br /&gt;During the Q&amp;A sessions some very interesting topics popped up, like support for multiple languages and detection and resistance to spam (or text created by different models in order to appear human generated). Also, the "understanding" that they obtain from parsing a sentece could allow to better spam filtering, not just by spotting more or less likely-to-be-spam words, but actually detecting incoherent meanings or just uninteresting topics... just imagine having messages in your inbox automatically clustered by their real meanings, without having to specify a single rule (emails dealing with this, emails dealing with that...). The applications are endless...&lt;br /&gt;&lt;br /&gt;I'm dying to play with it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4245979712665315501?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4245979712665315501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4245979712665315501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4245979712665315501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4245979712665315501'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/powerset-demo-day.html' title='The Powerset Demo Day'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/RoUxX_YcBqI/AAAAAAAAApI/ZMHHE6j7CZ8/s72-c/Powerset+HQs.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3209765087991027063</id><published>2007-06-22T19:15:00.000+02:00</published><updated>2007-08-23T20:01:15.703+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linguistics'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Powerset and the garden path</title><content type='html'>I've recently bumped again into &lt;a href="http://www.powerset.com/"&gt;Powerset&lt;/a&gt;. I had previously heard about them when they got some people from &lt;a href="http://www.parc.com/"&gt;PARC&lt;/a&gt; (if I remember correctly) and went into attempting to build something that I had always dreamed about. The guys at Powerset are tackling one of the hardest and most interesting (in my opinion) problems currently known, that is, helping computers process and "understand" natural language and use those results to make information more accessible. From my humble amateur-linguistic-aficionado point of view, they are doing it a great work there. Soon I will have a chance to see it live, first hand, and I can't wait.&lt;br /&gt;&lt;br /&gt;In one of their &lt;a href="http://blog.powerset.com/2007/6/18/search-engines-leaking-oil-for-holes"&gt;latest posts they discuss&lt;/a&gt; some ambiguities that arise from using words with &lt;a href="http://en.wikipedia.org/wiki/Homograph"&gt;several meanings&lt;/a&gt; in contexts where the least used of the meanings is taken into use, leading to misunderstandings.&lt;br /&gt;&lt;br /&gt;To put it in other terms, the problems arise when using the less known meanings of words  in a way that the brain is misled when starting to read a sentence and leads to misunderstand the subsequent words (which can also have several meanings which depend on how one understood the start of the sentence) .&lt;br /&gt;Normally, once the sentence has been read several times, the brain finally "switches" into the right interpretation of the different meanings of those words in a way that the whole construct becomes coherent.&lt;br /&gt;I personally see it as resembling the visual phenomena where the brain interprets specially crafted images in different ways, switching back and forth between their different interpretations, like in the &lt;a href="http://mathworld.wolfram.com/YoungGirl-OldWomanIllusion.html"&gt;Young Girl-Old Woman Illusion&lt;/a&gt;  or the &lt;a href="http://mathworld.wolfram.com/Rabbit-DuckIllusion.html"&gt;Rabbit-Duck&lt;/a&gt; one.&lt;br /&gt;&lt;br /&gt;In the case of these &lt;a href="http://en.wikipedia.org/wiki/Garden_path_sentence"&gt;garden path&lt;/a&gt; sentences, as they are commonly called, the brain gets confused because of the dependencies between the words and their meanings.&lt;br /&gt;&lt;br /&gt;As the brain starts reading a sentence, it will attempt to predict what follows, and it's &lt;a href="http://www.languagehat.com/archives/000840.php"&gt;amazingly good&lt;/a&gt; at that. The trick is to throw it off track by using words with multiple meanings.&lt;br /&gt;&lt;br /&gt;In the example that they have as their post title "Search Engines Leaking Oil for Holes" the brain is tricked by taking the most common meaning of the first two words (a composite noun or &lt;a href="http://en.wikipedia.org/wiki/Collocation"&gt;collocation&lt;/a&gt;) and attempting to interpret it in a way that later becomes rather confusing when reaching "leaking oil".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnxOPOoHjLI/AAAAAAAAAH8/ovxzQFejyak/s1600-h/Powerset_pic1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnxOPOoHjLI/AAAAAAAAAH8/ovxzQFejyak/s400/Powerset_pic1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5079020503298444466" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Re-reading the sentence can lead to a second interpretation&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RnxOPeoHjMI/AAAAAAAAAIE/a_jZ4WxbIOs/s1600-h/Powerset_pic2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RnxOPeoHjMI/AAAAAAAAAIE/a_jZ4WxbIOs/s400/Powerset_pic2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5079020507593411778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In their post they ask how hard would be to find an automated way of generating such &lt;a href="http://en.wikipedia.org/wiki/Garden_path_sentence"&gt;garden path&lt;/a&gt; sentences and they describe a pseudo-algorithm like the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;You can make your own garden path sentences by following a few simple heuristics (...). The trick is to choose words that can act as both nouns and verbs, or as both adjectives and nouns, words like store, search, and post. Then follow the ambiguous word by another word that can take on more than one form. The hard part is to then add on another noun phrase that makes sense with the less common interpretation of the second word.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Trying to follow their heuristics, the first thing to do would be to find sets of words that can be both a noun and a verb or and adjective and a noun. Thanks to &lt;a href="http://wordnet.princeton.edu/"&gt;WordNet&lt;/a&gt;, &lt;a href="http://osteele.com/projects/pywordnet/index.html"&gt;PyWordNet&lt;/a&gt; and the mash-up of those and more provided by the guys from &lt;a href="http://nodebox.net/code/index.php/Linguistics"&gt;NodeBox&lt;/a&gt; that's not such a hard task as it would have otherwise been without such toolset.&lt;br /&gt;&lt;br /&gt;Sets of words fulfilling those requirements can be build in a few lines of Python.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;# Collect nouns, verbs and adjectives&lt;/i&gt;&lt;br /&gt;verbs = set( wordnet.V.keys() )&lt;br /&gt;nouns = set( wordnet.N.keys() )&lt;br /&gt;adjectives = set( wordnet.ADJ.keys() )&lt;br /&gt;&lt;br /&gt;&lt;i&gt;# Pick the ones that can work both as nouns and verbs or as nouns and adjectives&lt;/i&gt;&lt;br /&gt;noun_verbs = verbs.intersection(nouns)&lt;br /&gt;noun_adjectives = adjectives.intersection(nouns)&lt;br /&gt;&lt;br /&gt;print 'Found % d words that are both verbs and nouns' % len(noun_verbs)&lt;br /&gt;print 'Found % d words that are both adjectives and nouns' % len(noun_adjectives)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Found 4096 words that are both verbs and nouns&lt;br /&gt;Found 3138 words that are both adjectives and nouns&lt;/i&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;I will also need to have some means of knowing which words are more likely to follow a given one. For that I will reach into some datasets I collected years ago for some computational linguistics experiments I did. Using a small corpora of 2.071.007 sentences built out of books from the &lt;a href="http://www.gutenberg.org/wiki/Main_Page"&gt;Project Gutenberg&lt;/a&gt; and parsing it through some Python code I obtained 16.057.624 word pairs, 2.365.383 of them unique. That will provide me with some numbers on what words are likely to follow others.&lt;br /&gt;&lt;br /&gt;I can now look for frequently used words that can be both nouns and verbs. In the following line &lt;i&gt;"occurrences"&lt;/i&gt; is a list containing all the words and the number of times they appear. They are filtered to only show the ones that are both nouns and verbs.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;print [word for word in occurrences[:300] if word[0] in noun_verbs]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{{"be", 10070}, {"have", 7827}, {"like", 6577}, {"will", 6201}, {"out", 5422}, {"still", 4136}, {"even", 4049}, {"man", 3957}, {"can", 3866}, {"down", 3376}, {"see", 3104}, {"do", 3097}, {"time", 2729}, {"people", 2663}, {"well", 2602}, {"last", 2581}, {"back", 2337}, {"white", 2250}, {"make", 2088}, {"till", 2083}, {"come", 2048}, {"black", 2021}, {"general", 2004}, {"found", 1935}, {"light", 1918}, {"round", 1910}, {"go", 1880}, {"better", 1815}, {"face", 1755}, {"saw", 1742}, {"lay", 1740}, {"work", 1682}, {"form", 1678}, {"let", 1673}, {"right", 1654}, {"set", 1647}, {"lord", 1621}, {"look", 1579}, {"take", 1577}, {"hand", 1574}, {"head", 1546}, {"full", 1544}, {"best", 1538}, {"put", 1534}, {"state", 1531}, {"party", 1522}, {"love", 1517}, {"place", 1493}, {"house", 1491}, {"say", 1440}, {"get", 1401}, {"part", 1386}, {"water", 1385}, {"name", 1384}, {"second", 1370}, {"give", 1344}, {"felt", 1342}, {"present", 1327}, {"fell", 1320}, {"land", 1319}, {"use", 1311}}&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Now given a word it's possible to find other words that would often follow it and can also have several functions. For instance, lets see what comes out for &lt;i&gt;"look"&lt;/i&gt;:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;# Pick words following 'look' that can be both nouns and verbs&lt;/i&gt;&lt;br /&gt;succeeding_words = [p for p in word_sparse['look'].items () if p[0] in noun_verbs]&lt;br /&gt;&lt;i&gt;# Sort them by the most frequently used to the least&lt;/i&gt;&lt;br /&gt;succeeding_words.sort ( lambda a, b : -1 if a[1] &gt; b[1] else 0 if a[1] == b[0] else 1)&lt;br /&gt;print succeeding_words[: 100]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;"[('like', 255), ('out', 185), ('down', 124), ('back', 115), ('forward', 82), ('round', 49), ('well', 42), ('pale', 26), ('better', 16), ('black', 9), ('right', 7), ('full', 6), ('white', 5), ('blue', 5), ('grave', 5), ('even', 4), ('still', 4), ('double', 4), ('cross', 4), ('close', 3)]&lt;/i&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And the results for &lt;i&gt;"form"&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;[('name', 185), ('part', 18), ('can', 8), ('saint', 8), ('like', 7), ('see', 5), ('will', 5), ('state', 4), ('ice', 3), ('till', 3), ('lay', 3), ('french', 3), ('people', 3), ('found', 2), ('out', 2), ('put', 2), ('well', 2), ('note', 2), ('black', 2), ('starch', 2)]&lt;/i&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Although not being a native English speaker makes this a tiny bit more challenging, I can see how one could play with combinations like "look, like", "look, still", "look,  well", "form, name", "form, like", etc. to build slightly confusing sentences.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Collocation"&gt;Collocations&lt;/a&gt; also are great to mislead the brain whenever one of the words has more than a meaning ("visitor center", "search engines", "meeting point") . &lt;br /&gt;A quick hack to try to spot some automatically could be to look for pairs of words often appearing together and having the desired properties of fulfilling more than one function.&lt;br /&gt;But given the low quality results in the shown next; one could, for instance, also take into account the relative frequency of a noun-noun compound as compared to other pairings of the nouns, to try to see how much more often those two words appear together than with others. There's extensive literature on how to improve this and this was meant as a short-ish blog post after all.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;print [ p for p in word_pairs_occurrences[:10000] if en.is_noun(p[0][0]) and en.is_verb(p[0][0]) and en.is_noun(p[0][1]) and en.is_verb(p[0][1]) ]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{{will, be}, {can, be}, {labor, force}, {will, have}, {be, found}, {can, do}, {come, back}, {exchange, rate}, {will, do}, {will, make}, {can, read}, {prime, minister}, {will, go}, {will, give}, {have, come}, {come, out}, {go, back}, {right, hand}, {set, out}, {go, out}, {find, out}, {can, see}, {will, come}, {come, down}, {will, take}, {have, found}, {short, form}, {will, tell}, {birth, total}, {get, out}, {go, down}, {land, use}, {be, put}, {can, tell}, {father, brown}, {will, find}, {white, man}, {put, out}, {take, care}, {can, get}, {dare, say}, {will, see}, {can, make}, {be, well}, {short, time}, {can, have}, {found, out}, {lay, down}, {second, time}, {be, better}, {be, read}, {can, think}, {go, home}, {lord, will}, {birth, rate}, {hoist, side}, {meter, gauge}, {ftp, program}, {be, true}, {be, like}, {last, time}, {look, like}, {will, say}, {man, can}, {set, down}, {license, fee}, {come, home}, {can, find}, {make, out}, {put, down}, {give, notice}, {can, say}, {be, cut}, {take, place}, {low, voice}, {will, try}, {cast, out}, {get, index}, {have, put}, {lie, down}, {can, go}, {radio, relay}, {still, be}, {will, get}, {be, ready}, {well, be}, {wait, till}, {get, back}, {tax, return}, {free, copyright}, {fell, down}, {can, copy}, {set, bin}, {have, felt}, {look, out}, {be, out}, {form, name}, {satellite, earth}, {burst, out}, {will, keep}, {be, free}, {can, give}, {double, track}, {people, have}, {cut, down}, {will, show}, {fish, catch}, {turn, out}, {carry, out}, {well, have}, {work, force}, {be, set}, {have, set}, {miss, garland}, {will, put}, {can, take}, {do, well}, {let, go}, {mine, hand}, {earth, station}, {fell, back}, {take, heed}, {short, distance}, {air, force}, {can, help}, {will, help}, {cry, out}, {will, let}, {free, state}, {feel, like}, {will, cause}, {present, time}, {will, think}, {be, present}, {will, return}, {cast, down}, {black, man}, {narrow, gauge}, {bulletin, board}, {man, be}, {be, right}, {dry, tree}, {will, set}, {be, back}, {point, out}, {right, side}, {can, come}, {look, down}, {will, call}, {run, down}, {file, size}, {major, transport}, {labor, party}, {be, content}, {will, leave}, {man, will}, {will, look}, {can, use}, {need, be}}&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;Definitely the problem is very challenging with current tools, but it's always fun to give it a spin. With a few hours and limited tools I could only get to think of some ways to find good candidate words for &lt;i&gt;garden path&lt;/i&gt; sentences. Definitely nowhere close to actually completing full sentences.&lt;br /&gt;&lt;br /&gt;It would be great to expand on this toy research and make it actually useful and interesting. Using larger data sets (like &lt;a href="http://www.ldc.upenn.edu/Catalog/CatalogEntry.jsp?catalogId=LDC2006T13"&gt;this Google data set&lt;/a&gt;) from which to extract word relationships would be a good way to start. Having statistics for trigrams, fourgrams, etc. of words would make things better, having more contextual information would be possible to get more meaningful constructs by ensuring that the chosen words occur close within a small context.&lt;br /&gt;&lt;br /&gt;I can think of more ways of improving it, most of them involving large datasets and lots of computational power... gosh, I'm getting carried away thinking about this...&lt;br /&gt;&lt;br /&gt;Looking forward to &lt;a href="http://www.powerset.com/"&gt;Powerset&lt;/a&gt; letting people play with their tools, I' m sure that implementing ideas like the one discussed in this rant will become much easier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3209765087991027063?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3209765087991027063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3209765087991027063' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3209765087991027063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3209765087991027063'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/powerset-and-garden-path.html' title='Powerset and the garden path'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RnxOPOoHjLI/AAAAAAAAAH8/ovxzQFejyak/s72-c/Powerset_pic1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5563038042728047844</id><published>2007-06-14T23:31:00.000+02:00</published><updated>2007-06-30T01:07:00.007+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='bindiff'/><title type='text'>Safari 3.0.1 for Windows</title><content type='html'>Apple &lt;a href="http://www.macrumors.com/2007/06/14/safari-for-windows-updated-to-3-0-1/"&gt;released today&lt;/a&gt; an update for the recently unleashed &lt;a href="http://www.apple.com/safari/"&gt;Safari for Windows&lt;/a&gt; attempting to fix some of the problems &lt;a href="http://www.macrumors.com/2007/06/12/safari-beta-security-slammed;-8-vulnerabilities-found/"&gt;promptly uncovered&lt;/a&gt; after the inital release.&lt;br /&gt;&lt;br /&gt;I wanted to take a look at all the changes in the release. After comparing the hashes of all executable modules the following were identical to the ones included in Safari 3.0.0:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;coregraphics.dll, icudt36.dll, icuin36.dll, icuuc36.dll, libtidy.dll, libxml2.dll, libxslt.dll, javaplugin.jar, pthreadvc2.dll, sqlite3.dll, zlib1.dll&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Of all the remaining, whose hashes were different, the following proved to be structurally identical after running them through &lt;a href="http://www.sabre-security.com/products/bindiff.html"&gt;BinDiff&lt;/a&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;safariresources.dll, cfnetwork.dll, safaritheme.dll, pubsubdll.dll, npjavaplugin.dll, corefoundation.dll&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So that leaves us with the stuff to focus on:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;safari.exe and webkit.exe&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The dependencies between this modules are show in the following graph (green=identical hash, black=hash changed but structurally identical, red=the meat)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnG1t-oHjKI/AAAAAAAAAH0/jZ_OeAChPV4/s1600-h/Safari_modules.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnG1t-oHjKI/AAAAAAAAAH0/jZ_OeAChPV4/s400/Safari_modules.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5076038056533265570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Within those two modules, BinDiff finds a handful of functions changed, what could possibly have been fixed... ? ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5563038042728047844?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5563038042728047844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5563038042728047844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5563038042728047844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5563038042728047844'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/safari-301-for-windows.html' title='Safari 3.0.1 for Windows'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RnG1t-oHjKI/AAAAAAAAAH0/jZ_OeAChPV4/s72-c/Safari_modules.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4645900422803982047</id><published>2007-06-14T07:27:00.000+02:00</published><updated>2007-08-23T20:01:15.704+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><title type='text'>BinNavi: Simplifying code II. The implementation</title><content type='html'>Following up the ideas presented on a &lt;a href="http://blog.dkbza.org/2007/05/binnavi-dataflow-analysis-i-concept.html"&gt;previous post&lt;/a&gt;, this one will discuss their implementation.&lt;br /&gt;&lt;br /&gt;We wanted to write some code that would help us understand the meaning of certain operations encoded in assembly instructions. We wanted to do that by going through the instructions and building extended expressions representing the relations between the input and output values of a basic block.&lt;br /&gt;&lt;br /&gt;In order to implement the desired functionality, we will write some code to replace parts of the operand trees with existing, known values, from the already analyzed code. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;The code will iterate through the operand tree until it finds leafs (labeled as ’l’)&lt;/li&gt;&lt;li&gt;The leafs will then be substituted if their contents are known&lt;/li&gt;&lt;li&gt;The new, augmented, operand tree will be returned&lt;/li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The main part of this simple operand expression "builder" is to parse instructions and keep track of the values of the operands for the current instruction. If any values can be augmented by including the operations performed in previous instructions, those will be replaced by the result of such operations.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The function will take a dictionary (aka associative array) instance that will map the registers and memory addresses to their known contents&lt;/li&gt;&lt;li&gt;It will parse each instruction and update the dictionary according to the semantics of the opcode which in this example won't be totally accurate but will suffice to illustrate the process&lt;/li&gt;&lt;li&gt;It will return an updated dictionary with the results of tracking the values&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This first function will retrieve an operand tree and return it as a nested list.&lt;br /&gt;(&lt;i&gt;The code presented in this post makes use of BinNavi's Python scripting to access operands, instructions, etc&lt;/i&gt;)&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;# Retrieve an operand as nested lists&lt;br /&gt;#&lt;br /&gt;def get_optree(op, parent=None): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if not parent: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return get_optree(op, op.get_roots()[0])[0] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree = [] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;children = op.get_children(parent) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for child in children: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;subtree = get_optree(op, child) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if subtree: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree.append( [str(child), subtree] ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree.append( [’l’, str(child)] ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return tree&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And the result of running it on the following instructions will be:&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;004A4703: lea b4 ecx,b4 ss [ebp+4294967240] &lt;br /&gt;004A4706: push b4 26 &lt;br /&gt;004A4708: sub b4 eax,b4 ecx &lt;br /&gt;004A470A: pop b4 ecx &lt;br /&gt;004A470B: add b4 eax,b4 13 &lt;br /&gt;&lt;br /&gt;[[’l’, ’ecx’], &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[’ss’, [[’[’, [ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[’+’, [[’l’, ’ebp’], [’l’, ’4294967240’]]]]]]]] &lt;br /&gt;[[’l’, ’26’]] &lt;br /&gt;[[’l’, ’eax’], [’l’, ’ecx’]] &lt;br /&gt;[[’l’, ’ecx’]] &lt;br /&gt;[[’l’, ’eax’], [’l’, ’13’]] &lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;The following function is in charge of substituting any values in the tree for which  their content is known. For example, if &lt;b&gt;ecx&lt;/b&gt; is used as a source operand but in a previous instruction is was assigned a value of 10, we would substitute &lt;b&gt;ecx&lt;/b&gt; in the tree with 10.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;# Substitute the leafs in the operand tree&lt;br /&gt;# with the last values obtained during the&lt;br /&gt;# analysis&lt;br /&gt;#&lt;br /&gt;def substitute_leafs(tree, operand_trees): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if not isinstance(tree, list): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return tree &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if isinstance(tree[0], str) and tree[0]==’l’: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return operand_trees.get(str(tree), tree) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for idx, elm in enumerate(tree): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree[idx] = substitute_leafs(elm, operand_trees) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return tree &lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;The next function will be responsible for parsing the semantics of the instructions (in a merely illustrative way, it's far from implementing strictly the semantics of the Intel instructions used here). Instructions responsible for basic arithmetic and assignment operations will be processed and their results stored in the operand tree that we are processing.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;# Parse instructions&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;def parse_instruction(insn, stack, operand_trees=dict()):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;# Process the MOV instruction&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if insn.mnem == 'mov':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;# Get the operands&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = map(get_optree, insn.operands)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;# Perform substitutions for any known values&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;# Assing the source operand to the destination&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = src&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'add':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = map(get_optree, insn.operands)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst_expr = operand_trees.get(str(dst), dst)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src_expr = operand_trees.get(str(src), src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = ['+', [dst_expr, src_expr]]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'sub':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = map(get_optree, insn.operands)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst_expr = operand_trees.get(str(dst), dst)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src_expr = operand_trees.get(str(src), src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = ['+', [dst_expr, ['-', [src_expr]]]]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'lea':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = map(get_optree, insn.operands)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src_expr = operand_trees.get(str(src), src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = src[1][0][1][0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'push':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = ['l', 'STACK_TOP'], get_optree(insn.operands[0])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src_expr = operand_trees.get(str(src), src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stack.append(src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'pop':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst, src = get_optree(insn.operands[0]), ['l', 'STACK_TOP']&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = stack.pop()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = src&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'cdq':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif insn.mnem == 'idiv':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = get_optree(insn.operands[0])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# dst is always eax&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dst = ['l', 'eax']&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src = substitute_leafs(src, operand_trees)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;src_expr = operand_trees.get(str(src), src)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;orig_src = operand_trees.get(str(dst), dst)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(dst)] = ['*',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[orig_src, ['INV', [src_expr]]] ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_trees[str(['l', 'edx'])] = ['%',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[orig_src, ['mod', [src_expr]]] ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return operand_trees&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;After running the previous functions on a simple basic block, we will obtain operand trees representing the operations performed by the instructions on their operands.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RnDNIeoHjHI/AAAAAAAAAHc/V6D2_n5nVgo/s1600-h/basicblock.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RnDNIeoHjHI/AAAAAAAAAHc/V6D2_n5nVgo/s400/basicblock.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5075782325590527090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the end we can ask the value of a register and we will see, in a single extended expression, the value of the register as a result of all operations taking place in the basic block.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&amp;gt;&amp;gt;&amp;gt; operand_trees["['l', 'ecx']"]&lt;br /&gt;&lt;b&gt;['l', '(0x1A, 26)']&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; operand_trees["['l', 'al']"]&lt;br /&gt;&lt;b&gt;['ss',&lt;br /&gt;&amp;nbsp;&amp;nbsp;[['[', &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['+',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['l', 'ebp'],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['%',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['+',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['+',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['l', 'eax'],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['-', [['+', &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[['l', 'ebp'],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['l', 'lowercase_chars']]]]]]],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['l', '13']]],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['mod', [['l', '(0x1A, 26)']]]]],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;['l', 'lowercase_chars']]]]]]]&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;We can also graphically represent the result of the operand composition in BinNavi.&lt;br /&gt;The following function will traverse the operand tree and add the nodes to the graph instance provided.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;# Convert nested lists into a graph object&lt;br /&gt;# that can be visualized&lt;br /&gt;#&lt;br /&gt;def tree_to_graph(tree, g=Graph(), parent=None):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if isinstance(tree[1], list):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node_str = tree[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node = g.add_node(str(node_str))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if parent:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;g.add_edge(parent, node)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for child in tree[1]:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tree_to_graph(child, g, node)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;leaf = g.add_node(str(tree[1]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if parent:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;g.add_edge(parent, leaf)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return g&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And running it on one of the composed operand trees results in:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;tree_to_graph(operand_trees["['l', 'al']"], Graph()).show()&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RnDQD-oHjII/AAAAAAAAAHk/GijxYYUwy0A/s1600-h/operand_tree.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RnDQD-oHjII/AAAAAAAAAHk/GijxYYUwy0A/s400/operand_tree.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5075785546815999106" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;As a last step we can represent the expression textually and add it to the node.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;# Convert nested lists into a single expression as&lt;br /&gt;# a string&lt;br /&gt;#&lt;br /&gt; &lt;br /&gt;def tree_to_expression(tree):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;root = tree[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;children = tree[1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if isinstance(children, list):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parsed_children = [tree_to_expression(child) for child in children]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return children&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if root == '*':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return '(' + '*'.join(parsed_children) + ')'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == '+':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return '(' + '+'.join(parsed_children) + ')'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == '-':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return '(-' + parsed_children[0] + ')'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == '[':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return '[' + ' '.join(parsed_children) + ']'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == 'INV':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 'INV('+parsed_children[0]+')'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == 'mod':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return parsed_children[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == '%':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return '(' + parsed_children[0]+'%'+parsed_children[1] + ')'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == 'l':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return children&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elif root == 'ss':&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return parsed_children[0]&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;And running the following in BinNavi's Python interpreter will generate the expression and add it to the basic block as a comment in BinNavi's view.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;fgv = Graphview.get_open_views()[0]&lt;br /&gt;expr = tree_to_expression(operand_trees["['l', 'al']"])&lt;br /&gt;fgv.set_node_comment(0x4a4703L, expr)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnDRtOoHjJI/AAAAAAAAAHs/BUBc_0_PKjo/s1600-h/basicblock_cmt.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RnDRtOoHjJI/AAAAAAAAAHs/BUBc_0_PKjo/s400/basicblock_cmt.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5075787354997230738" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The resulting expression represents the ROT13 operation for lowercase characters. (The code belongs to the &lt;a href="http://en.wikipedia.org/wiki/Mydoom"&gt;Mydoom.D worm&lt;/a&gt;)&lt;br /&gt;&lt;b&gt;ebp+lowercase_chars&lt;/b&gt; points to a string containing the alphabet. &lt;b&gt;eax&lt;/b&gt; is the pointer to the character to encode/decode within the alphabet, and its position is calculated by subtracting the beginning address of the alphabet from &lt;b&gt;eax&lt;/b&gt;. Then 13 is added to it and wrapped around by getting the value modulo 26 and added again to the beginning of the alphabet to obtain the final decoded/encoded character.&lt;br /&gt;This expression is a nice and condensed form of expressing the functionality implemented in the basic block.&lt;br /&gt;&lt;br /&gt;This post illustrates the versatility of a properly abstracted representation of the operands and instructions and the level of automation that can be achieved in a relatively simple manner with the help of the interactive Python scripting in BinNavi.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4645900422803982047?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4645900422803982047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4645900422803982047' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4645900422803982047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4645900422803982047'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/binnavi-simplifying-code-ii.html' title='BinNavi: Simplifying code II. The implementation'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/RnDNIeoHjHI/AAAAAAAAAHc/V6D2_n5nVgo/s72-c/basicblock.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-7243823786141943983</id><published>2007-06-11T19:02:00.000+02:00</published><updated>2007-06-11T19:48:48.250+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>VxClass. Automated executable classification</title><content type='html'>Here at &lt;a href="http://sabre-security.com/"&gt;Sabre Security&lt;/a&gt;, we have been putting together a variety of technologies nurtured and developed over years of reverse engineering and malware analysis. All of it has taken form in VxClass, which is finally shaping up. We are quite proud and happy to see such a complex project (and one I've personally long dreamed about) actually working.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rm2B1eoHjFI/AAAAAAAAAHM/iQIKS7A_Lkw/s1600-h/vxclass_list.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rm2B1eoHjFI/AAAAAAAAAHM/iQIKS7A_Lkw/s400/vxclass_list.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5074855110870797394" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first incarnation of VxClass is already able to automatically handle (unpack, analyze and classify) a wide range of Windows malware. The results are nearly addictive to look at. Accompanying this post are some screen-shots of the Web interface showing a listing of files and the automatically generated cluster of families.&lt;br /&gt;&lt;br /&gt;VxClass will allow analysts or other tools to communicate with it and submit executable files. Those will be unpacked, analyzed and classified automatically according to their structural properties. The classification results as well as analysis databases can be retrieved through either an XMLRPC or a Web interface.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Rm2B1uoHjGI/AAAAAAAAAHU/OkGYb3_ke0A/s1600-h/vxclass_tree.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Rm2B1uoHjGI/AAAAAAAAAHU/OkGYb3_ke0A/s400/vxclass_tree.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5074855115165764706" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you or your company would be interested on evaluating it or discussing if it might be an applicable technology for you, don't hesitate in &lt;a href="mailto:info@sabre-security.com"&gt;dropping us a mail&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also, I'm in the Bay Area for most of June and August (also in &lt;a href="http://www.blackhat.com/html/bh-usa-07/train-bh-us-07-pa.html"&gt;Black Hat in Las Vegas&lt;/a&gt;). So if you want to have me demo it or chat about it, &lt;a href="mailto:ero.carrera@sabre-security.com"&gt;drop me a line&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-7243823786141943983?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/7243823786141943983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=7243823786141943983' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7243823786141943983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/7243823786141943983'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/vxclass-automated-executable.html' title='VxClass. Automated executable classification'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/Rm2B1eoHjFI/AAAAAAAAAHM/iQIKS7A_Lkw/s72-c/vxclass_list.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6954131882218826297</id><published>2007-06-09T00:19:00.000+02:00</published><updated>2007-06-09T00:48:31.169+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile and packer detection</title><content type='html'>I've always wanted some tool that I could run over large collections of executable files and would tell me what's packed and what's not and, ideally, also the packer. &lt;a href="http://www.secretashell.com/codomain/peid/"&gt;PEiD&lt;/a&gt; has wonderful signature libraries but my ideal tool would be easier to integrate with other components and not restricted to Windows.&lt;br /&gt;The guys at &lt;a href="http://www.offensivecomputing.net/"&gt;OffensiveComputing&lt;/a&gt; had put together some code to, by making use of &lt;a href="http://www.secretashell.com/codomain/peid/"&gt;PEiD&lt;/a&gt; &lt;a href="http://www.secretashell.com/PEiD/viewtopic.php?t=366"&gt;signatures&lt;/a&gt; and &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt;, recognize packers.&lt;br /&gt;&lt;br /&gt;I've decided that it's time for &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; to have such functionality by default and I've reimplemented the signature parsing and matching. The next version of &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; should include this new code.&lt;br /&gt;I've also found some pretty &lt;a href="http://www.secretashell.com/PEiD/viewtopic.php?t=366"&gt;extensive signature libraries&lt;/a&gt; and here are some of results of the test runs in some files I've laying around.&lt;br /&gt;&lt;br /&gt;Of the 48.025 files (all malware) that I scanned, in ~42% no packer could be found using the current signature database. In the remaining ~58% the tests found 227 different packers and compiler signatures.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RmnZ9uoHjEI/AAAAAAAAAHE/8tWLRKqvROM/s1600-h/PackerStatsPieChart.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RmnZ9uoHjEI/AAAAAAAAAHE/8tWLRKqvROM/s400/PackerStatsPieChart.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5073826109721119810" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A more extense listing of the most frequently found packers looks like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RmnZOeoHjDI/AAAAAAAAAG8/JmLP4Smtc2k/s1600-h/PackerStatsBarChart.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RmnZOeoHjDI/AAAAAAAAAG8/JmLP4Smtc2k/s400/PackerStatsBarChart.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5073825297972300850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Given that I've run pefile in several tens of thousands of pieces of malware with all kind of exotic PE format contortions, I've managed to find and fix a couple of obscure bugs. The forthcoming release will be even stronger when facing files that push the limits of the PE format well-formedness.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6954131882218826297?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6954131882218826297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6954131882218826297' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6954131882218826297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6954131882218826297'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/pefile-and-packer-detection.html' title='pefile and packer detection'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ppb6-5N0H80/RmnZ9uoHjEI/AAAAAAAAAHE/8tWLRKqvROM/s72-c/PackerStatsPieChart.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1655075935571039914</id><published>2007-06-08T11:20:00.000+02:00</published><updated>2007-06-08T11:34:59.240+02:00</updated><title type='text'>Cool train</title><content type='html'>Yesterday, on the way back from an exam in &lt;a href="http://en.wikipedia.org/wiki/Cologne"&gt;Cologne&lt;/a&gt;, my seat was just behind the cockpit on one of the &lt;a href="http://en.wikipedia.org/wiki/InterCityExpress"&gt;ICE trains&lt;/a&gt;. They look pretty sleek elsewhere in the train but the cockpit is nothing short of Star Trek. Although this trip was just from Cologne to &lt;a href="http://en.wikipedia.org/wiki/Bochum"&gt;Bochum&lt;/a&gt; and just takes an hour, in longer journeys (to &lt;a href="http://en.wikipedia.org/wiki/Frankfurt"&gt;Frankfurt&lt;/a&gt; for instance) this trains get to go nearly at 300 Km/h (~186 mph).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RmkhluoHjAI/AAAAAAAAAGk/tUbLjFWwTLk/s1600-h/IMG_0508.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RmkhluoHjAI/AAAAAAAAAGk/tUbLjFWwTLk/s400/IMG_0508.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5073623387264748546" /&gt;&lt;/a&gt;&lt;br /&gt;As well, they seem to be running trials of a wireless service and they had this cool live map with the current location.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rmkhl-oHjBI/AAAAAAAAAGs/Zik49LOhNnQ/s1600-h/IMG_0509.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rmkhl-oHjBI/AAAAAAAAAGs/Zik49LOhNnQ/s400/IMG_0509.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5073623391559715858" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1655075935571039914?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1655075935571039914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1655075935571039914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1655075935571039914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1655075935571039914'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/cool-train.html' title='Cool train'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ppb6-5N0H80/RmkhluoHjAI/AAAAAAAAAGk/tUbLjFWwTLk/s72-c/IMG_0508.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1996577380445858098</id><published>2007-06-01T11:13:00.001+02:00</published><updated>2007-06-01T11:17:38.048+02:00</updated><title type='text'>Parallels Desktop 3.0</title><content type='html'>The &lt;a href="http://www.parallels.com/"&gt;Parallels&lt;/a&gt; guys just announced the &lt;a href="http://www.parallels.com/en/products/desktop/upgrade"&gt;soon to come version 3.0&lt;/a&gt;. This one will have, among a good set of new and long awaited features, a snapshot manager. I can't wait for that, it's going to make my life so much easier.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://newweb.parallels.com/files/img/site_last/wwwupgrade/Snapshot%20Manager.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="http://newweb.parallels.com/files/img/site_last/wwwupgrade/Snapshot%20Manager.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1996577380445858098?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1996577380445858098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1996577380445858098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1996577380445858098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1996577380445858098'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/06/parallels-desktop-30.html' title='Parallels Desktop 3.0'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1105716946096695755</id><published>2007-05-31T12:28:00.000+02:00</published><updated>2007-05-31T12:39:01.556+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Useful VB IDC script</title><content type='html'>Pierre just posted in Datarescue's forum about an &lt;a href="http://www.datarescue.com/freefiles/vb.idc"&gt;IDC script&lt;/a&gt; for IDA contributed by Reginald Wong.&lt;br /&gt;The script will run through Visual Basic executables and parse a good deal of object and form information. This will probably be interesting for anybody having to reverse engineer VB applications in IDA.&lt;br /&gt;&lt;br /&gt;The script also points to some interesting resources:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.alex-ionescu.com/vb.pdf "&gt;Visual Basic Image Internal Structure Format&lt;/a&gt; by Alex Ionescu&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.reteam.org/papers/e46.pdf"&gt;Visual Basic Reversed - A decompiling approach&lt;/a&gt; by Andrea Geddon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1105716946096695755?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1105716946096695755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1105716946096695755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1105716946096695755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1105716946096695755'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/useful-vb-idc-script.html' title='Useful VB IDC script'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5908231268825100237</id><published>2007-05-24T15:52:00.000+02:00</published><updated>2007-05-24T16:05:43.814+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Google talk about reverse engeering to find security vulnerabilities</title><content type='html'>&lt;a href="http://video.google.com/videoplay?docid=-7185841369679533904"&gt;Great video of a Google talk&lt;/a&gt; by Alexander Sotirov on reverse engineering to find security vulnerabilities.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5908231268825100237?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5908231268825100237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5908231268825100237' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5908231268825100237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5908231268825100237'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/google-talk-about-reverse-engeering-to.html' title='Google talk about reverse engeering to find security vulnerabilities'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5167612704619600499</id><published>2007-05-21T22:45:00.000+02:00</published><updated>2007-05-21T23:06:41.694+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='economics'/><title type='text'>Inkling market on the GDP growth of China vs. Germany</title><content type='html'>One of the markets from all the interesting ones in &lt;a href="http://home.inklingmarkets.com/"&gt;inkling markets&lt;/a&gt; tries to &lt;a href="http://home.inklingmarkets.com/trades/new/18892"&gt;predict whether China's GDP  will grow beyond Germany's by 2008&lt;/a&gt; (not adjusted for &lt;a href="http://en.wikipedia.org/wiki/Purchasing_power_parity"&gt;PPP&lt;/a&gt;). My first reaction based on a very generic feeling I got from reading general media was of slight surprise that it wasn't already bigger, given all the incredible economic metrics China keeps pushing out. &lt;br /&gt;&lt;br /&gt;But taking a look at some historic data and doing some projections actually makes it seem quite difficult to happen, as Germany's economy is supposedly slowly picking up and rumors have it that China's economic growth will eventually cool down and flatten out. Even if all were to continue at its current rate, it does not seem all that likely that China's &lt;a href="http://en.wikipedia.org/wiki/Gross_Domestic_Product"&gt;GDP&lt;/a&gt; would surpass Germany still for a few years.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RlIIss_gZNI/AAAAAAAAAGc/bMOhc7rDUOE/s1600-h/GDP+China+vs+Germany.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RlIIss_gZNI/AAAAAAAAAGc/bMOhc7rDUOE/s400/GDP+China+vs+Germany.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5067122094830019794" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5167612704619600499?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5167612704619600499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5167612704619600499' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5167612704619600499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5167612704619600499'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/inkling-market-on-gdp-growth-of-china.html' title='Inkling market on the GDP growth of China vs. Germany'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/RlIIss_gZNI/AAAAAAAAAGc/bMOhc7rDUOE/s72-c/GDP+China+vs+Germany.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2319703526914327447</id><published>2007-05-20T16:33:00.000+02:00</published><updated>2007-08-23T20:01:15.704+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='ida2sql'/><title type='text'>ida2sql, exporting IDA's dissasemblies to SQL</title><content type='html'>Because &lt;a href="http://www.sabre-security.com/products/binnavi.html"&gt;BinNavi&lt;/a&gt; nowadays reads all the disassembly information from a SQL database, we needed some means of exporting the information to it. &lt;a href="http://dkbza.org/ida2sql.html"&gt;ida2sql&lt;/a&gt; is the result, it is a monster set of Python scripts I wrote (all nicely wrapped in a couple of files for easy installation) that will export the information from an IDB (only Intel, ARM and PPC so far. The latter two in experimental mode) into a MySQL database.&lt;br /&gt;It's available for &lt;a href="http://dkbza.org/ida2sql.html"&gt;download&lt;/a&gt; from my site together with installation and usage instructions. It needs the &lt;a href="http://d-dome.net/idapython/"&gt;IDAPython&lt;/a&gt; plug-in to run.&lt;br /&gt;&lt;br /&gt;Any feedback is welcome.&lt;br /&gt;&lt;br /&gt;I posted a while ago about the &lt;a href="http://blog.dkbza.org/2007/02/binnavi-database-format.html"&gt;database schema&lt;/a&gt;. One can do pretty neat things when having the dissasembly in such form...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2319703526914327447?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/2319703526914327447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=2319703526914327447' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2319703526914327447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2319703526914327447'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/ida2sql-exporting-idas-dissasemblies-to.html' title='ida2sql, exporting IDA&apos;s dissasemblies to SQL'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-2098155298486879889</id><published>2007-05-20T16:09:00.000+02:00</published><updated>2007-05-20T16:08:45.002+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile-1.2.5 released</title><content type='html'>Besides some small fixes the &lt;a href="http://dkbza.org/pefile.html"&gt;new release of pefile&lt;/a&gt; is able to report suspicious or malformed entries encountered while parsing. Any time that a non-critical (something that wouldn't prevent the file from running) problem is found it's added to a list of warnings that can be retrieved &lt;i&gt;get_warnings()&lt;/i&gt; or shown &lt;i&gt;show_warnings()&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Example warning messages:&lt;/h4&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 90%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Suspicious NumberOfRvaAndSizes in the Optional Header. Normal values are never larger than 0x10, the value is: 0xdfffddde&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 90%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Error parsing the import table. Invalid data at RVA: 0x400000&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Error parsing the Import directory. Invalid Import data at RVA: 0x60&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Error parsing export directory at RVA: 0x6c6c642e&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-2098155298486879889?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2098155298486879889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/2098155298486879889'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/pefile-125-released.html' title='pefile-1.2.5 released'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8396182199747031762</id><published>2007-05-15T19:43:00.000+02:00</published><updated>2007-08-23T20:01:15.705+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><title type='text'>BinNavi: Simplifying code</title><content type='html'>This in a slightly expanded example of what Halvar and I showed in the Sabre-Security   trainings last October. With it I illustrate how to, in &lt;a href="http://www.sabre-security.com/products/binnavi.html"&gt;BinNavi&lt;/a&gt;, build a small dataflow analyzer in Python so that it can do some work for us.&lt;br /&gt;&lt;br /&gt;Lets imagine that there's a basic block like the following, which is part of the &lt;a href="http://en.wikipedia.org/wiki/ROT13"&gt;ROT13&lt;/a&gt; routine in the &lt;a href="http://en.wikipedia.org/wiki/Mydoom"&gt;Mydoom&lt;/a&gt; worm.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RhQrv0tWpJI/AAAAAAAAAFE/AwC5lceWYTM/s1600-h/Target+basic+block.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RhQrv0tWpJI/AAAAAAAAAFE/AwC5lceWYTM/s400/Target+basic+block.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5049709182791885970" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ideally we would like to have such tool what would spare us from having to figure out what the assembly code in that block does, regardless of how simple it might be in this case. Such functionality would make analysis much less tedious and less error prone.&lt;br /&gt;&lt;br /&gt;Given that BinNavi offers an interactive Python interpreter with access to every single function, basic block, instruction, operand and expressions within an operand,  this is a problem that we could try to address with some scripting.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RhQtY0tWpKI/AAAAAAAAAFM/nK_LqN-H7Bc/s1600-h/NaviPython.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RhQtY0tWpKI/AAAAAAAAAFM/nK_LqN-H7Bc/s400/NaviPython.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5049710986678150306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The dataflow reconstruction&lt;/h4&gt;&lt;br /&gt;Assembly instructions move data around and modify it by performing different operations on it. Values are fetched from registers, memory or specified explicitly and the results are stored back in registers or memory.&lt;br /&gt;&lt;br /&gt;So, if we would like to be able to transform the operations into something more readable we could track all the assignments and operations and compose some sort of combined expression. That's actually much easier than it might sound like.&lt;br /&gt;&lt;br /&gt;Taking advantage of Python's dictionaries (aka hashes, aka associative arrays, aka maps) we could proceed as follows.&lt;br /&gt;&lt;br /&gt;We process individually each instruction. As each has different semantics, we have to deal with them individually (some groups of similar instructions can be handled somehow generically tho.).&lt;br /&gt;&lt;br /&gt;First the instruction might push or pop something from the stack and we could emulate that behaviour with a simple list.&lt;br /&gt;&lt;br /&gt;Second the instruction might get data from a source register/memory/immediate and, upon operating on it, assign it to a destination operand. We will just consider these two cases for the time being, this is only an exercise after all ;)&lt;br /&gt;&lt;br /&gt;In this case we could store in our dictionary the source item using as key the destination register or memory location. That would allow us to keep the current state of the registers and memory locations. For instance: &lt;b&gt;lea eax, [edi+2]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The destination of the &lt;b&gt;lea&lt;/b&gt; operation is &lt;b&gt;eax&lt;/b&gt; the source/result is &lt;b&gt;[edi+2]&lt;/b&gt;. Hence we could have an entry in our dictionary that maps &lt;b&gt;eax&lt;/b&gt; to &lt;b&gt;edi+2&lt;/b&gt;, there are no brackets here because &lt;b&gt;lea&lt;/b&gt; will store the value of the addition, not its contents, so we don't need the brackets (which stand for &lt;a href="http://en.wikipedia.org/wiki/Reference_(computer_science)"&gt;memory-dereference&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;If a register is accessed later on by another instruction and we know where the value comes from (because we stored the previous assignment operation in our dictionary) we could compose it together, having a combined expression that tracks all data. Following the example, imagine the instruction &lt;b&gt;mov bl, [eax+esi]&lt;/b&gt;, that will put into &lt;b&gt;bl&lt;/b&gt; the value pointed to by &lt;b&gt;[eax+esi]&lt;/b&gt;, in our dictionary we would map &lt;b&gt;bl&lt;/b&gt; to have the value &lt;b&gt;[eax+esi]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;But, if we would check if we have any of the expression parts already in our dictionary (remember that &lt;b&gt;eax&lt;/b&gt; maps to &lt;b&gt;edi+2&lt;/b&gt;) then we can expand &lt;b&gt;[eax+esi]&lt;/b&gt; into &lt;b&gt;[edi+2+esi]&lt;/b&gt;. One might be able to infer now that this procedure can be taken further, composing longer expressions that would reduce the amount and complexity of the assembly code to look at.&lt;br /&gt;&lt;br /&gt;As another illustrative example, one could assign the the &lt;b&gt;AL&lt;/b&gt; key in the dictionary the nested lists representing the expression tree for the memory reference as seen in the following figure.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RkI_tqKG0DI/AAAAAAAAAGE/7qkXJeoFt2I/s1600-h/Operand+Expression+Tree.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;"  src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RkI_tqKG0DI/AAAAAAAAAGE/7qkXJeoFt2I/s400/Operand+Expression+Tree.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5062678984761200690" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As just seen, operands are treated as graphs by BinNavi. That allows for a versatile manipulation of their contents. We can transform the tree to nested lists and operate on those.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;The form of the nested lists is&lt;/li&gt;&lt;br /&gt;[&lt;b&gt;root&lt;/b&gt; , [&lt;b&gt;child_1&lt;/b&gt; , &lt;b&gt;child_2&lt;/b&gt; , ...]] &lt;br /&gt;&lt;br /&gt;&lt;li&gt;Where each children has the same form&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;For instance, the following two operand trees&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RkJDd6KG0EI/AAAAAAAAAGM/Pu7hfktmT0E/s1600-h/Small+Operand+Expression+Trees.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RkJDd6KG0EI/AAAAAAAAAGM/Pu7hfktmT0E/s400/Small+Operand+Expression+Trees.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5062683112224772162" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;would take the following from as nested lists:&lt;br /&gt;&lt;br /&gt;[&lt;b&gt;b4&lt;/b&gt;, [&lt;b&gt;ecx&lt;/b&gt;]]&lt;br /&gt;&lt;br /&gt;[&lt;b&gt;b4&lt;/b&gt;, [&lt;b&gt;ss&lt;/b&gt;, [&lt;b&gt;'['&lt;/b&gt;, [&lt;b&gt;+&lt;/b&gt;, [&lt;b&gt;ebp&lt;/b&gt;], [&lt;b&gt;4294967240&lt;/b&gt;]]]]]&lt;br /&gt;&lt;br /&gt;In short, in order to do basic reconstruction of the data flow the following  operations need to be performed:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Keep track of all assigned values using a dictionary&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Substituting leafs with values already in our dictionary&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Perform substitutions and assign SRCs to DSTs hence updating the dictionary to the last state&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;In a following post, I'll show an implementation using BinNavi's embedded Python interpreter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8396182199747031762?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8396182199747031762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8396182199747031762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8396182199747031762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8396182199747031762'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/binnavi-dataflow-analysis-i-concept.html' title='BinNavi: Simplifying code'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/RhQrv0tWpJI/AAAAAAAAAFE/AwC5lceWYTM/s72-c/Target+basic+block.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6795117506577641064</id><published>2007-05-12T14:54:00.000+02:00</published><updated>2007-08-23T20:01:15.706+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pythonika'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Scanning data for entropy anomalies</title><content type='html'>&lt;b&gt;l0re&lt;/b&gt; &lt;a href="https://www.openrce.org/forums/posts/478"&gt;just asked&lt;/a&gt; the following question in the &lt;a href="https://www.openrce.org/"&gt;OpenRCE&lt;/a&gt; forums:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;I'm currently searching for a tool that does an entropy analyse. I want it to use it for finding a RSA key in a binary file. I have seen a tool that could do this on a workshop but unfortunately I don't know the name of tool and I can't find it with help of google. Does any one know the name of the tool or a tool that could do this?&lt;/blockquote&gt;&lt;br /&gt;I'm don't know of such tool from the top of my head although PEiD and OllyDBG both do statistical tests in order to detect possibly compressed/packed executables.&lt;br /&gt;&lt;br /&gt;But having to come up with such things is one of the reasons why I love &lt;a href="http://python.org/"&gt;Python&lt;/a&gt; and &lt;a href="http://wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt;+&lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt;. With both it's possible to put together, in a few minutes the desired functionality.&lt;br /&gt;&lt;br /&gt;So, the idea is to spot the typical high &lt;a href="http://en.wikipedia.org/wiki/Information_entropy"&gt;entropy&lt;/a&gt; that should be exhibited by something like a RSA key stored in binary form. Assuming that it's stored within data with significantly lower entropy, such as a standard executable file (that is, not packed or compressed itself), it should be easy to spot visually. Let's check...&lt;br /&gt;&lt;br /&gt;First we need a function that calculates the entropy of a given chunk of data. The following code will take a Python string and calculate it's byte entropy, returning a real number in the range 0.0 and 8.0.&lt;br /&gt;Values close to 8.0 would indicate a high entropy, hence the likelihood of compressed or otherwise highly random data. Low values would indicate low complexity data such as text or executable instructions or any other data exhibiting clear patterns.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 90%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;import math &lt;br /&gt;&lt;br /&gt;def H(data): &lt;br /&gt;&amp;nbsp;&amp;nbsp;if not data: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;entropy = 0 &lt;br /&gt;&amp;nbsp;&amp;nbsp;for x in range(256): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p_x = float(data.count(chr(x)))/len(data) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if p_x &gt; 0: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;entropy += - p_x*math.log(p_x, 2) &lt;br /&gt;&amp;nbsp;&amp;nbsp;return entropy&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Next we want to be able to take a chunk of data and run the entropy calculation function all across it, on byte increments, with a defined block size. Starting from the byte at offset 0, we will calculate the entropy of each data chunk of the given size and return it's value. The function is an iterator so that we can easily get a list of entropies for all offsets that we can next feed into a plotting function.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;def entropy_scan (data, block_size) :&lt;br /&gt;&amp;nbsp;&amp;nbsp;for block in (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data[x:block_size+x]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for x in range (len (data) - block_size) ):&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;yield H (block)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Now we need some test data, the following code will generate a low-entropy chunk of data 1024 bytes long, followed by a high-entropy one (assuming the random generator is good enough, which is the case for the example) also 1024 bytes long and closing with 1024 bytes more of low entropy data.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 100%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;data = ''.join ( &lt;br /&gt;&amp;nbsp;&amp;nbsp;[chr (random.randint (0, 64)) for x in xrange (1024)] +&lt;br /&gt;&amp;nbsp;&amp;nbsp;[chr (random.randint (0, 255)) for x in xrange (1024)] +&lt;br /&gt;&amp;nbsp;&amp;nbsp;[chr (random.randint (0, 64)) for x in xrange (1024)] )&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;If we run the Python code within Mathematica&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 70%; border: outset 2px gray; font-family: courier; font-size: 13px; text-align: left;"&gt;&lt;tr&gt;&lt;td&gt;ListPlot[ Py["\&lt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;list( &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;entropy_scan( data, 256 ) )&lt;br /&gt;\&gt;"] ]&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;we obtain the following plot&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RkW8gKKG0FI/AAAAAAAAAGU/-BAg66ceiWk/s1600-h/entropy_plot.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RkW8gKKG0FI/AAAAAAAAAGU/-BAg66ceiWk/s320/entropy_plot.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5063660616716570706" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;displaying a noticeable bump in the region where the higher entropy data lies within our test data.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Update:&lt;/h3&gt;&lt;a href="http://deadhacker.com/"&gt;Deadhacker&lt;/a&gt; has &lt;a href="http://deadhacker.com/2007/05/13/finding-entropy-in-binary-files/"&gt;posted an augmented version&lt;/a&gt; of my hack that does not rely on &lt;a href="http://wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt; in addition of being able to run on arbitrary files passed as arguments to his script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6795117506577641064?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6795117506577641064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6795117506577641064' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6795117506577641064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6795117506577641064'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html' title='Scanning data for entropy anomalies'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RkW8gKKG0FI/AAAAAAAAAGU/-BAg66ceiWk/s72-c/entropy_plot.jpg' height='72' width='72'/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8075081458078505115</id><published>2007-05-09T22:37:00.000+02:00</published><updated>2007-05-10T07:50:26.877+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><title type='text'>Training in BlackHat Tokyo</title><content type='html'>&lt;a href="http://dvlabs.tippingpoint.com/team/pamini"&gt;Pedram&lt;/a&gt; and I will be teaching our &lt;i&gt;Reverse Engineering on Windows: Application in Malicious Code Analysis&lt;/i&gt; training in the &lt;a href="http://www.blackhat.com/html/bh-japan-07/train-bh-jp-07-en-index.html"&gt;Black Hat Japan Spring Training 2007&lt;/a&gt; in Tokyo on May 28th and 29th.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RkH3MqKG0CI/AAAAAAAAAF8/gdyU029T1OA/s1600-h/Ero+and+Pedram.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;"  src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RkH3MqKG0CI/AAAAAAAAAF8/gdyU029T1OA/s400/Ero+and+Pedram.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5062599252988317730" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8075081458078505115?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8075081458078505115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8075081458078505115' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8075081458078505115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8075081458078505115'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/training-in-blackhat-tokyo.html' title='Training in BlackHat Tokyo'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/RkH3MqKG0CI/AAAAAAAAAF8/gdyU029T1OA/s72-c/Ero+and+Pedram.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6786375573527950257</id><published>2007-05-07T23:46:00.000+02:00</published><updated>2007-05-08T00:03:33.717+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><title type='text'>The Annapurna circuit the Google Earth way</title><content type='html'>I was playing a bit with Google Earth this evening.&lt;br /&gt;&lt;br /&gt;Threw in the GPS data I recorded during the trip, some pictures from the Google Earth community and got something like this.&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/illJMFWIhBg"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/illJMFWIhBg" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6786375573527950257?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6786375573527950257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6786375573527950257' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6786375573527950257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6786375573527950257'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/annapurna-circuit-google-earth-way.html' title='The Annapurna circuit the Google Earth way'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6098058940980531717</id><published>2007-05-07T15:11:00.000+02:00</published><updated>2007-05-08T00:03:09.756+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><title type='text'>Back from Nepal</title><content type='html'>What an incredible trip. Nepal and trekking along the &lt;a href="http://wikitravel.org/en/Annapurna_Circuit"&gt;Annapurna Circuit&lt;/a&gt; has been one of the greatest trips I've done.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rj8-JqKGz9I/AAAAAAAAAFU/hzccE4LeiYE/s1600-h/Green.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rj8-JqKGz9I/AAAAAAAAAFU/hzccE4LeiYE/s400/Green.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5061832841844150226" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The scenery, the people, the contrasts, the physical challenge and the remoteness made it quite an unforgettable experience. The pleasure of being away and cutting off from the daily routines, and everything in general, in such a drastic manner is something wonderful and truly difficult to value enough.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/Rj8-J6KGz-I/AAAAAAAAAFc/YHmTwphSZr4/s1600-h/Sunrises.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/Rj8-J6KGz-I/AAAAAAAAAFc/YHmTwphSZr4/s400/Sunrises.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5061832846139117538" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some random highlights and impressions of the trip were: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Kathmandu"&gt;Kathmandu&lt;/a&gt; is chaotic beyond belief (I've been told &lt;a href="http://en.wikipedia.org/wiki/Delhi"&gt;Delhi&lt;/a&gt; is even worse, need to see it to believe it)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Pokhara"&gt;Pokhara&lt;/a&gt; is an active "little" city, more pleasant than Kathmandu in my opinion, and very touristic (lots of treks start and end there)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The mountains are big enough to make words have a hard time to describe them&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;a href="http://en.wikipedia.org/wiki/Thorong_La"&gt;Thorong La pass&lt;/a&gt; is hard but totally doable if reasonably fit (the views of the &lt;a href="http://en.wikipedia.org/wiki/Mustang_district"&gt;Mustang valley&lt;/a&gt; during the descent are nothing short of breathtaking)&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rj8-KKKGz_I/AAAAAAAAAFk/P5Xo5N80CN8/s1600-h/Thorong+La.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rj8-KKKGz_I/AAAAAAAAAFk/P5Xo5N80CN8/s400/Thorong+La.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5061832850434084850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;When they say it's windy in the stretch from Muktinath to Jomsom they really mean it!&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://flickr.com/search/?q=tatopani&amp;w=all"&gt;Tatopani&lt;/a&gt; (meaning "hot water" for its hot springs) is a gorgeous, lovely little town, one must stop there&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Catching the sunrise from &lt;a href="http://www.peakware.com/peaks.html?pk=1378"&gt;Poon Hill&lt;/a&gt; is a must-do if one takes the path up to &lt;a href="http://www.nepal-dia.de/int__England/EV_Annapurna/EB_Gorepani/eb_gorepani.html"&gt;Gorepani&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Paragliding in Pokhara after the trek is a good way of wrapping up the trip&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/Rj9AhaKG0BI/AAAAAAAAAF0/Dypwwh2xVz0/s1600-h/Paragliding.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/Rj9AhaKG0BI/AAAAAAAAAF0/Dypwwh2xVz0/s400/Paragliding.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5061835448889298962" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Also... on the way back we had a long layover, 13 hours, in &lt;a href="http://en.wikipedia.org/wiki/History_of_Bahrain"&gt;Bahrain&lt;/a&gt; (Gulf Air were cool enough to give free hotel and transportation to Manama for the day!). The &lt;a href="http://en.wikipedia.org/wiki/Bahrain_National_Museum"&gt;National Museum&lt;/a&gt; is fairly good, the exhibit on the &lt;a href="http://en.wikipedia.org/wiki/Dilmun"&gt;Dilmun&lt;/a&gt; civilization is really enlightening.&lt;br /&gt;&lt;br /&gt;There are other curious pieces, like some mathematics book from the 18th century, apparently covering some geometry concepts.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rj9AhKKG0AI/AAAAAAAAAFs/A4eOH1RCMvk/s1600-h/Maths+in+the+museum.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/Rj9AhKKG0AI/AAAAAAAAAFs/A4eOH1RCMvk/s400/Maths+in+the+museum.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5061835444594331650" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've got hooked, now I must go back and do the Everest circuit trek...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6098058940980531717?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6098058940980531717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6098058940980531717' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6098058940980531717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6098058940980531717'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/05/back-from-nepal.html' title='Back from Nepal'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/Rj8-JqKGz9I/AAAAAAAAAFU/hzccE4LeiYE/s72-c/Green.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-15092606546420681</id><published>2007-04-08T00:50:00.000+02:00</published><updated>2007-05-08T00:04:30.008+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><title type='text'>Trekking in Nepal</title><content type='html'>In a matter of hours, after a probably short night sleep, I'll be traveling to Nepal, taking nearly a month off to go trekking in the Annapurna region. I'm sure it's going to be an incredible experience.&lt;br /&gt;&lt;br /&gt;I'll be back on the beginning of May.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-15092606546420681?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/15092606546420681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=15092606546420681' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/15092606546420681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/15092606546420681'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/04/trekking-in-nepal.html' title='Trekking in Nepal'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6553925630373194969</id><published>2007-04-03T22:50:00.000+02:00</published><updated>2007-08-23T20:01:15.706+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='idapython'/><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>IDAPython 0.9.0</title><content type='html'>Gergely Erdélyi has just put out the last release of IDAPython, 0.9.0&lt;br /&gt;&lt;br /&gt;It can be found &lt;a href="http://d-dome.net/idapython"&gt;in his site&lt;/a&gt; together with some &lt;a href="http://d-dome.net/idapython/oldernews"&gt;brief release notes&lt;/a&gt;. This release supports Python 2.5 among a good deal of other enhancements and additions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6553925630373194969?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6553925630373194969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6553925630373194969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6553925630373194969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6553925630373194969'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/04/idapython-090.html' title='IDAPython 0.9.0'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6759082786781427384</id><published>2007-03-20T09:06:00.000+01:00</published><updated>2007-03-21T08:38:23.257+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><title type='text'>A PE trick, the Thread Local Storage</title><content type='html'>In our training, when discussing packer's tricks and the PE file format, Pedram and I talk about different ways of executing code in a PE executable before the entry point (the one pointed to by the &lt;i&gt;AddressOfEntryPoint&lt;/i&gt; field of the Optional header) is given control by the Windows loader.&lt;br /&gt;&lt;br /&gt;One possible way of achieving it is to use the TLS directory entry of the PE file format's headers. TLS stands for &lt;a href="http://en.wikipedia.org/wiki/Thread-local_storage"&gt;Thread Local Storage&lt;/a&gt; and it's meant to be used to allocate storage for thread-specific data. The TLS structure, &lt;i&gt;IMAGE_TLS_DIRECTORY&lt;/i&gt;, pointed to by the TLS directory entry has a small number of fields. The one of special interest is the one pointing to a list of callbacks, &lt;i&gt;AddressOfCallBacks&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;During the class I got asked how one would implement the functionality required to get code to run, called from the TLS callbacks. I had a rough an idea how the implementation would go but had never tried implementing it myself. So before the training was over I started to look into it and finally, a few days later, got it to work. &lt;br /&gt;&lt;br /&gt;So, in order to put this together the first thing I did was to dig up the definition of the &lt;i&gt;IMAGE_TLS_DIRECTORY&lt;/i&gt; structure.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;table style="border: outset 2px gray; font-size: 12px;"&gt;&lt;tr&gt;&lt;td&gt;typedef struct _IMAGE_TLS_DIRECTORY {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UINT32   StartAddressOfRawData;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UINT32   EndAddressOfRawData;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PUINT32  AddressOfIndex;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PIMAGE_TLS_CALLBACK *AddressOfCallBacks;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UINT32   SizeOfZeroFill;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UINT32   Characteristics;&lt;br /&gt;} IMAGE_TLS_DIRECTORY, *PIMAGE_TLS_DIRECTORY;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Then I started hacking it together with a hexeditor, editing a harmless test PE file in order to have a TLS directory entry that would point to my manually hex-crafted structure.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfxylwFCwFI/AAAAAAAAAEg/ccYg7CW4L6w/s1600-h/PE+File,+TLS+construction+A.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfxylwFCwFI/AAAAAAAAAEg/ccYg7CW4L6w/s400/PE+File,+TLS+construction+A.png" border="0" alt="PE File, TLS construction A" id="BLOGGER_PHOTO_ID_5043031675634892882" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I then added some placeholder code&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table style="width: 50%; border: outset 2px gray; font-size: 12px;"&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;90&lt;br /&gt;90&lt;br /&gt;90&lt;br /&gt;C2 0C 00&lt;br /&gt;&lt;/i&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;nop&lt;br /&gt;nop&lt;br /&gt;nop&lt;br /&gt;retn 0x0c&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;which would handle the stack as a TLS callback is expected to&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;table style="border: outset 2px gray; font-size: 12px;"&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;typedef void (MODENTRY *PIMAGE_TLS_CALLBACK) ( PTR DllHandle, UINT32 Reason, PTR Reserved );&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;and pointed to it from the callback list I created. I then pointed the callback field, &lt;i&gt;AddressOfCallBacks&lt;/i&gt;, in the TLS structure to my callback list.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfxylwFCwGI/AAAAAAAAAEo/c9uSZMgGeBg/s1600-h/PE+File,+TLS+construction+B.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfxylwFCwGI/AAAAAAAAAEo/c9uSZMgGeBg/s400/PE+File,+TLS+construction+B.png" border="0" alt="PE File, TLS construction B" id="BLOGGER_PHOTO_ID_5043031675634892898" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And everything should be fine according to the plans... but nope!! and this is where I was stuck for a few days. The best I could do was to get my TLS callback code run on program unload, but never before the entry point was given control. Puzzling...&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;I dug out a file with a working TLS. Ilfak wrote a while ago about TLS &lt;a href="http://hexblog.com/2005/10/tls_callbacks.html"&gt;here&lt;/a&gt; and had a nice, small example. &lt;i&gt;(And, by the way, IDA does read and handle TLS just fine and marks them as entry points as well. Very convenient!)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I was set to get mine working, so I started looking at what his was doing different from mine (besides him just being sane and not doing it with a hex-editor ;-) )&lt;br /&gt;&lt;br /&gt;I took a look at all the PE headers but none of the differences seemed to have anything to do with my sample not working.&lt;br /&gt;&lt;br /&gt;I started to grow slightly uncomfortable and decided to bring in the artillery. Taking a look at how the windows loader (residing in NTDLL.DLL) handles both files and seeing what's affecting my TLS callback not being called should help. So I brought up &lt;a href="http://sabre-security.com/products/binnavi.html"&gt;BinNavi&lt;/a&gt; and traced the execution path of both binaries being loaded by Windows.&lt;br /&gt;&lt;br /&gt;First thing was to trace the execution of Ilfak's example, I wanted to see all functions visited in the windows loader as his executable was being loaded. The TLS callbacks would have to be called by one of these.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RfxylQFCwDI/AAAAAAAAAEQ/IYfMykbi1uY/s1600-h/Ilfak%27s+callgraph+trace.png"&gt;&lt;img style="border: solid 1px gray; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RfxylQFCwDI/AAAAAAAAAEQ/IYfMykbi1uY/s400/Ilfak%27s+callgraph+trace.png" border="0" alt="Ilfak's callgraph trace" id="BLOGGER_PHOTO_ID_5043031667044958258" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I then recorded the execution path of my test executable and took a look at what functions were being visited in both traces. (All the nodes in the following graph are visited by the working example, the green ones are the ones visited by mine, so there's a lot of superfluous code I can skip looking at)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfxylAFCwCI/AAAAAAAAAEI/Qr--N-z-TXk/s1600-h/Ilfak%27s+callgraph+trace+with+mine.png"&gt;&lt;img style="border: solid 1px gray; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfxylAFCwCI/AAAAAAAAAEI/Qr--N-z-TXk/s400/Ilfak%27s+callgraph+trace+with+mine.png" border="0" alt="Ilfak's callgraph trace with mine" id="BLOGGER_PHOTO_ID_5043031662749990946" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Eventually spotted a function called when processing both binaries, &lt;i&gt;_LdrpRunInitializeRoutines&lt;/i&gt;, that looked like a good candidate to be the one calling the TLS callbacks and took a look at the execution traces within that specific function.&lt;br /&gt;&lt;br /&gt;In the following graph each node represents a basic block, the red one is where the TLS callbacks are called from. That's the node reached in the working example but not in mine. The green nodes are all the ones visited in the case the execution flow reaches the red basic block. The darker ones are the execution trace of my test. Hence I need to figure out which conditions are diverting the execution flow and how they are related to things I could change in my test program.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RfxylgFCwEI/AAAAAAAAAEY/cgvaekkS9dI/s1600-h/Ilfak%27s+code+and+my+trace.png"&gt;&lt;img style="border: solid 1px gray; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RfxylgFCwEI/AAAAAAAAAEY/cgvaekkS9dI/s400/Ilfak%27s+code+and+my+trace.png" border="0" alt="Ilfak's code and my trace" id="BLOGGER_PHOTO_ID_5043031671339925570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now I could see the common parts of the execution path and a couple of branches that were taken differently. Given the visual output, it's extremely easy to see what branches were different and I could now check what affected the flow.&lt;br /&gt;&lt;br /&gt;The TLS callbacks were ran immediately after the following condition&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rf0hSAFCwHI/AAAAAAAAAEw/O0-vBkvq1HU/s1600-h/The+critical+branch.png"&gt;&lt;img style="border: solid 1px gray; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rf0hSAFCwHI/AAAAAAAAAEw/O0-vBkvq1HU/s400/The+critical+branch.png" border="0" alt="The critical branch"id="BLOGGER_PHOTO_ID_5043223750867337330" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Which, tracing it back, comes for an initial check at the beginning of the function&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/Rf0hSQFCwII/AAAAAAAAAE4/D5qQgkoKO3Y/s1600-h/The+initial+condition.png"&gt;&lt;img style="border: solid 1px gray; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/Rf0hSQFCwII/AAAAAAAAAE4/D5qQgkoKO3Y/s400/The+initial+condition.png" border="0" alt="The initial condition" id="BLOGGER_PHOTO_ID_5043223755162304642" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.microsoft.com/msj/0999/hood/hood0999.aspx"&gt;following article&lt;/a&gt; helped me when I was trying to figure out what was going on. According to it, the function &lt;i&gt;_LdrpClearLoad­InProgress&lt;/i&gt; returns the number of DLLs currently loaded. That's the value that gets assigned to the variable that gets compared to zero and makes the flow of my test program diverge from Ilfak's working example. Therefore TLS callbacks only get run when a given amount of DLLs have already been loaded and that was the reason my test didn't run on load... I only needed to add one mode DLL to the import table for it to work. Fortunately it was easy to spot with &lt;a href="http://sabre-security.com/products/binnavi.html"&gt;BinNavi&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thank you to &lt;i&gt;cailin&lt;/i&gt; for the proofreading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6759082786781427384?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6759082786781427384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6759082786781427384' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6759082786781427384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6759082786781427384'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/03/pe-trick-thread-local-storage.html' title='A PE trick, the Thread Local Storage'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/RfxylwFCwFI/AAAAAAAAAEg/ccYg7CW4L6w/s72-c/PE+File,+TLS+construction+A.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4954367391157707325</id><published>2007-03-12T23:21:00.000+01:00</published><updated>2007-03-14T09:47:46.653+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>Tiny (and crazy) PE</title><content type='html'>I did prepare a couple of new graphics for the &lt;a href="http://www.blackhat.com/html/bh-dc-07/train-bh-dc-07-pa.html"&gt;last training&lt;/a&gt; I taught with &lt;a href="http://pedram.redhive.com/blog/"&gt;Pedram&lt;/a&gt; in BlackHat DC.&lt;br /&gt;&lt;br /&gt;One of them was to illustrate a bit the structure of the header mess that leads to the small footprint of the executables in &lt;a href="http://www.phreedom.org/solar/"&gt;Solar Eclipse&lt;/a&gt;'s &lt;a href="http://www.phreedom.org/solar/code/tinype/"&gt;solution to the Tiny PE challenge&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think it's a good example of how flexible and tolerant the Windows loader is and why loading PE files is something that tends to break most tools when a file pushes the limits.&lt;br /&gt;&lt;br /&gt;I'll comment on some of the slides on this post without going into too much detail on how or why things work, that's well explained in Solar Eclipse's page. The general format is the same I use when doing the walk-through of the PE format's main headers in a &lt;i&gt;sane&lt;/i&gt; file in order to illustrate how the headers are laid out on the file itself.&lt;br /&gt;&lt;br /&gt;The red zeros in the following pictures mean data beyond the file size. That data is zeroed by Windows when the file is mapped in memory and Tiny PE relies on those zeros being there, as windows will try to access data in memory at that location, beyond the end of the file. If the memory wasn't zeroed first and contained random data it would be much harder to cook up the headers in the current "compressed" layout.&lt;br /&gt;&lt;br /&gt;This first shot just shows the DOS header and the &lt;i&gt;e_lfanew&lt;/i&gt; field. Which points to the the start of the NT headers.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfXc0gnn_TI/AAAAAAAAADY/WznkRIn8ydo/s1600-h/Tiny+PE+Visual+Inspection+01.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfXc0gnn_TI/AAAAAAAAADY/WznkRIn8ydo/s400/Tiny+PE+Visual+Inspection+01.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178152578579762" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The &lt;i&gt;e_lfanew&lt;/i&gt; field contains 4, which is the offset within the file where the NT headers can be found. That's in the middle of what would otherwise be the DOS header. In the shot of NT headers we can see some of its fields.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RfXc1Ann_UI/AAAAAAAAADg/GqfrPpc6cOg/s1600-h/Tiny+PE+Visual+Inspection+02.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RfXc1Ann_UI/AAAAAAAAADg/GqfrPpc6cOg/s400/Tiny+PE+Visual+Inspection+02.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178161168514370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The NT headers contain the File and Optional headers, the next picture shows some of the fields constituting the Optional header.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfXc1Qnn_VI/AAAAAAAAADo/-aKfvasvzWo/s1600-h/Tiny+PE+Visual+Inspection+03.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfXc1Qnn_VI/AAAAAAAAADo/-aKfvasvzWo/s400/Tiny+PE+Visual+Inspection+03.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178165463481682" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As the last entry in the Optional Header one can find the array of data directories.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfXc1gnn_WI/AAAAAAAAADw/NmTn6cJHEZ0/s1600-h/Tiny+PE+Visual+Inspection+04.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RfXc1gnn_WI/AAAAAAAAADw/NmTn6cJHEZ0/s400/Tiny+PE+Visual+Inspection+04.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178169758448994" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, the loader would need to locate the section headers. These normally follow after the directories of the Optional header. But in this case, as it's illustrated in the following picture, they lay in what would be the middle of the Optional Header. The location of the section headers is calculated by adding the size of the Optional header (4) to its offset (0x1C). Amusingly enough, the Windows loader does not take into account the reported size of the optional header when it reads the header itself, but it does in order to find what follows.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RfXc1wnn_XI/AAAAAAAAAD4/i_BB_-xfyXA/s1600-h/Tiny+PE+Visual+Inspection+05.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RfXc1wnn_XI/AAAAAAAAAD4/i_BB_-xfyXA/s400/Tiny+PE+Visual+Inspection+05.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178174053416306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here are the fields of the section header...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfXdBQnn_YI/AAAAAAAAAEA/Y3ZKQBJ9z5c/s1600-h/Tiny+PE+Visual+Inspection+06.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RfXdBQnn_YI/AAAAAAAAAEA/Y3ZKQBJ9z5c/s400/Tiny+PE+Visual+Inspection+06.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5041178371621911938" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I haven't taken the time to illustrate the import directory and the couple of additional details missing (It's just left as an exercise of mental contortion for the reader...). The &lt;a href="http://www.phreedom.org/solar/code/tinype/"&gt;original text&lt;/a&gt; by &lt;a href="http://www.phreedom.org/solar/"&gt;Solar Eclipse&lt;/a&gt; provides with the rest of the info for the interested souls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4954367391157707325?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4954367391157707325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4954367391157707325' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4954367391157707325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4954367391157707325'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/03/tiny-and-crazy-pe.html' title='Tiny (and crazy) PE'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Ppb6-5N0H80/RfXc0gnn_TI/AAAAAAAAADY/WznkRIn8ydo/s72-c/Tiny+PE+Visual+Inspection+01.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5913214831390521570</id><published>2007-02-22T14:10:00.000+01:00</published><updated>2007-09-15T11:57:28.660+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile: parsing version information from the resources directory</title><content type='html'>A while ago I got some inquiries on how to go about reading the version information stored in PE files.&lt;br /&gt;&lt;br /&gt;I had an idea of it being just a bunch of unicode strings without much of a structure but to follow along the rest of the PE file format, it does indeed have some structure. The only inconvenient was to find proper resources on how to parse it as Microsoft's docs mainly amount to, understandably, "just use the API". I eventually found a couple of references where a parser for the version information stored with a Portable Executable's resources directory was implemented.&lt;br /&gt;&lt;br /&gt;After finally understanding how that information was stored, I added support in &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; so now a dictionary is conveniently returned whenever parseable version information exists in a PE file.&lt;br /&gt;&lt;br /&gt;Some of the links in which I based my parsing implementation are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/dll/showver.asp"&gt;Full parser in C&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationstructures/vs_versioninfo.asp"&gt;VS_VERSIONINFO structure definition&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationstructures/vs_fixedfileinfo.asp"&gt;VS_FIXEDFILEINFO structure definition&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationstructures/varfileinfo.asp"&gt;VarFileInfo structure definition&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationstructures/stringfileinfo.asp"&gt;StringFileInfo structure definition&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;From those last two links one can follow into definitions for the other structures.&lt;br /&gt;&lt;br /&gt;Now, before I forget how this all goes. The version info structure in composed of a list of substructures. Those substructures can be of &lt;i&gt;StringFileInfo&lt;/i&gt; or &lt;i&gt;VarFileInfo&lt;/i&gt; type. The former contains the usual textual information that can be seen on the &lt;i&gt;Version&lt;/i&gt; tab on the &lt;i&gt;Properties&lt;/i&gt; dialog for a PE image. The later specifies version information in a way that does not depend on the language and codepage.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rd2VWfC1lBI/AAAAAAAAADM/p6Ojbf5W9n0/s1600-h/Parallels+Picture.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/Rd2VWfC1lBI/AAAAAAAAADM/p6Ojbf5W9n0/s400/Parallels+Picture.png" alt="" id="BLOGGER_PHOTO_ID_5034344171993142290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;StringFileInfo&lt;/i&gt; contains a list of &lt;i&gt;StringTable&lt;/i&gt; structures and each of those contains a String structure. This last structure contains the &lt;i&gt;Key&lt;/i&gt;, &lt;i&gt;Value&lt;/i&gt; pairs that make for the textual version information.&lt;br /&gt;&lt;i&gt;VarFileInfo&lt;/i&gt; contains a list of &lt;i&gt;Var&lt;/i&gt; structures (although normally is only one) and each of those contains a list of pairs of Word values with version information.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;VS_VERSIONINFO(VS_FIXEDFILEINFO)&lt;ul&gt;&lt;li&gt;StringFileInfo&lt;ul&gt;&lt;li&gt;StringTable (LangID)&lt;ul&gt;&lt;li&gt;String&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;VarFileInfo&lt;ul&gt;&lt;li&gt;Var&lt;ul&gt;&lt;li&gt;WORD, WORD&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h4&gt;Example&lt;/h4&gt;If the file has version information, the following attributes will exist in the PE instance returned.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;VS_VERSIONINFO&lt;/b&gt; will contain the first three fields of the main structure: 'Length', 'ValueLength', and 'Type'&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;VS_FIXEDFILEINFO&lt;/b&gt; will hold the rest of the fields, accessible as sub-attributes: 'Signature', 'StrucVersion', 'FileVersionMS', 'FileVersionLS',&lt;br /&gt;'ProductVersionMS', 'ProductVersionLS', 'FileFlagsMask', 'FileFlags', 'FileOS', 'FileType', 'FileSubtype', 'FileDateMS', 'FileDateLS'&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;FileInfo&lt;/b&gt; is a list of all StringFileInfo and VarFileInfo structures.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;StringFileInfo&lt;/b&gt; structures will have a list as an attribute named 'StringTable' containing all the StringTable structures. Each of those structures contains a  dictionary 'entries' with all the key/value version information string pairs.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;VarFileInfo&lt;/b&gt; structures will have a list as an attribute named 'Var' containing all Var structures. Each Var structure will have a dictionary as an attribute named 'entry' which will contain the name and value of the Var.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table style="border: 1px solid grey;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;print hex(pe.VS_VERSIONINFO.Length)&lt;br /&gt;print hex(pe.VS_VERSIONINFO.Type)&lt;br /&gt;print hex(pe.VS_VERSIONINFO.ValueLength)&lt;br /&gt;&lt;br /&gt;print hex(pe.VS_FIXEDFILEINFO.Signature)&lt;br /&gt;print hex(pe.VS_FIXEDFILEINFO.FileFlags)&lt;br /&gt;print hex(pe.VS_FIXEDFILEINFO.FileOS)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for fileinfo in pe.FileInfo:&lt;br /&gt;&lt;br /&gt;  if fileinfo.Key == 'StringFileInfo':&lt;br /&gt;    for st in fileinfo.StringTable:&lt;br /&gt;      for entry in st.entries.items():&lt;br /&gt;        print '%s: %s' % (entry[0], entry[1])&lt;br /&gt;&lt;br /&gt;  if fileinfo.Key == 'VarFileInfo':&lt;br /&gt;    for var in fileinfo.Var:&lt;br /&gt;      print '%s: %s' % var.entry.items()[0]&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid grey; width: 432px; height: 325px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;0x35c&lt;br /&gt;0x0&lt;br /&gt;0x34&lt;br /&gt;&lt;br /&gt;0xfeef04bdL&lt;br /&gt;0x0&lt;br /&gt;0x4&lt;br /&gt;&lt;br /&gt;LegalCopyright: Mozilla Corporation&lt;br /&gt;InternalName: Firefox&lt;br /&gt;FileVersion: 1.8.1: 2006101023&lt;br /&gt;CompanyName: Mozilla Corporation&lt;br /&gt;LegalTrademarks: Firefox is a Trademark of The Mozilla Foundation.&lt;br /&gt;Comments:&lt;br /&gt;ProductName: Firefox&lt;br /&gt;ProductVersion: 2.0&lt;br /&gt;FileDescription: Firefox&lt;br /&gt;OriginalFilename: firefox.exe&lt;br /&gt;&lt;br /&gt;Translation: 0x0000 0x04b0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;This should come quite handy, for instance, to people interested in creating databases of version information of collections of DLLs and EXEs...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5913214831390521570?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5913214831390521570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5913214831390521570' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5913214831390521570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5913214831390521570'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/02/pefile-parsing-version-information-from.html' title='pefile: parsing version information from the resources directory'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/Rd2VWfC1lBI/AAAAAAAAADM/p6Ojbf5W9n0/s72-c/Parallels+Picture.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8645913270287594713</id><published>2007-02-22T13:50:00.000+01:00</published><updated>2007-05-18T14:13:45.343+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2.2</title><content type='html'>I've just released an update to &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt;. This new release includes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;pefile-1.2.2 can now correctly parse the files from the &lt;a href="http://www.phreedom.org/solar/code/tinype/"&gt;Tiny PE challenge&lt;/a&gt;, which pushes the limits of valid parsing&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Added support for parsing the version information structures in the resources directory&lt;/li&gt;, I'll blog about how to take advantage of this feature shortly&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Additional information and download links can be found in &lt;a href="http://dkbza.org/pefile.html"&gt;pefile's page&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8645913270287594713?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8645913270287594713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8645913270287594713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8645913270287594713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8645913270287594713'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/02/pefile-122.html' title='pefile 1.2.2'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5655206272423935823</id><published>2007-02-06T16:16:00.001+01:00</published><updated>2007-02-09T13:39:54.619+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><title type='text'>BinNavi database format</title><content type='html'>In the latest version of BinNavi we moved to SQL for storage of the disassembly information.&lt;br /&gt;&lt;br /&gt;We spent a fair amount of time thinking about how to best store the disassembly information in a way that would be as little architecture-dependent as possible and allow for fast querying while, at the same time, trying to not make it too hard to use directly through SQL.&lt;br /&gt;&lt;br /&gt;We also wanted to be able to have a central repository of all disassembly data, doing away with the need of keeping local databases that easily get out of sync. A central repository has other advantages like allowing for different users to look at the same project.&lt;br /&gt;&lt;br /&gt;The disassembly data is currently exported from IDA into the database via a exporter , &lt;b&gt;ida2sql&lt;/b&gt;, written in Python and requiring &lt;a href="http://d-dome.net/idapython"&gt;IDAPython&lt;/a&gt;. This exporter is included with BinNavi and also made available separately. &lt;i&gt;If you want to play with it just drops us a line at &lt;a href="mailto:info@sabre-security.com"&gt;Sabre&lt;/a&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;One can already perform interesting analysis by just using SQL queries directly, although we provide a lot of the functionality in a more convenient form through BinNavi's integrated Python interface.&lt;br /&gt;&lt;br /&gt;The core set of tables looks like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RcoBsAaC8dI/AAAAAAAAADA/3_vzxVXa0XI/s1600-h/BinNavi+DB.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RcoBsAaC8dI/AAAAAAAAADA/3_vzxVXa0XI/s400/BinNavi+DB.png" alt="BinNavi's database schema" id="BLOGGER_PHOTO_ID_5028833789447696850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The basic table layout is:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;modules&lt;/b&gt;, which holds the information about all the disassemblies in the database, the name of the file, the date it was imported and a comment field&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For each of the following the module id will be appended to the table name.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;functions&lt;/b&gt;, containing all the functions in the disassembly and specifying their address name and type&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;basic_blocks&lt;/b&gt;, all the basic blocks in the disassembly and their parent function&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;instructions&lt;/b&gt;, the instructions making the basic blocks. Contains the data making up the instruction together with its address, mnemonic and parent basic block&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;callgraph&lt;/b&gt; relates all callers and callees&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;control_flow_graph&lt;/b&gt; expresses all the links between basic blocks&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;operand_strings&lt;/b&gt; contains the operand strings as shown by IDA&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;expression_tree&lt;/b&gt; represents all expressions composing the operands as a tree&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;operand_tuples&lt;/b&gt; maps addresses to the operands used by the instruction at such location&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;expression_substitutions&lt;/b&gt; allows to replace any part of the expression tree of an operand with a string, variable names are handled through this table&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;operand_expressions&lt;/b&gt; relates the operands to the expressions composing them&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;address_references&lt;/b&gt; contains all references, both to code and data labeled with their type&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;sections&lt;/b&gt; holds the raw data for the section composing the binary source for the disassembly&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Currently only &lt;a href="http://mysql.com/"&gt;MySQL&lt;/a&gt; has been thoroughly tested. Some of the advantages the schema brings are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Supports multiple modules in a single database&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Instruction operands are stored as trees, which enables it to support a variety of architectures, efficient storage and advanced querying&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Use of SQL statements to perform advanced analysis and data-mining&lt;/li&gt;&lt;br /&gt; &lt;li&gt;The exporter module from IDA to the SQL schema currently supports METAPC(x86), PPC and ARM exporting (the latter two are still in beta). More will be added in the future. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h4&gt;Some query examples&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;Listing the modules in the database:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT * FROM modules&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;Counting the number of functions:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT count(address) FROM functions&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;Counting the number of basic blocks (blocks shared by functions will be counted multiple times):&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT count(address) FROM basic_blocks&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;and without counting the shared ones:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT count(DISTINCT(address)) FROM basic_blocks;&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;How about a histogram showing the of mnemonic distribution?&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT mnemonic, COUNT(mnemonic) as mnem_count FROM instructions GROUP BY mnemonic ORDER BY mnem_count;&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;or, 275&lt;br /&gt;inc, 361&lt;br /&gt;movzx, 377&lt;br /&gt;leave, 392&lt;br /&gt;sub, 403&lt;br /&gt;stos, 429&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;or something a bit more elaborate like getting all addresses in a disassembly where a specific register is used:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;SELECT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HEX(instructions.address), mnemonic&lt;br /&gt;FROM&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;instructions&lt;br /&gt;JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(operand_tuples, operand_expressions, expression_tree)&lt;br /&gt;ON&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;instructions.address = operand_tuples.address AND&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operand_tuples.operand_id = operand_expressions.operand_id AND&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expression_tree.id = operand_expressions.expr_id&lt;br /&gt;WHERE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;symbol='ebp';&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;71CF14D3, mov&lt;br /&gt;71CF14D6, mov&lt;br /&gt;71CF14E9, pop&lt;br /&gt;71CF15E1, push&lt;br /&gt;71CF15E2, mov&lt;br /&gt;71CF15E6, mov&lt;br /&gt;71CF1617, pop&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;for queries like the last one or more complex ones it's usually a good idea to move to the embedded Python interpreter in BinNavi before getting lost in SQL...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5655206272423935823?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5655206272423935823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5655206272423935823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5655206272423935823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5655206272423935823'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/02/binnavi-database-format.html' title='BinNavi database format'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ppb6-5N0H80/RcoBsAaC8dI/AAAAAAAAADA/3_vzxVXa0XI/s72-c/BinNavi+DB.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-6587833563124628079</id><published>2007-01-21T22:43:00.000+01:00</published><updated>2007-05-07T17:28:36.777+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='travel'/><title type='text'>In New York</title><content type='html'>I'll be in New York from the 27th until the 2nd of February. If someone wants to meet and go out for a beer or something and talk about &lt;a href="http://www.sabre-security.com/products/binnavi.html"&gt;BinNavi&lt;/a&gt;, &lt;a href="http://www.sabre-security.com/products/bindiff.html"&gt;BinDiff&lt;/a&gt; and what we do at &lt;a href="http://www.sabre-security.com/"&gt;Sabre-Security&lt;/a&gt; or just rant... drop me a line to &lt;i&gt;ero.carrera&lt;/i&gt; at gmail&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-6587833563124628079?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/6587833563124628079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=6587833563124628079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6587833563124628079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/6587833563124628079'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/01/in-new-york.html' title='In New York'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-3185967051615147344</id><published>2007-01-21T22:30:00.000+01:00</published><updated>2007-01-22T16:18:47.349+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Uninformed 6</title><content type='html'>The latest &lt;a href="http://uninformed.org/?v=6"&gt;Uninformed&lt;/a&gt; issue makes for a good read.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://uninformed.org/?v=6&amp;a=2&amp;t=sumry"&gt;Exploiting 802.11 Wireless Driver Vulnerabilities on Windows&lt;/a&gt; is  truly interesting. Considering how highly-sensitive something like wireless drivers are, it's just sad how breakable appear to be.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://uninformed.org/?v=6&amp;a=1&amp;t=sumry"&gt;Subverting PatchGuard Version 2&lt;/a&gt; is &lt;i&gt;Skywing&lt;/i&gt;'s the lastest effort on how to overcome Microsoft's integrity checking technology. It's nice to see how far Microsoft have come and yet quite amusing to see the holes they leave open...&lt;br /&gt;&lt;br /&gt;It also includes a &lt;a href="http://uninformed.org/?v=6&amp;a=3&amp;t=sumry"&gt;nice article&lt;/a&gt; from &lt;i&gt;skape&lt;/i&gt; on relocation tricks one can play with &lt;a href="http://en.wikipedia.org/wiki/Portable_Executable"&gt;PE files&lt;/a&gt;. Although some of those tricks have been around in malware for a while this is the first time I've seen a good write-up about how they work.&lt;br /&gt;&lt;br /&gt;Playing with relocations is a trick that Pedram and I always comment on in our training when teaching the PE file format. Speaking of which, &lt;i&gt;Pedram and I will be teaching our training, &lt;a href="http://blackhat.com/html/bh-dc-07/train-bh-dc-07-pa.html"&gt;Reverse Engineering on Windows: Application in Malicious Code Analysis&lt;/a&gt;, in &lt;a href="http://blackhat.com/html/bh-dc-07/bh-dc-07-index.html"&gt;BlackHat DC&lt;/a&gt;  on February 26-27&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-3185967051615147344?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/3185967051615147344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=3185967051615147344' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3185967051615147344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/3185967051615147344'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/01/uninformed-6.html' title='Uninformed 6'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5482463215649886089</id><published>2007-01-20T22:49:00.000+01:00</published><updated>2007-01-21T15:04:30.286+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='BinNavi'/><category scheme='http://www.blogger.com/atom/ns#' term='basic blocks'/><category scheme='http://www.blogger.com/atom/ns#' term='code opimization'/><title type='text'>BinNavi's basic block handling</title><content type='html'>A while back &lt;a href="http://blog.dkbza.org/2006/12/simply-blocks-basically.html"&gt;I talked about the problem&lt;/a&gt; of highly optimized code and the resulting problems when we want to store it in a database while allowing for all possible constructs.&lt;br /&gt;In this post I'll show how the recently released &lt;a href="http://www.sabre-security.com/products/binnavi.html"&gt;BinNavi 1.2&lt;/a&gt; handles some cases where code is shared among functions and basic blocks exhibit non-typical characteristics.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; &lt;i&gt;I could not get the Microsoft or Intel compilers to produce compiled code with functions sharing basic blocks as an example for this post. Using &lt;a href="http://msdn.microsoft.com/vstudio/tour/vs2005_guided_tour/VS2005pro/Framework/CPlusAdvancedProgramOptimization.htm"&gt;PGO (Profiling Guided Optimization)&lt;/a&gt; and other optimizations proved &lt;a href="http://www.stickyminds.com/sitewide.asp?Function=edetail&amp;ObjectType=ART&amp;ObjectId=7580"&gt;fun&lt;/a&gt; but the furthest I could go was producing multi-chunked functions. I might need to play more with it in order to get chunks to be shared... Anyway, I just picked a Microsoft DLL for the example. Specifically &lt;a href="http://www.google.com/search?q=wkssvc.dll"&gt;wkssvc.dll&lt;/a&gt;.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In this DLL there are two functions sharing some blocks on their exit paths. The shared code is shown in green in this graphic exported from &lt;i&gt;BinNavi&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RbKPywV25FI/AAAAAAAAACQ/8E6SR_G_fVs/s1600-h/Shared+basic+blocks,+BinNavi.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RbKPywV25FI/AAAAAAAAACQ/8E6SR_G_fVs/s400/Shared+basic+blocks,+BinNavi.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5022234636604335186" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Interestingly enough, those blocks share &lt;i&gt;exactly&lt;/i&gt; the same code but one function has six of them while the other has seven. I previously commented on the issue &lt;a href="http://blog.dkbza.org/2006/12/simply-blocks-basically.html"&gt;here&lt;/a&gt; and happends because of a reference in one of the functions that targets the shared code and causes a block to split. &lt;br /&gt;&lt;br /&gt;Here one can see the shared code grouped and highlighted. Click on the image for a larger view.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RbKRGwV25GI/AAAAAAAAACY/4-buFq1i7Ec/s1600-h/Shared+basic+blocks+zoomed,+BinNavi.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RbKRGwV25GI/AAAAAAAAACY/4-buFq1i7Ec/s400/Shared+basic+blocks+zoomed,+BinNavi.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5022236079713346658" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now a zoomed version of the block on the left:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RbKRHAV25HI/AAAAAAAAACg/lcz2uTGHVLE/s1600-h/Shared+basic+blocks+zoomed,+BinNavi+A.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RbKRHAV25HI/AAAAAAAAACg/lcz2uTGHVLE/s400/Shared+basic+blocks+zoomed,+BinNavi+A.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5022236084008313970" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And the one on the right:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RbKRHQV25II/AAAAAAAAACo/uFCmlqwoMEY/s1600-h/Shared+basic+blocks+zoomed,+BinNavi+B.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RbKRHQV25II/AAAAAAAAACo/uFCmlqwoMEY/s400/Shared+basic+blocks+zoomed,+BinNavi+B.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5022236088303281282" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Within the database, &lt;i&gt;BinNavi&lt;/i&gt; handles this by allowing instructions to belong to multiple basic blocks, as well as basic blocks to belong to multiple functions. And it just works...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5482463215649886089?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5482463215649886089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5482463215649886089' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5482463215649886089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5482463215649886089'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2007/01/binnavis-basic-block-handling.html' title='BinNavi&apos;s basic block handling'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RbKPywV25FI/AAAAAAAAACQ/8E6SR_G_fVs/s72-c/Shared+basic+blocks,+BinNavi.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-5900784355144234819</id><published>2006-12-12T01:27:00.000+01:00</published><updated>2007-01-21T15:05:55.842+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='basic blocks'/><title type='text'>Multi-chunked functions and IDA</title><content type='html'>In &lt;a href="http://nzight.blogspot.com/2006/12/simply-blocks-basically.html"&gt;my post a few days back&lt;/a&gt; I did mention the problem with shared basic blocks across functions and made the assumption that IDA could not handle them. It is the case, &lt;a href="http://hexblog.com/2006/12/heads_and_tails.html"&gt;as clarified by Ilfak&lt;/a&gt;, that IDA &lt;em&gt;can&lt;/em&gt; actually handle them, yet they are not currently assigned to multiple functions. IDA's plugin API even allows to iterate through the chunk's parent functions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-5900784355144234819?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/5900784355144234819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=5900784355144234819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5900784355144234819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/5900784355144234819'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/12/multi-chunked-functions-and-ida.html' title='Multi-chunked functions and IDA'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1307297173118980786</id><published>2006-12-11T00:43:00.001+01:00</published><updated>2007-08-23T20:01:15.707+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pythonika'/><title type='text'>Intel binaries for Pythonika</title><content type='html'>I've just uploaded new &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; packages (&lt;a href="http://dkbza.org/data/pythonika-1.0.tar.gz"&gt;tar.gz&lt;/a&gt; and &lt;a href="http://dkbza.org/data/pythonika-1.0.zip"&gt;zip&lt;/a&gt;) to my site. The only change is that there are now compiled versions for Intel of the MathLink module for OS X. For Python 2.3 and 2.5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1307297173118980786?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1307297173118980786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1307297173118980786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1307297173118980786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1307297173118980786'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/12/intel-binaries-for-pythonika.html' title='Intel binaries for Pythonika'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-1693958290484958193</id><published>2006-12-08T16:38:00.000+01:00</published><updated>2007-01-21T15:07:01.487+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='basic blocks'/><category scheme='http://www.blogger.com/atom/ns#' term='code opimization'/><title type='text'>Simply blocks, basically...</title><content type='html'>A few days ago I bumped into something I was not really counting on seeing. Compiler &lt;a href="http://en.wikipedia.org/wiki/Optimization_%28computer_science%29"&gt;optimizations&lt;/a&gt; have surely gone a long way.&lt;br /&gt;&lt;br /&gt;Some background first...&lt;br /&gt;&lt;br /&gt;After having seeing functions split over non-contiguous &lt;a href="http://en.wikipedia.org/wiki/Basic_block"&gt;basic blocks&lt;/a&gt; for some time now, it was quite natural to think that some of those  basic blocks could be shared among functions ( obviously, only the ones leading to the function exit points as once the shared code is reached, there's no way of getting flow back to basic blocks not shared by those functions).&lt;br /&gt;&lt;br /&gt;Then we have that functions can be split with their blocks in different parts of a binary and some of those blocks shared. The reason for the splitting comes from doing &lt;a href="http://en.wikipedia.org/wiki/Performance_analysis"&gt;profiling&lt;/a&gt; in normal use-cases of the applications and trying to group frequently accessed code into as few &lt;a href="http://en.wikipedia.org/wiki/Paging"&gt;pages&lt;/a&gt; of the executable as possible, so that a minimum set of those need to be mapped at one time in memory. Only when infrequently visited code is reached some new pages new to be mapped. The following figures illustrates the concept.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;UPDATE:&lt;/b&gt; Just got told that the reason for the splitting is more likely to be there to take advantage of the internal CPU instruction cache than of memory paging. Keeping the frequently traversed code together will result in less instructions being fetched from RAM (slower) for that code area. Also will allow to fit more code in the code-cache by moving away the less used blocks. &lt;br /&gt;&lt;br /&gt;Here we can see the blocks being laid out continuously in memory. As can be normally seen in non-optimized code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Ppb6-5N0H80/RXmcit00FxI/AAAAAAAAAB4/cM8pfbw7wGQ/s1600-h/Basic+Block+Sharing,+Optimizations+1a.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_Ppb6-5N0H80/RXmcit00FxI/AAAAAAAAAB4/cM8pfbw7wGQ/s400/Basic+Block+Sharing,+Optimizations+1a.png" border="0" alt="Unsplit functions" id="BLOGGER_PHOTO_ID_5006204581029615378" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This would be how the same function would be laid out if profiling information is incorporated, so that frequently traversed paths are together within the code (in the same memory page if possible, in order to reduce memory footprint and paging).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Ppb6-5N0H80/RXmci900FyI/AAAAAAAAACA/GP_70_Zc6XA/s1600-h/Basic+Block+Sharing,+Optimizations+1b.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Ppb6-5N0H80/RXmci900FyI/AAAAAAAAACA/GP_70_Zc6XA/s400/Basic+Block+Sharing,+Optimizations+1b.png" border="0" alt="Split functions" id="BLOGGER_PHOTO_ID_5006204585324582690" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once one has the splitting, the idea of sharing comes naturally.&lt;br /&gt;&lt;br /&gt;This results in that, from the disassembler point of view, one has to allow for those chunks and also for those chunks to be assigned to an arbitrary number of "owning" or parent functions.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXmJDN00FuI/AAAAAAAAABA/QsU8-iWwsBI/s1600-h/Basic+Block+Sharing,+Optimizations+2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXmJDN00FuI/AAAAAAAAABA/QsU8-iWwsBI/s400/Basic+Block+Sharing,+Optimizations+2.png" border="0" alt="Shared blocks" id="BLOGGER_PHOTO_ID_5006183149142808290" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What is more interesting, and the subject of this post, is the fact that instructions can also belong to different basic blocks. At least, under one view. This arises from cases where extensive optimizations are used.&lt;br /&gt;&lt;br /&gt;A couple of days ago I was looking into an optimized binary (the craziest I have seen in a while) and how it was mapping into the SQL representation we are using at &lt;a href="http://sabre-security.com/"&gt;Sabre&lt;/a&gt;, there were some problems when exporting the information from IDA. (IDA can't really handle too well (yet) heavily-"chunked" code, so I have to account for that and build intelligence that analyzes the code for cases like the one I'm discussing here)&lt;br /&gt;&lt;br /&gt;The problem was with two functions sharing a number of basic blocks, the funny side was that, depending which function one analyzes the flow among the shared blocks will look different. And the cause is fairly obvious too once one realizes why the problem appears.&lt;br /&gt;&lt;br /&gt;A conditional branch from the non-shared code in one of the functions targeting the shared code will cause a split in the flow. A split which is not present from the other function's point of view. The following figure shows the result of a branch into shared code from only one of the sharing functions.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXmJDN00FvI/AAAAAAAAABI/CTKGu9s3gjI/s1600-h/Basic+Block+Sharing,+Optimizations+3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXmJDN00FvI/AAAAAAAAABI/CTKGu9s3gjI/s400/Basic+Block+Sharing,+Optimizations+3.png" border="0" alt="Evil branch"id="BLOGGER_PHOTO_ID_5006183149142808306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are two solutions for this problem. One would be to represent the same basic blocks all over the binary, which would introduce a non-natural spit in a function, the other way would be allowing to have different "views" of the code, using the basic blocks simply as a representation of the underlying model (the disassembled instructions), so that different basic blocks would contain the same instructions and those basic blocks would accurately represent the flow in the two functions...&lt;br /&gt;In the next figure, the colored basic blocks contain the same instructions in both functions, but the flow is different because of the branching.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_Ppb6-5N0H80/RXmJDd00FwI/AAAAAAAAABQ/jB6ZVPCv_5Y/s1600-h/Basic+Block+Sharing,+Optimizations+4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Ppb6-5N0H80/RXmJDd00FwI/AAAAAAAAABQ/jB6ZVPCv_5Y/s400/Basic+Block+Sharing,+Optimizations+4.png" border="0" alt="Different basic blocks, same code" id="BLOGGER_PHOTO_ID_5006183153437775618" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm leaning towards the second approach (the one in the previous figure), our SQL schema should support it trivially, which is fairly neat.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-1693958290484958193?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/1693958290484958193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=1693958290484958193' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1693958290484958193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/1693958290484958193'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/12/simply-blocks-basically.html' title='Simply blocks, basically...'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Ppb6-5N0H80/RXmcit00FxI/AAAAAAAAAB4/cM8pfbw7wGQ/s72-c/Basic+Block+Sharing,+Optimizations+1a.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-4083542026335736896</id><published>2006-12-04T19:21:00.001+01:00</published><updated>2006-12-04T19:21:16.709+01:00</updated><title type='text'>Some useful OS X apps</title><content type='html'>I recently tried &lt;a href="http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html"&gt;SuperDuper!&lt;/a&gt; and found it to be quite speedy and convenient way of keeping a mirror of my laptop as a backup. It's much faster than &lt;a href="http://www.emcinsignia.com/products/homeandoffice/retroformacintosh/"&gt;Retrospect&lt;/a&gt; (which aims at being a full featured backup system, as oposed to &lt;a href="http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html"&gt;SuperDuper!&lt;/a&gt;) which sadly still is not available as an Universal application.&lt;br /&gt;&lt;br /&gt;Another cool application is &lt;a href="http://www.screenrecycler.com/home.html"&gt;ScreenRecycler&lt;/a&gt;, which allows to extend OSX's desktop over other computers over the network using &lt;a href="http://en.wikipedia.org/wiki/VNC"&gt;VNC&lt;/a&gt;. It does need a pretty fast network to work in a totally transparent fashion, but it's a nice idea and works. (I've only tried it in a tri-head configuration; the laptop's display, a second physical screen attached to the MacBook and the third one using &lt;a href="http://www.screenrecycler.com/home.html"&gt;ScreenRecycler&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-4083542026335736896?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/4083542026335736896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=4083542026335736896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4083542026335736896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/4083542026335736896'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/12/some-useful-os-x-apps.html' title='Some useful OS X apps'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8138242600954272805</id><published>2006-12-04T19:05:00.001+01:00</published><updated>2006-12-05T10:26:44.473+01:00</updated><title type='text'>Latest Parallels beta is impressive</title><content type='html'>The &lt;a href="http://forum.parallels.com/thread5997.html"&gt;last beta&lt;/a&gt; of &lt;a href="http://www.parallels.com/en/products/desktop/"&gt;Parallels Desktop&lt;/a&gt; has a really cute feature, that is the &lt;em&gt;Coherence&lt;/em&gt; mode. It allows to display all the windows of applications running within the virtualized OS among the windows in OS X. It's a really freaky feeling to have Windows XP windows among OS X apps. Seeing &lt;a href="http://datarescue.com/idabase/"&gt;IDA&lt;/a&gt; next to Safari and XCode is quite an experience.&lt;br /&gt;When one wonders how they did it, it comes as something that should not be specially complicated to implement. I haven't looked at all into it, but my guess would be that they have Parallels walk the window list, get the geometry information and just capture those regions and display them as individual windows in OS X... it's just really cool.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXU65XW7TSI/AAAAAAAAAAM/eHKYTadtX7k/s1600-h/Parallels+Coherence,+IDA,+iTunes.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Ppb6-5N0H80/RXU65XW7TSI/AAAAAAAAAAM/eHKYTadtX7k/s320/Parallels+Coherence,+IDA,+iTunes.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5004971318089305378" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8138242600954272805?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8138242600954272805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8138242600954272805' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8138242600954272805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8138242600954272805'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/12/latest-parallels-beta-is-impressive.html' title='Latest Parallels beta is impressive'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Ppb6-5N0H80/RXU65XW7TSI/AAAAAAAAAAM/eHKYTadtX7k/s72-c/Parallels+Coherence,+IDA,+iTunes.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-8842778057984587138</id><published>2006-11-29T21:26:00.001+01:00</published><updated>2006-11-29T21:26:55.997+01:00</updated><title type='text'>Interesting tracing tool</title><content type='html'>I just read in &lt;a href="http://lists.immunitysec.com/mailman/listinfo/dailydave"&gt;Dailydave&lt;/a&gt; about &lt;a href="http://www.avertlabs.com/research/blog/?p=140"&gt;UMSS&lt;/a&gt;, a tool developed by McAfee labs and hosted in Sourceforge.&lt;br /&gt;&lt;br /&gt;I haven't had time to play with it but seems to provide support for single-instruction tracing. It does rely on an external disassembler so it won't be useful for self modifying code in its current state (the first use that jumped to my head). But sounds quite interesting nonetheless.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-8842778057984587138?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/8842778057984587138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=8842778057984587138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8842778057984587138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/8842778057984587138'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/interesting-tracing-tool.html' title='Interesting tracing tool'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116473975235143308</id><published>2006-11-28T19:49:00.000+01:00</published><updated>2006-11-28T19:51:29.477+01:00</updated><title type='text'>OS X binary protection</title><content type='html'>Just came across a &lt;a href='http://www.osxbook.com/book/bonus/chapter7/binaryprotection/'&gt;nice article&lt;/a&gt; (from the book  &lt;a href='http://www.osxbook.com/'&gt;Mac OS X Internals: A Systems Approach&lt;/a&gt;) about OS X's binary protection. It details how Apple implemented encryption of the code section of certain binaries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116473975235143308?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116473975235143308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116473975235143308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116473975235143308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116473975235143308'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/just-came-across-nice-article-from.html' title='OS X binary protection'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116370185738750773</id><published>2006-11-16T19:21:00.000+01:00</published><updated>2007-01-21T15:07:26.401+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pythonika'/><title type='text'>NumPy arrays and Pythonika</title><content type='html'>If someone tries to pass &lt;a href="http://numpy.scipy.org/"&gt;NumPy&lt;/a&gt;'s &lt;i&gt;ndarray&lt;/i&gt; objects into Mathematica with something like:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Py["numpy.array([[1,2,3],[4,5,6],[7,8,9]])"]&lt;/i&gt;&lt;br /&gt;&lt;br /&gt; the following error will appear:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Object type can't be converted!&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;That's due to the fact that &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; doesn't know what to do when finding objects of such type (or any type that it's not one of Python's basic types).&lt;br /&gt;&lt;br /&gt;In order to get around that, one can do something like:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Py["numpy.array([[1,2,3],[4,5,6],[7,8,9]]).tolist()"]&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Which will return the expected nested lists in Mathematica:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116370185738750773?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116370185738750773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116370185738750773' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116370185738750773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116370185738750773'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/numpy-arrays-and-pythonika.html' title='NumPy arrays and Pythonika'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116360807703183751</id><published>2006-11-15T17:27:00.000+01:00</published><updated>2006-11-15T17:27:57.033+01:00</updated><title type='text'>Mac OS X security report</title><content type='html'>&lt;a href="http://www.symantec.com/"&gt;Symantec&lt;/a&gt; has put out a &lt;a href="http://www.securityfocus.com/brief/358?ref=rss"&gt;nice summary&lt;/a&gt; of the state of OS X security. It lists some of the vulnerabilities discovered to date and goes over some of the existing malware and rootkits. Worth a read.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116360807703183751?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116360807703183751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116360807703183751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116360807703183751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116360807703183751'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/mac-os-x-security-report.html' title='Mac OS X security report'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116280468203005207</id><published>2006-11-06T10:10:00.000+01:00</published><updated>2007-05-18T14:13:45.345+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile 1.2</title><content type='html'>&lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; has just gotten some nice updates.&lt;br /&gt;&lt;br /&gt;- Added support for PE32+ files&lt;br /&gt;- Merged the patches from the &lt;a href="http://www.offensivecomputing.net/"&gt;Offensive Computing&lt;/a&gt; people and other contributors&lt;br /&gt;- Added support for writing changes back to the PE file. This should be used with care&lt;br /&gt;- Miscellaneous other bugfixes and enhancements&lt;br /&gt;&lt;br /&gt;As usual, more information and download links can be found in &lt;a href="http://dkbza.org/pefile.html"&gt;pefile's page&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116280468203005207?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116280468203005207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116280468203005207' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116280468203005207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116280468203005207'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/pefile-12.html' title='pefile 1.2'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116280420103890652</id><published>2006-11-06T10:02:00.000+01:00</published><updated>2007-08-23T20:01:15.708+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pythonika'/><title type='text'>Pythonika</title><content type='html'>I have finally managed to release &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt;! I wrote &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; quite a while ago and was never getting around to push it out.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; is a &lt;a href="http://www.wolfram.com/solutions/mathlink/devkits.html"&gt;MathLink&lt;/a&gt; module for &lt;a href="http://www.wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt; that makes it possible to write &lt;a href="http://python.org/"&gt;Python&lt;/a&gt; code within &lt;a href="http://www.wolfram.com/products/mathematica/index.html"&gt;Mathematica's&lt;/a&gt; notebooks. It handles the conversion of &lt;a href="http://python.org/"&gt;Python&lt;/a&gt; and &lt;a href="http://www.wolfram.com/products/mathematica/index.html"&gt;Mathematica&lt;/a&gt; objects transparently and allows to use all of &lt;a href="http://python.org/"&gt;Python's&lt;/a&gt; standard modules.&lt;br /&gt;&lt;br /&gt;I'm a big fan of &lt;a href="http://python.org/"&gt;Python&lt;/a&gt; and I've been using &lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; for a while. I hope more people will find it useful.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dkbza.org/pythonika.html"&gt;Pythonika&lt;/a&gt; is available at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dkbza.org/pythonika.html"&gt;http://dkbza.org/pythonika.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(an example notebook is available on the previous link as well as in the downloaded package)&lt;br /&gt;&lt;br /&gt;The download includes source code and binaries for OSX/Windows/Linux.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116280420103890652?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116280420103890652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116280420103890652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116280420103890652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116280420103890652'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/11/pythonika.html' title='Pythonika'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-116007019468840962</id><published>2006-10-05T19:36:00.000+02:00</published><updated>2006-10-05T19:43:14.750+02:00</updated><title type='text'>Google rocks</title><content type='html'>Gotta love these guys&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/codesearch/advanced_code_search"&gt;http://www.google.com/codesearch/advanced_code_search&lt;/a&gt;&lt;span style="color:#1919ff;text-decoration:underline;"&gt;&lt;br /&gt;&lt;/span&gt;Some quick tests even find virus source code.. awesome. Also fun: &lt;a href="http://www.google.com/codesearch?hl=en&amp;amp;lr=&amp;amp;q=fixme&amp;amp;btnG=Search"&gt;fun search one&lt;/a&gt;, &lt;a href="http://www.google.com/codesearch?as_q=fucking%5Cs%2Bbug&amp;amp;btnG=Search+Code&amp;amp;as_lang=&amp;amp;as_license_restrict=i&amp;amp;as_license=&amp;amp;as_package=&amp;amp;as_filename=&amp;amp;as_case="&gt;fun search two&lt;/a&gt;, &lt;a href="http://www.google.com/codesearch?as_q=shitty%5Cs%2Bcode&amp;amp;btnG=Search+Code&amp;amp;as_lang=&amp;amp;as_license_restrict=i&amp;amp;as_license=&amp;amp;as_package=&amp;amp;as_filename=&amp;amp;as_case="&gt;fun search three&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-116007019468840962?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/116007019468840962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=116007019468840962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116007019468840962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/116007019468840962'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/10/google-rocks.html' title='Google rocks'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-115095838663940009</id><published>2006-06-22T08:05:00.000+02:00</published><updated>2006-06-22T08:39:46.650+02:00</updated><title type='text'>Reverse Engineering Training</title><content type='html'>Pedram Amini and I will be conducting a &lt;a href="http://blackhat.com/html/bh-usa-06/train-bh-us-06-pa.html"&gt;training in Black Hat Las Vegas&lt;/a&gt; in a bit over a month. We will be covering reverse engineering tools and techniques with a focus on Windows malware. We have built an extensive Python toolset nowadays, and together with other tools, the material we will cover will also give insight on how use those and others in order to automate analysis techniques.&lt;br /&gt;&lt;br /&gt;We will also include the latest on the results of the research I have been mentioning in my posts and more. I think people will enjoy it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-115095838663940009?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/115095838663940009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=115095838663940009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115095838663940009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115095838663940009'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/06/reverse-engineering-training.html' title='Reverse Engineering Training'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-115095630310985136</id><published>2006-06-22T02:55:00.000+02:00</published><updated>2006-06-22T08:05:03.193+02:00</updated><title type='text'>Packer tracing</title><content type='html'>One of the things I &lt;a href="http://recon.cx/en/f/lightning-ecarrera-unpacking-birds-eye-view.pdf"&gt;talked about&lt;/a&gt; in one of &lt;a href="http://recon.cx/"&gt;Recon&lt;/a&gt;'s lightning talks was some quick research I had done tracing packers. Using some internal tools I've written I traced the &lt;i&gt;"behaviour"&lt;/i&gt; of different packers. I thought it would be nice to just show those results here too. These are presented as plots. Time is in the horizontal axes with the vertical one expressing the address where the traced event occurs. The colors encode memory writes and EIP location using green and blue respectively.&lt;br /&gt;The packers were traced as they were unpacking &lt;i&gt;Window XP&lt;/i&gt;'s &lt;i&gt;Notepad.exe&lt;/i&gt;. It's possible to see in some of the graphs a blue dot in the rightmost side, indicating the EIP jumping to the original entry point of the unpacked application.&lt;br /&gt;&lt;br /&gt;I think these graphs are quite informative and give ideas on possible heuristics to tackle the problem of generic unpacking. The datasets used to generate them are rather large, for some packers I collected tens of millions of points which were plot as seen.&lt;br /&gt;&lt;br /&gt;Specially interesting are the peculiar plots of &lt;i&gt;tElock&lt;/i&gt; and &lt;i&gt;Yoda&lt;/i&gt;'s packers, where it's possible to see the EIP(blue) going through addresses which had been previously written to (green), indicating multi-stage unpacking taking place.&lt;br /&gt;&lt;br /&gt;Note: &lt;i&gt;In some graphs there are gaps in the EIP trace. That is obviously impossible as the execution is continuous, the reason for the gaps is that the EIP was outside the plotted range, for instance, in DLL code.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;ASPack 2.12&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/ASPack%202.12.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/ASPack%202.12.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Petite 2.2&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/Petite%202.2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/Petite%202.2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;UPX 1.95&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/UPX-1.95%20Mem-EIP.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/UPX-1.95%20Mem-EIP.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;FSG v2.0&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/FSG%20v2.0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/FSG%20v2.0.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;tElock 0.98&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/tElock%20v.098.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/tElock%20v.098.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Yoda's Protector v1.02&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/Yoda%27s%20Protector%20v1.02.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/Yoda%27s%20Protector%20v1.02.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Yoda's Crypter v1.3&lt;/i&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/Yoda%27s%20Crypter%20v1.3.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/Yoda%27s%20Crypter%20v1.3.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-115095630310985136?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/115095630310985136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=115095630310985136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115095630310985136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115095630310985136'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/06/packer-tracing.html' title='Packer tracing'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-115093552225030776</id><published>2006-06-22T01:49:00.000+02:00</published><updated>2007-08-23T20:01:15.708+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Recon 2006</title><content type='html'>Last weekend I had the pleasure of assisting to the reverse engineering conference &lt;a href="http://recon.cx/"&gt;Recon&lt;/a&gt; in Montreal. &lt;a href="http://recon.cx/"&gt;Recon&lt;/a&gt; has probably been one of the best events I had the luck to assist to so far. The quality of the speakers was really high and the people assisting were incredible. The whole event was very well organized, with no hiccups.&lt;br /&gt;I had many really enjoyable talks and met great people.&lt;br /&gt;&lt;br /&gt;Regarding the talks I specially enjoyed Bunie's &lt;a href="http://recon.cx/en/f/bunnie-disassembling-and-patching-hardware.ppt"&gt;Disassembling And Patching Hardware&lt;/a&gt;. I did study electronics some years back, although never to the level of what Bunnie was showing. I found the talk really interesting.&lt;br /&gt;Alex Ionescu's &lt;a href="http://recon.cx/en/f/aionescu-subverting-w2k3-kernel-integrity-protection.ppt"&gt;Subverting Windows 2003 SP1 Kernel Integrity Protection &lt;/a&gt; was tremendously informative too, going really deep into w2k3 protection mechanisms.&lt;br /&gt;&lt;a href="http://recon.cx/en/f/vskype-part1.pdf"&gt;Skype&lt;/a&gt;'s talk by Fabrice Desclaux and Kostya Kortchinsky was truly amusing, they really took apart every single part of Skype.&lt;br /&gt;Spoonm showcased &lt;a href="http://recon.cx/en/f/spoonm-idarub.pdf"&gt;IDARub&lt;/a&gt;, now Ruby lovers have a tool as good as IDAPython, if not better. IDARub's network support is something that IDAPython will surely catch up with soon.&lt;br /&gt;Pedram Amini released &lt;a href="http://recon.cx/en/f/pamini-five-finger.pdf"&gt;PaiMei&lt;/a&gt;(&lt;a href="http://openrce.org/downloads/details/208/PaiMei"&gt;download&lt;/a&gt;), a tool that surely will be talked about a lot. A full reverse engineering framework in Python. It really looked mighty powerful.&lt;br /&gt;&lt;br /&gt;Also, I ended up cooking up two quick (ended up being not-so-quick) turbo-talks; &lt;a href="http://recon.cx/en/f/lightning-ecarrera-win32-static-analysis-in-python.pdf"&gt;Win32 Static  Analysis In Python&lt;/a&gt; showing two Python modules I wrote a while ago &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; and &lt;a href="http://dkbza.org/pydasm.html"&gt;pydasm&lt;/a&gt; and &lt;a href="http://recon.cx/en/f/lightning-ecarrera-unpacking-birds-eye-view.pdf"&gt;Unpacking Bird's Eye View&lt;/a&gt; showing some results on tracing unpackers using some internal tools. More on that last one on another post...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/IMG_0758.0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/IMG_0758.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/IMG_0760.0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/IMG_0760.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-115093552225030776?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/115093552225030776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=115093552225030776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115093552225030776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115093552225030776'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/06/recon-2006.html' title='Recon 2006'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-115035001276574284</id><published>2006-06-15T07:35:00.000+02:00</published><updated>2006-06-15T07:40:12.776+02:00</updated><title type='text'></title><content type='html'>Tonight I dropped by the taping of &lt;a href="http://revision3.com/diggnation"&gt;Diggnation&lt;/a&gt;. They were doing a special live show because of their first anniversary and I was lucky enough to catch it while I'm in San Francisco. These guys are awesome, even better live!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/IMG_0735_2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/320/IMG_0735_2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/IMG_0745.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/320/IMG_0745.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-115035001276574284?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/115035001276574284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=115035001276574284' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115035001276574284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/115035001276574284'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/06/tonight-i-dropped-by-taping-of.html' title=''/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114895351278991440</id><published>2006-05-30T03:42:00.000+02:00</published><updated>2007-05-18T14:13:45.347+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile-1.1</title><content type='html'>I just released &lt;a href="http://dkbza.org/pefile.html"&gt;pefile-1.1&lt;/a&gt;. This release brings some new functionality besides some bugs fixed. A detailed list of changes is available &lt;a href="http://dkbza.org/pefile/CHANGES"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114895351278991440?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114895351278991440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114895351278991440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114895351278991440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114895351278991440'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/05/pefile-11.html' title='pefile-1.1'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114894120677583658</id><published>2006-05-30T00:17:00.000+02:00</published><updated>2006-05-30T00:20:06.820+02:00</updated><title type='text'>ph-neutral</title><content type='html'>I came back yesterday from spending the weekend in &lt;a href="http://www.ph-neutral.org/"&gt;ph-neutral&lt;/a&gt; in Berlin. Again the Phenoelit, DarkLab and C-Base people managed to put together an amazing event. I met really great people and saw old friends, all of them I'd like to thank for really great conversations/brainstorming and the fun I had partying there. To all I'd like send greetings from here! Looking forward to next year's.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114894120677583658?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114894120677583658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114894120677583658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114894120677583658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114894120677583658'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/05/ph-neutral.html' title='ph-neutral'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114285180704458291</id><published>2006-03-20T11:50:00.000+01:00</published><updated>2006-03-20T11:50:07.086+01:00</updated><title type='text'>Stevey's Blog Rants: Math For Programmers</title><content type='html'>Really good post on learning maths. If only more people would think like that, specially people in charge of teaching it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html"&gt;Stevey's Blog Rants: Math For Programmers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114285180704458291?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114285180704458291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114285180704458291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114285180704458291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114285180704458291'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/03/steveys-blog-rants-math-for.html' title='Stevey&apos;s Blog Rants: Math For Programmers'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114124721506565218</id><published>2006-03-01T22:04:00.000+01:00</published><updated>2006-03-12T22:21:27.033+01:00</updated><title type='text'>DSL bandwidth and cooking my dinner are related?</title><content type='html'>What's the correlation between the act of getting my dinner heated and BitTorrent download speeds?&lt;br /&gt;&lt;br /&gt;I experienced today something that was rather obvious after taking a look at the frequency spectrum. I was rather amused to see two of my laptops suddenly experience some sort of simultaneous network connectivity problems. In one, Azureus was showing a drop on my combined downloaded speeds and in the other the Internet radio I was listening started to break down and buffer repeatedly... I just then realized that had been few minutes since I had started heating some food in the microwave. The kitchen stands about half the way from my living room to the wireless access point and it kind of made sense that the microwave could be the reason. Sure enough, once it was done the speeds peaked up again.&lt;br /&gt;&lt;br /&gt;Some reading later on showed that indeed, operating microwaves can impair the signal quality in wireless networks. I just thought that microwaves irradiated much less. On the other hand, probably the signal levels are so low that small inference easily degrades the signal. I found it amusing.&lt;br /&gt;&lt;br /&gt;Microwave Owens: 2.450 GHz&lt;br /&gt;&lt;br /&gt;US/Canada 802.11b/g Channel Nominal Frequencies go from 2.412 GHz to 2.462 GHz in steps of 5 MHz&lt;br /&gt;(Europe seems to use very similar frequencies if not the same.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114124721506565218?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114124721506565218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114124721506565218' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114124721506565218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114124721506565218'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/03/dsl-bandwidth-and-cook-my-dinner-are.html' title='DSL bandwidth and cooking my dinner are related?'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114034306088594795</id><published>2006-02-19T10:55:00.000+01:00</published><updated>2006-02-19T10:57:41.533+01:00</updated><title type='text'>Old "recordings", just incredible</title><content type='html'>&lt;a href="http://digg.com/science/Archaeologists_get_ancient_audio_from_grooves_on_Pompeii_pottery"&gt;Archaeologists get ancient audio from grooves on Pompeii pottery&lt;/a&gt;. Sound got recorded in old pottery's grooves. It's not that difficult to believe that it could happen (although I don't know the exact mechanics of the process they were using those times) , but it's impressive that someone even thought of the idea of it happening and managed to recover it. From the recording it does seem like they did. (Via &lt;a href="http://digg.com/science/Archaeologists_get_ancient_audio_from_grooves_on_Pompeii_pottery"&gt;Digg&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114034306088594795?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114034306088594795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114034306088594795' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114034306088594795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114034306088594795'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/02/old-recordings-just-incredible.html' title='Old &quot;recordings&quot;, just incredible'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-114009006712734360</id><published>2006-02-16T12:39:00.000+01:00</published><updated>2006-02-16T12:41:07.146+01:00</updated><title type='text'>OS X malware</title><content type='html'>The following entry in MacRumors, &lt;a href="http://www.macrumors.com/pages/2006/02/20060216005401.shtml"&gt;The First Mac OS X Virus? (A New OS X Trojan)&lt;/a&gt;, mentions of a recently discovered piece of malware targeting PPC OS X. I hope I can get my hands into a sample of it, I'd love to check it out...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-114009006712734360?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/114009006712734360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=114009006712734360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114009006712734360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/114009006712734360'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/02/os-x-malware.html' title='OS X malware'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113943721869625670</id><published>2006-02-08T23:18:00.000+01:00</published><updated>2006-02-08T23:20:18.743+01:00</updated><title type='text'>Video of the Multi-Touch Interaction Research</title><content type='html'>This is really impressive, there are countless things I would want to do with a system with an interface like this: &lt;a href="http://digg.com/apple/VIDEO_of_the_Multi-Touch_Interaction_Research_-_APPLE_"&gt;Video of the Multi-Touch Interaction Research&lt;/a&gt;. Just imagine the amount of information and the speed and precision with which it can be handled. (Via &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113943721869625670?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113943721869625670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113943721869625670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113943721869625670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113943721869625670'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/02/video-of-multi-touch-interaction.html' title='Video of the Multi-Touch Interaction Research'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113821849436616331</id><published>2006-01-25T20:47:00.000+01:00</published><updated>2006-01-25T20:48:14.420+01:00</updated><title type='text'>oh no!</title><content type='html'>&lt;a href="http://www.moox.nl/blogworm/" target="_blank"&gt;&lt;br /&gt;  &lt;img src="http://www.moox.nl/blogworm/virus.gif" width="244" height="131" border="0" alt="Blog.Worm"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113821849436616331?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113821849436616331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113821849436616331' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113821849436616331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113821849436616331'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/01/oh-no.html' title='oh no!'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113787533236540268</id><published>2006-01-21T21:25:00.000+01:00</published><updated>2006-01-21T21:28:52.423+01:00</updated><title type='text'>This is real teaching</title><content type='html'>I can only wish math would be taught this way more often... simply beautiful&lt;br /&gt;&lt;br /&gt;&lt;a href="http://digg.com/links/The_Socratic_Method_used_on_3rd_graders_to_teach_them_binary_arithmatic"&gt;The Socratic Method used on 3rd graders to teach them binary arithmatic&lt;/a&gt;: "The experiment was to see whether I could teach these students binary arithmetic (arithmetic using only two numbers, 0 and 1) only by asking them questions." (via &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113787533236540268?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113787533236540268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113787533236540268' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113787533236540268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113787533236540268'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/01/this-is-real-teaching.html' title='This is real teaching'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113770844760695601</id><published>2006-01-19T23:07:00.000+01:00</published><updated>2006-11-25T21:25:40.686+01:00</updated><title type='text'>Visual Complexity</title><content type='html'>&lt;a href="http://www.visualcomplexity.com/vc/index.cfm"&gt;This&lt;/a&gt; is just beautiful. A set of visualizations of graphs depicting complex systems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113770844760695601?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113770844760695601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113770844760695601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113770844760695601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113770844760695601'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/01/visual-complexity.html' title='Visual Complexity'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113767898053499206</id><published>2006-01-19T14:55:00.000+01:00</published><updated>2006-01-19T14:56:20.540+01:00</updated><title type='text'>Ilfaks's: Return to the sources?</title><content type='html'>Ilfak's  &lt;a href="http://www.hexblog.com/2006/01/return_to_the_sources.html"&gt;Return to the sources?&lt;/a&gt; makes for an interesting read on the problem of &lt;em&gt;decompilation&lt;/em&gt;. I agree with such views.&lt;br /&gt;I've always been thinking of &lt;em&gt;decompilation&lt;/em&gt; in terms of generating a higher level representation of some lower level code. Information is lost in the process of compiling, so expecting to retrieve code which resembles the original is wishful thinking to say the least. Unless the compilation process in known and an injective map from a set of high level constructs to a set low level ones exists, in that case one could use that information in order to reconstruct those higher level constructs. Although, nowadays, with the amount of optimization such as branchless logic, code scheduling, etc such occurrence is rare.&lt;br /&gt;&lt;br /&gt;However, as Ilfak mentions, trying to extract higher lever features from a mathematical representation of the lower level code might actually produce results and I personally think that's the way to go...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113767898053499206?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113767898053499206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113767898053499206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113767898053499206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113767898053499206'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/01/ilfakss-return-to-sources.html' title='Ilfaks&apos;s: Return to the sources?'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113767729579209021</id><published>2006-01-19T14:27:00.000+01:00</published><updated>2007-08-23T20:01:15.709+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>IDAPython 0.8.0 released</title><content type='html'>Dyce has released &lt;a href="https://www.openrce.org/forums/posts/114"&gt;IDAPython 0.8.0&lt;/a&gt;. I know of plenty of people who have been waiting for this one, me for one. Also, the Windows version is linked against Python 2.4.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113767729579209021?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113767729579209021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113767729579209021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113767729579209021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113767729579209021'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2006/01/idapython-080-released.html' title='IDAPython 0.8.0 released'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113565584314632460</id><published>2005-12-27T04:52:00.000+01:00</published><updated>2007-05-18T14:13:45.348+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='pefile'/><title type='text'>pefile is out!!</title><content type='html'>Finally, after many delays I've managed to find time to release a newer version of &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt; (was pype). The name change comes from the fact that another project called &lt;a href="http://pype.sourceforge.net/"&gt;PyPE&lt;/a&gt; already exists and was using the name earlier. So now it's &lt;a href="http://dkbza.org/pefile.html"&gt;pefile&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It can now parse Delayed Imports, thanks to Adam Morrison, and multiple fixes have been added. It should be able to take really corrupted and malformed PE files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113565584314632460?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113565584314632460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113565584314632460' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113565584314632460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113565584314632460'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2005/12/pefile-is-out.html' title='pefile is out!!'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113565069125939687</id><published>2005-12-27T03:21:00.000+01:00</published><updated>2007-08-23T20:01:15.710+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Some Python loving</title><content type='html'>&lt;a href="http://blogs.law.harvard.edu/ivan/2005/08/06#a10"&gt;This post&lt;/a&gt; has very good points on Python and Java. Having played with Eclipse myself and coding lots of Python with no IDE (&lt;a href="http://www.codingmonkeys.de/subethaedit/"&gt;SubEthaEdit rules&lt;/a&gt;!) I could hardly agree more with him.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113565069125939687?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113565069125939687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113565069125939687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113565069125939687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113565069125939687'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2005/12/some-python-loving.html' title='Some Python loving'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113557057137362561</id><published>2005-12-26T04:48:00.000+01:00</published><updated>2005-12-26T05:16:11.386+01:00</updated><title type='text'>Eyecandy...</title><content type='html'>Having and huge backlog of stuff, being xmas night away of any known humans and a terrible jetlag does help my blog... it's nearly 5am and still gonna be kicking around for a while... to the topic:&lt;br /&gt;&lt;br /&gt;Some days ago some very nice guys gave a nice collection of malware, mainly bots. Nice because it was in the order of thousands... the wet dream of an automation fanatic...&lt;br /&gt;I love to run stats on large collections of data (Statistical Natural Language Processing on large corpora is extreme fun) and malware is something I've had some encounters with ;)&lt;br /&gt;&lt;br /&gt;I haven't even starting doing real crunching but the other day I ran some Mathematica SOM (Self Organizing Network) code I had written a while ago on some values extracted from a subset of those samples. SOMs are simple neural networks which have the advantage of making clustering of high-dimensional data really easy. In this case I just went for using 3-dimensional vectors with the ImageBase, AddressOfEntryPoint members of the PE header and the first section's size. I ran that through the SOM which gave pretty nice clusters. The following scatterplot shows that indeed those (normalized) values do indeed have quite some structure.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/Samples%203D%20scatterplot.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/320/Samples%203D%20scatterplot.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I went a bit further then and ran some code I wrote using &lt;a href=http://dkbza.org/pydasm.html&gt;pydasm&lt;/a&gt; which disassembles the binaries and gives me a 36-dimension vector (originally spits out a 6x6 matrix) representing specific characteristics and patterns within the code.&lt;br /&gt;&lt;br /&gt;I then run that data through the SOM code and again produced defined clusters. Not that surprising since this approach captures patterns in the code and most of those binaries share commons packers (UPX and the likes). So, some more eyecandy...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/SOM%203D%20Levels.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/SOM%203D%20Levels.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/SOM%203D.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/SOM%203D.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Those last two pictures show certain areas with a higher density of points. I then went on making a 2D histogram by counting how many samples fell into each bucket. The following pictures show the spread of those. (They are the same data, the second plot is logarithmic though.)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/2D%20Histogram.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/320/2D%20Histogram.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/2D%20Histogram%20Log.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/320/2D%20Histogram%20Log.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Dunno if it's of any particular use, but sure it's fun...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113557057137362561?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113557057137362561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113557057137362561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113557057137362561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113557057137362561'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2005/12/eyecandy.html' title='Eyecandy...'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14788166.post-113556827557957657</id><published>2005-12-26T04:23:00.000+01:00</published><updated>2006-01-01T20:24:50.710+01:00</updated><title type='text'>Some (hopefully) informative graphs</title><content type='html'>Long due but I've finally been able to finish and upload two PDFs I wanted to push out for quite a while.&lt;br /&gt;&lt;br /&gt;The can be found in my &lt;a href="https://www.openrce.org/repositories/browse/ero"&gt;OpenRCE file repository&lt;/a&gt;. One is on the &lt;a href="https://www.openrce.org/reference_library/files/reference/PE%20Format.pdf"&gt;PE file format&lt;/a&gt; and the other on the &lt;a href="https://www.openrce.org/reference_library/files/reference/Windows%20Memory%20Layout,%20User-Kernel%20Address%20Spaces.pdf"&gt;Windows memory layout&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/PE%20Format.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/PE%20Format.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7115/1349/1600/Windows%20Memory%20Layout%2C%20User-Kernel%20Address%20Spaces.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7115/1349/400/Windows%20Memory%20Layout%2C%20User-Kernel%20Address%20Spaces.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14788166-113556827557957657?l=blog.dkbza.org' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.dkbza.org/feeds/113556827557957657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14788166&amp;postID=113556827557957657' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113556827557957657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14788166/posts/default/113556827557957657'/><link rel='alternate' type='text/html' href='http://blog.dkbza.org/2005/12/some-hopefully-informative-graphs.html' title='Some (hopefully) informative graphs'/><author><name>Ero Carrera</name><uri>http://www.blogger.com/profile/12212132879580765574</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_Ppb6-5N0H80/SWTe3dGAmRI/AAAAAAAAClE/wbE8E0WDTOg/S220/bangkok.JPG'/></author><thr:total>0</thr:total></entry></feed>
