<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>OpenRCE: Blog</title>
        <link>http://www.openrce.org/rss/feeds/blog</link>
        <description>OpenRCE: The Open Reverse Code Engineering Community</description>
                <item>
            <title>More on pynary</title>
                            <pubDate>Tue, 15 Jan 2008 01:17:20 -0600</pubDate>
                                        <link>https://www.openrce.org/blog/view/1023/More_on_pynary</link>
                                        <author>c1de0x &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Hey all,&lt;br /&gt;
&lt;br /&gt;
I've unfortunately not made too much progress on pynary due to a horrific machine crash (but you *really* don't want to hear about that!).&lt;br /&gt;
&lt;br /&gt;
I submitted pynary to the new Woodman &lt;a href=&quot;http://www.woodmann.com/collaborative/tools/index.php/Category:RCE_Tools&quot;&gt;Collaborative Tool Library&lt;/a&gt; in the hope that I can reel in a few more volunteers.&lt;br /&gt;
&lt;br /&gt;
I've also noticed that a number of people here at OpenRCE are working on similar stuff. I really think it'd be a good idea to try and combine our efforts. That way we can really get the most 'bang' for our buck ;)&lt;br /&gt;
&lt;br /&gt;
That's all for now. Look forward to some real updates to pynary in the next couple of weeks!&lt;br /&gt;
</description>
                    </item>
                <item>
            <title>Introducing pynary</title>
                            <pubDate>Tue, 11 Dec 2007 12:42:58 -0600</pubDate>
                                        <link>https://www.openrce.org/blog/view/990/Introducing_pynary</link>
                                        <author>c1de0x &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Hey all,&lt;br /&gt;
&lt;br /&gt;
I've posted some very very early code for pynary at &lt;a href=&quot;http://openrce-snippets.googlecode.com/svn/trunk/standalone/pynary/&quot;&gt;http://openrce-snippets.googlecode.com/svn/trunk/standalone/pynary/&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
For those of you who haven't been subjected to my speculation and badgering on the irc channel, I'll describe what this is and what it could, hopefully, become.&lt;br /&gt;
&lt;br /&gt;
It all started when I decided that IDA's flirt wasn't doing a good enough job of matching standard library functions - missing many 'trivial to match' functions, incorrectly matching others, ignoring certain functions entirely, forcing the user to pick between 'clashing' function signatures, etc. &lt;br /&gt;
&lt;br /&gt;
I started thinking about the particular issues related to the problem of matching library functions and how each of FLIRT's limitations could be overcome, and eventually decided that what the RCE community needs is a flexible and extensible binary function matching library.&lt;br /&gt;
&lt;br /&gt;
So I started working on a script - in python of course - and it quickly became clear that I could do so much more with the infrastructure I was laying down. I decided to expand my horions a bit, and renamed the project ('gensig') to pynary.&lt;br /&gt;
&lt;br /&gt;
pynary will hopefully become a powerful framework for binary code analysis.&lt;br /&gt;
&lt;br /&gt;
The initial goal is to finish implementation of the signature matching goal using graph isomorphism and an extensible 'write-your-own-heuristic' model to tweak matching for particular targets. I also intend to identify standard library global constants and structure where possible.&lt;br /&gt;
&lt;br /&gt;
Once the initial goal is acheived, I look forward to implementing a number of cool features:&lt;br /&gt;
* stack frame analysis&lt;br /&gt;
* un-inliner&lt;br /&gt;
* exception handling parsing/analysis&lt;br /&gt;
* 'functionally equivalent' matching&lt;br /&gt;
* c++ template function matching&lt;br /&gt;
* meta-data transfer between IDBs&lt;br /&gt;
* c++ class reconstruction (with/without RTTI)&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
At the moment, the bulk of the work has been to add COFF object support to ero's pefile. This functionality is not yet merged into the mainstream release of pefile, but will hopefully make it in when stable enough.&lt;br /&gt;
&lt;br /&gt;
So far, the pynary.py file opens a .LIB file, enumerates its exported functions and generates a basic-block graph for each function using recursive traversal. These graphs in turn form a 'graph of graphs' of inter-function calls. &lt;br /&gt;
&lt;br /&gt;
Calls to externally defined functions are not resolved, but in the next stage, when multiple .LIBs are loaded, externs will be resolved (sort of reverse-linking).&lt;br /&gt;
&lt;br /&gt;
This graph can be traversed by matching algorithms.&lt;br /&gt;
&lt;br /&gt;
Anyhow, feel free to contact me (email, irc, xmpp) with ideas and comments. Anyone who want's to get their hands dirty is more than welcome.</description>
                    </item>
                <item>
            <title>Kerberos API Tracing</title>
                            <pubDate>Mon, 14 May 2007 12:28:20 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/729/Kerberos_API_Tracing</link>
                                        <author>c1de0x &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Hi all,&lt;br /&gt;
&lt;br /&gt;
I'm looking into API tracing, and heard about kerberos (Rustem Fasihov) in this thread: &lt;a href=&quot;https://www.openrce.org/forums/posts/274&quot;&gt;https://www.openrce.org/forums/posts/274&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As I've been grappling with my own hooking engine for a couple of days, I couldn't resist looking under the hood.&lt;br /&gt;
&lt;br /&gt;
I discovered that at it's core, kerberos seems to use 5-byte hotpatch hooks, which isn't surprising, as it's the mechanism I was using and also - to some degree - that favored by Detours.&lt;br /&gt;
&lt;br /&gt;
What is interesting is that there don't seem to be any 'trampoline' functions. In other words, in both my solution and Detours, it is necessary to generate a 'jump function' (which acts as the target of the 5-byte JMP patch) for each API being hooked. The 'jump'/'trampoline' function typically has the address of the instruction immediately following the patch hard-coded into a JMP so that execution can continue.&lt;br /&gt;
&lt;br /&gt;
It seems that kerberos takes a different approach though, all patches, for all hooked functions, jump to the same method, which begins:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pushf&lt;br /&gt;
spin:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;g_inHookSemaphore, 1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;jz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spin&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;g_inHookSemaphore, 1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;popf&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data2&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pushf&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pusha&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&lt;/code&gt;</description>
                    </item>
            </channel>
</rss>
