<?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>Dr. Gadget IDAPython plugin</title>
                            <pubDate>Sat, 24 Jul 2010 06:23:54 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/1570/Dr._Gadget_IDAPython_plugin</link>
                                        <author>dennis &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I wanted to share with you this little IDAPython plugin which helps in writing and analyzing return oriented payload. It uses IDA's custom viewers in order to display an array of DWORDs called 'items', where an item can be either a pointer to a gadget or a simple 'value'.&lt;br /&gt;
There are several keyboard shortcuts to access functionality that otherwise also is accessible via the context menu:&lt;br /&gt;
&lt;br /&gt;
ESC&amp;nbsp;&amp;nbsp; - closes the plugin&lt;br /&gt;
ENTER - jumps to item address in disassembly&lt;br /&gt;
O&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - toggles item type (offset, value)&lt;br /&gt;
D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - deletes an item&lt;br /&gt;
I&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - inserts an item&lt;br /&gt;
E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - edits an item's value&lt;br /&gt;
&lt;br /&gt;
Functionality that is accessible via context menu only:&lt;br /&gt;
&lt;br /&gt;
Load payload&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - loads a payload from disk&lt;br /&gt;
Save payload&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - saves a payload to disk&lt;br /&gt;
&lt;br /&gt;
Auto analysis I&amp;nbsp;&amp;nbsp;- tries to determine each item's type (offset, value)&lt;br /&gt;
Reset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- resets each item's type&lt;br /&gt;
Show disassembly - opens a disassembly subwindow &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below screenshots show the plugin's interface. The IDB is a disassembly&lt;br /&gt;
of 'BIB.dll' (MD5: 2ec16a4cdb828a31a432513a82cbafdf). _rop.bin is some&lt;br /&gt;
exploit's payload in binary form (more info:&lt;br /&gt;
&lt;a href=&quot;http://blog.zynamics.com/2010/06/09/analyzing-the-currently-exploited-0-day-for-adobe-reader-and-adobe-flash/&quot;&gt;http://blog.zynamics.com/2010/06/09/analyzing-the-currently-exploited-0-day-for-adobe-reader-and-adobe-flash/&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/01.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/02.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/03.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/04.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/05.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/06.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/07.png&quot; border=0 align=&quot;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
The plugin can be used either on a static disassembly or during an IDA debugging session.&lt;br /&gt;
&lt;br /&gt;
The plugin is available here: &lt;a href=&quot;http://www.openrce.org/repositories/users/dennis/drgadget.py&quot;&gt;http://www.openrce.org/repositories/users/dennis/drgadget.py&lt;/a&gt;&lt;br /&gt;
_rop.bin is available here: &lt;a href=&quot;http://www.openrce.org/repositories/users/dennis/rop.bin&quot;&gt;http://www.openrce.org/repositories/users/dennis/rop.bin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;edit:&lt;/b&gt;&lt;br /&gt;
just uploaded v0.2 which adds Elias Bachaalany's &amp;quot;find instruction/opcode&amp;quot; script from&lt;br /&gt;
&lt;a href=&quot;http://hexblog.com/2009/09/assembling_and_finding_instruc.html&quot;&gt;http://hexblog.com/2009/09/assembling_and_finding_instruc.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.openrce.org/repositories/users/dennis/08.png&quot; border=0 align=&quot;&quot;&gt;</description>
                    </item>
                <item>
            <title>note to self</title>
                            <pubDate>Thu, 10 Jan 2008 11:58:42 -0600</pubDate>
                                        <link>https://www.openrce.org/blog/view/1019/note_to_self</link>
                                        <author>dennis &lt;email-suppressed@example.com&gt;</author>
                                                    <description>when patching drivers such as tcpip.sys by hand, do not forget to update the image checksum before rebooting ;-)</description>
                    </item>
                <item>
            <title>How to launch an executable...</title>
                            <pubDate>Fri, 29 Jun 2007 09:43:02 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/790/How_to_launch_an_executable...</link>
                                        <author>dennis &lt;email-suppressed@example.com&gt;</author>
                                                    <description>...without creating it on disk. Ever wondered how to do that?&lt;br /&gt;
So did I. So I've taken apart an interesting executable crypter that&lt;br /&gt;
I found the other day. Not one of those crypters adding code/sections&lt;br /&gt;
to an existing PE file but one of those crypters that embed the &amp;quot;target&amp;quot;&lt;br /&gt;
executable as a resource into its loader code.&lt;br /&gt;
&lt;br /&gt;
The technique is simple, yet interesting (for _various_ purposes).&lt;br /&gt;
&lt;br /&gt;
1. launch a copy of the loader process in suspended mode.&lt;br /&gt;
2. get the context structure of the copy of the loader process.&lt;br /&gt;
3. retrieve the imagebase of the process by parsing its PEB structure (ebx at process start!).&lt;br /&gt;
4. free all the data belonging to the process by calling ZwUnmapViewOfSection and passing it the imagebase.&lt;br /&gt;
5. get the SizeOfImage value of the embedded executable from its PE header.&lt;br /&gt;
6. allocate a new block of memory starting at the imagebase with the size of the SizeOfImage value.&lt;br /&gt;
7. copy all the headers (pe header, section header etc.) to the allocated block of memory.&lt;br /&gt;
8. copy each section of the embedded executable to the allocated block of memory, setting their memory protection according to their section characteristics.&lt;br /&gt;
9. the imagebase in the PEB of the process has to patched to equal the address of the allocated block of memory&lt;br /&gt;
10. set eax of the process to point to the entrypoint of the process&lt;br /&gt;
11. resume the process, if all went well.&lt;br /&gt;
&lt;br /&gt;
For a better understanding, have a look at the &lt;a href=&quot;https://www.openrce.org/repositories/users/dennis/launch_image_in_memory.html&quot;&gt;disassembly&lt;/a&gt;.</description>
                    </item>
                <item>
            <title>can you read binary code? ;-)</title>
                            <pubDate>Wed, 13 Jun 2007 05:49:53 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/777/can_you_read_binary_code?_;-)</link>
                                        <author>dennis &lt;email-suppressed@example.com&gt;</author>
                                                    <description>I love this comic. Actually it's pretty old, but today I wondered if that binary code is anything meaningful ;-)&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.ctrlaltdel-online.com/comics/20021127.jpg&quot; border=0 align=&quot;&quot;&gt;</description>
                    </item>
                <item>
            <title>Adding code to ROM(image)s</title>
                            <pubDate>Thu, 31 May 2007 14:35:07 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/755/Adding_code_to_ROM(image)s</link>
                                        <author>dennis &lt;email-suppressed@example.com&gt;</author>
                                                    <description>For anyone who is/was interested in trainers/adding code,&lt;br /&gt;
I've put &lt;a href=&quot;http://www.openrce.org/repositories/users/dennis/NEStrainers.zip&quot;&gt;source code&lt;/a&gt; of trainers for some NES games into my repository. They explain how to add code to an existing ROM image, how to patch memory on the M6502 and how to win if you suck at games ;-)&lt;br /&gt;
&lt;br /&gt;
If you're too lazy to assemble the source code yourself, you can use the included IPS files to patch your own ROM image.&lt;br /&gt;
&lt;br /&gt;
Be sure to check out &lt;a href=&quot;http://www.openrce.org/repositories/users/dennis/NESpackage.zip&quot;&gt;this&lt;/a&gt; as well.</description>
                    </item>
            </channel>
</rss>
