<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Elias Bachaalany&#039;s Blog</title>
	<atom:link href="http://0xeb.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://0xeb.wordpress.com</link>
	<description>Programming, reversing engineering and what not...</description>
	<lastBuildDate>Sat, 07 May 2011 15:14:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='0xeb.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Elias Bachaalany&#039;s Blog</title>
		<link>http://0xeb.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://0xeb.wordpress.com/osd.xml" title="Elias Bachaalany&#039;s Blog" />
	<atom:link rel='hub' href='http://0xeb.wordpress.com/?pushpress=hub'/>
		<item>
		<title>PyHiew 0.3.0 with process memory editing</title>
		<link>http://0xeb.wordpress.com/2011/04/02/pyhiew-0-3-0-with-process-memory-editing/</link>
		<comments>http://0xeb.wordpress.com/2011/04/02/pyhiew-0-3-0-with-process-memory-editing/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 10:27:00 +0000</pubDate>
		<dc:creator>0xeb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://0xeb.wordpress.com/?p=117</guid>
		<description><![CDATA[PyHiew 0.3.0 has been released with fsPlus integration. It is now possible to edit process memory directly from Hiew. How to edit process memory with Hiew - Press F9 to toggle Hiew HEM modules - Select PyHiew and then the &#8230; <a href="http://0xeb.wordpress.com/2011/04/02/pyhiew-0-3-0-with-process-memory-editing/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=117&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/pyhiew/downloads/detail?name=pyhiew0.3.0.zip" target="_blank">PyHiew 0.3.0</a> has been released with <a href="http://lgwm.org/projects/hiewplus/" target="_blank">fsPlus</a> integration. It is now possible to edit process memory directly from Hiew.</p>
<h2>How to edit process memory with Hiew</h2>
<p>- Press F9 to toggle Hiew HEM modules<br />
- Select PyHiew and then the fsPlus script</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/select_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="select_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/select_fsplus_thumb.gif?w=346&#038;h=186" border="0" alt="select_fsPlus" width="346" height="186" /></a></p>
<p>- After successful activation you should get this:</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/activated_fsplus.gif"><img style="display:inline;" title="activated_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/activated_fsplus_thumb.gif?w=556&#038;h=88" alt="activated_fsPlus" width="556" height="88" /></a></p>
<p>This step is required only once.</p>
<p>- Now press F9 to show the files list (you may want to press Alt-F4 to refresh the files list):<br />
<a href="http://0xeb.files.wordpress.com/2011/04/fileselect_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="fileselect_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/fileselect_fsplus_thumb.gif?w=591&#038;h=249" border="0" alt="fileselect_fsPlus" width="591" height="249" /></a></p>
<p>Processes and files will be listed along side each other. Processes will have the following format: {<strong>ProcessName.extension}.pid|{PID}. </strong>The process name and PID will be replaced with the actual process name and ID. Now you’re ready to edit the process in question. Just press ENTER to select the file!</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/textview_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="textview_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/textview_fsplus_thumb.gif?w=655&#038;h=335" border="0" alt="textview_fsPlus" width="655" height="335" /></a></p>
<p>The first few pages (virtual address 0 and on) are not mapped in processes, for this reason fsPlus will provide “virtual” information to Hiew and construct a “special” PE file header describing all the loaded modules and some textual information after that:</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/textinfo_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="textinfo_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/textinfo_fsplus_thumb.gif?w=642&#038;h=323" border="0" alt="textinfo_fsPlus" width="642" height="323" /></a></p>
<p>Pressing ENTER (to switch to Hex view) then F8 then F6 (to view the PE sections) will reveal all the loaded modules:</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/sections_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="sections_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/sections_fsplus_thumb.gif?w=523&#038;h=184" border="0" alt="sections_fsPlus" width="523" height="184" /></a></p>
<p>You may press <strong>ENTER</strong> to jump to any section in memory. In the following screenshot, we have a view crossing from one page to another. The first page is not mapped thus fsPlus will return “<strong>BAD</strong>!” whenever it cannot read memory and the following page contains the actual process memory bytes:</p>
<p><a href="http://0xeb.files.wordpress.com/2011/04/procmem_fsplus.gif"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="procmem_fsPlus" src="http://0xeb.files.wordpress.com/2011/04/procmem_fsplus_thumb.gif?w=644&#038;h=320" border="0" alt="procmem_fsPlus" width="644" height="320" /></a></p>
<p>It is possible to copy blocks (for example to copy sections from an unpacked program), edit the process (by pressing F3) and save the changes or even achieve most of the File I/O operations you do on a normal files.</p>
<p>It is possible to configure fsPlus so that a folder if your choice will contain the process list (instead of having the listing showing in the current directory). For this, you need to edit the “fsPlus.ini” file:</p>
<pre>; Specify the process hook path. The folder must *EXIST* (but not necessarily empty) and have a trailing backslash
; For example, if it can be: "C:\_processes\" or simply the current directory: ".\"

[ProcessAsFile]
ProcessDir=.\</pre>
<p>If another folder is specified, then when you press F9 to toggle the file list in Hiew, make sure you navigate to the folder you just specified in order to get the processes list.</p>
<p>That&#8217;s it! If you have questions let me know.</p>
<p>Download the PyHiew 0.3.0 <a href="http://pyhiew.googlecode.com/files/pyhiew0.3.0.zip" target="_blank">package</a> and get started! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/0xeb.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/0xeb.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/0xeb.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=117&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://0xeb.wordpress.com/2011/04/02/pyhiew-0-3-0-with-process-memory-editing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f7a678b6b38492f46e59f48c03a777c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xeb</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/select_fsplus_thumb.gif" medium="image">
			<media:title type="html">select_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/activated_fsplus_thumb.gif" medium="image">
			<media:title type="html">activated_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/fileselect_fsplus_thumb.gif" medium="image">
			<media:title type="html">fileselect_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/textview_fsplus_thumb.gif" medium="image">
			<media:title type="html">textview_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/textinfo_fsplus_thumb.gif" medium="image">
			<media:title type="html">textinfo_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/sections_fsplus_thumb.gif" medium="image">
			<media:title type="html">sections_fsPlus</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/04/procmem_fsplus_thumb.gif" medium="image">
			<media:title type="html">procmem_fsPlus</media:title>
		</media:content>
	</item>
		<item>
		<title>PyHiew and PEiD</title>
		<link>http://0xeb.wordpress.com/2011/03/06/pyhiew-and-peid/</link>
		<comments>http://0xeb.wordpress.com/2011/03/06/pyhiew-and-peid/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 23:03:52 +0000</pubDate>
		<dc:creator>0xeb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://0xeb.wordpress.com/?p=98</guid>
		<description><![CDATA[Many times I find myself viewing a file with Hiew and at the same time wondering what kind of packer is applied to the file. Normally, I would run PEiD in parallel and check the packer signatures there. For this &#8230; <a href="http://0xeb.wordpress.com/2011/03/06/pyhiew-and-peid/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=98&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many times I find myself viewing a file with Hiew and at the same time wondering what kind of packer is applied to the file. Normally, I would run <a href="http://www.peid.info/" target="_blank">PEiD</a> in parallel and check the packer signatures there.</p>
<p>For this reason, I created a small PyHiew script that allows you to detect the packer directly from Hiew using a text files having the same format as PEiD’s signature database .</p>
<p>A PEiD signature file is essentially an INI file with the packer name as the section name and two keys: the <span style="text-decoration:underline;">signature</span> key containing the byte pattern and the <span style="text-decoration:underline;">ep_only</span> key (which is ignored by the PEiD.py script), example:</p>
<pre>[Packer Name]
signature = B4 4D CD 21 E8 ?? ?? FD E8 ?? ?? B4 51 CD  21
ep_only = true</pre>
<p>In order to run the script you need to get the latest PyHiew (<a href="http://code.google.com/p/pyhiew/downloads/detail?name=pyhiew0.2.1a.zip" target="_blank">PyHiew 0.2.1a</a>) and a copy of UserDb.TXT (it used to be here <a href="http://www.peid.info/BobSoft/Downloads/UserDB.zip">http://research.pandasecurity.com/blogs/images/userdb.txt</a>):</p>
<ul>
<li>Unpack the Pyhiew archive into Hiew’s folder</li>
<li>Copy “UserDb.txt” to %hiew%\PyHiew</li>
<li>Now open a PE file with Hiew
<ul>
<li>Switch to Hex view (press ENTER)</li>
<li>Press F8 to show the header info</li>
<li>Press F5 to jump to OEP</li>
</ul>
</li>
<li>Now press F11 to load the HEM plugins
<ul>
<li>Select PyHiew</li>
<li>Select PEiD script</li>
</ul>
</li>
</ul>
<p>Please note that you can configure PEiD.py to use any signature database or databases of your choice. Simply edit the script and adjust the following lines:</p>
<pre># Add more PEiD signatures to this list
PEID_DATABASES      = ['UserDB.TXT']</pre>
<p>When PEiD.py parses the signature files, it will generate a cache file (peid-db.cache) so that the next time scanning will be faster. Please delete the cache file if you edit your signature files (it will be regenerated again).</p>
<p>And here is PyHiew’s PEiD in action:</p>
<p><img src="http://0xeb.files.wordpress.com/2011/03/screenhunter_02-mar-05-23-59.gif?w=640" border="0" alt="PyHiew's PEiD" /></p>
<p>The <span style="text-decoration:underline;">depth</span> value indicates after how many bytes scanned the pattern was matched. If there is more than one match, the output window will display the rest of the matches.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/0xeb.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/0xeb.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/0xeb.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=98&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://0xeb.wordpress.com/2011/03/06/pyhiew-and-peid/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f7a678b6b38492f46e59f48c03a777c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xeb</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2011/03/screenhunter_02-mar-05-23-59.gif" medium="image">
			<media:title type="html">PyHiew's PEiD</media:title>
		</media:content>
	</item>
		<item>
		<title>PyHiew: Transferring names between IDA Pro and Hiew</title>
		<link>http://0xeb.wordpress.com/2010/10/13/pyhiew-transferring-names-between-ida-pro-and-hiew/</link>
		<comments>http://0xeb.wordpress.com/2010/10/13/pyhiew-transferring-names-between-ida-pro-and-hiew/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 21:20:38 +0000</pubDate>
		<dc:creator>0xeb</dc:creator>
				<category><![CDATA[IDA Pro]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://0xeb.wordpress.com/?p=92</guid>
		<description><![CDATA[Last week I updated PyHiew to version 0.2.0 which adds the ability to manage names in Hiew (add local/global names and comments). In this blog post I demonstrate how to use these facilities to transfer names between IDA Pro and &#8230; <a href="http://0xeb.wordpress.com/2010/10/13/pyhiew-transferring-names-between-ida-pro-and-hiew/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=92&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I updated PyHiew to version <a href="http://code.google.com/p/pyhiew/source/detail?r=3" target="_blank">0.2.0</a> which adds the ability to manage names in Hiew (add local/global names and comments).</p>
<p>In this blog post I demonstrate how to use these facilities to transfer names between IDA Pro and Hiew.</p>
<p>Here’s a summary of the script logic:</p>
<ul>
<li>A PyHiew script will act as a server</li>
<li>It will display an information dialog and setups up a server socket then wait for connections</li>
<li>An IDA Pro python script will act as a client to send the names from IDA to Hiew</li>
<li>Hiew receives and populates the names</li>
</ul>
<h3>Using the script</h3>
<p>Load the IDA client script (pyhiew\<strong>3rd\IDA-Names-Client.py</strong>) from the PyHiew package</p>
<p><img title="names-sel-script" src="http://0xeb.files.wordpress.com/2010/10/namesselscript.gif?w=319&#038;h=112" border="0" alt="names-sel-script" width="319" height="112" /></p>
<p>A message box will show, do not close it until you proceed with Hiew</p>
<p><img title="names-ida-wait" src="http://0xeb.files.wordpress.com/2010/10/namesidawait.gif?w=343&#038;h=148" border="0" alt="names-ida-wait" width="343" height="148" /></p>
<p>Now run Hiew and open the desired file and press <strong>F11</strong> to toggle the HEM modules.<br />
Select PyHiew and then the <strong>IDA-Names-Server script<br />
</strong>The script will display a message window like this:</p>
<p><img title="names-wait" src="http://0xeb.files.wordpress.com/2010/10/nameswait.gif?w=592&#038;h=189" border="0" alt="names-wait" width="592" height="189" /></p>
<p>Depending on what you want to transfer you may press one of the function keys.</p>
<p>After selecting an option, Hiew will display a wait box. Now switch back to IDA and press OK to connect to Hiew and start the name transfer.</p>
<p>If the operation succeeds then the name count will be displayed:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/10/namesaftercopy.gif"><img style="display:inline;border-width:0;" title="names-after-copy" src="http://0xeb.files.wordpress.com/2010/10/namesaftercopy_thumb.gif?w=615&#038;h=128" border="0" alt="names-after-copy" width="615" height="128" /></a></p>
<p>In Hiew (Hex/Asm view) you may press <strong>F12</strong> to display the name window:</p>
<p><img title="names-transferred" src="http://0xeb.files.wordpress.com/2010/10/namestransferred.gif?w=580&#038;h=257" border="0" alt="names-transferred" width="580" height="257" /></p>
<p>That’s it! This script ships with <a href="http://pyhiew.googlecode.com/files/pyhiew0.2.1.zip" target="_blank">PyHiew 0.2.1</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/0xeb.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/0xeb.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/0xeb.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=92&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://0xeb.wordpress.com/2010/10/13/pyhiew-transferring-names-between-ida-pro-and-hiew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f7a678b6b38492f46e59f48c03a777c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xeb</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/10/namesselscript.gif" medium="image">
			<media:title type="html">names-sel-script</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/10/namesidawait.gif" medium="image">
			<media:title type="html">names-ida-wait</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/10/nameswait.gif" medium="image">
			<media:title type="html">names-wait</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/10/namesaftercopy_thumb.gif" medium="image">
			<media:title type="html">names-after-copy</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/10/namestransferred.gif" medium="image">
			<media:title type="html">names-transferred</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing PyHiew</title>
		<link>http://0xeb.wordpress.com/2010/08/21/introducing-pyhiew/</link>
		<comments>http://0xeb.wordpress.com/2010/08/21/introducing-pyhiew/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 08:20:19 +0000</pubDate>
		<dc:creator>0xeb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://0xeb.wordpress.com/?p=60</guid>
		<description><![CDATA[PyHiew (open source project) is a Hiew external module (HEM) that allows users to write Python scripts that can interface with Hiew. It wraps most of the functionality present in the HEM SDK, thus allowing the users to programmatically access &#8230; <a href="http://0xeb.wordpress.com/2010/08/21/introducing-pyhiew/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=60&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/pyhiew/" target="_blank">PyHiew</a> (open source project) is a <a href="http://www.hiew.ru/" target="_blank">Hiew</a> external module (<a href="http://www.hiew.ru/hem.html" target="_blank">HEM</a>) that allows users to write Python scripts that can interface with Hiew.</p>
<p>It wraps most of the functionality present in the HEM SDK, thus allowing the users to programmatically access Hiew and do things like:</p>
<ul>
<li>Create windows</li>
<li>Create menus</li>
<li>Show messages</li>
<li>Get input from user</li>
<li>File I/O: Read, Write, Find</li>
<li>etc…</li>
</ul>
<p>For example, here is a “Hello world” script:</p>
<blockquote><p>import hiew</p>
<p>hiew.Message(&#8220;Hi&#8221;, &#8220;Hello world!&#8221;)</p></blockquote>
<p><a href="http://0xeb.files.wordpress.com/2010/08/hello_world.gif"><img style="display:inline;border-width:0;" title="hello_world" src="http://0xeb.files.wordpress.com/2010/08/hello_world_thumb.gif?w=390&#038;h=65" border="0" alt="hello_world" width="390" height="65" /></a></p>
<p>To demonstrate how it works, let us <a href="http://pyhiew.googlecode.com/files/pyhiew0.1.1.zip" target="_blank">download</a> the pre-compiled package and install it:</p>
<ul>
<li>Unzip the package to %HIEW%</li>
<li>Verify that %HIEW%\pyhiew folder exists</li>
<li>Make sure that Python 2.7 is installed</li>
<li>Run hiew32 against an input file</li>
<li>Press F11 to launch Hiew’s the external modules browser</li>
</ul>
<p><a href="http://0xeb.files.wordpress.com/2010/08/hem_list3.gif"><img style="display:inline;border-width:0;" title="hem_list" src="http://0xeb.files.wordpress.com/2010/08/hem_list_thumb1.gif?w=553&#038;h=168" border="0" alt="hem_list" width="553" height="168" /></a></p>
<p>If other HEMs are installed they will be listed too.</p>
<p>Pressing ENTER to select “Python Hiew” will take you to PyHiew’s script browser:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/cliptext_hem2.gif"><img style="display:inline;border-width:0;" title="cliptext_hem" src="http://0xeb.files.wordpress.com/2010/08/cliptext_hem_thumb.gif?w=369&#038;h=160" border="0" alt="cliptext_hem" width="369" height="160" /></a></p>
<p>What you see is a list of PyHiew scripts (in %HIEW%\pyhiew) that come with the package:</p>
<ul>
<li>ClipText: a script that allows you to copy Hiew selection to clipboard into various formats (C source, Pascal, text, …)</li>
<li>Decompress: a script that will allow you to decompress a gzip compatible stream from inside Hiew</li>
<li>hello: the hello world script</li>
<li>test_pyshell: a simple script that allows you to execute Python statements</li>
</ul>
<p>Let us now play with ClipText by making a block selection with Hiew and pressing F11 –&gt; PyHiew –&gt; ClipText</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/cliptext_menu_c2.gif"><img style="display:inline;border-width:0;" title="cliptext_menu_c" src="http://0xeb.files.wordpress.com/2010/08/cliptext_menu_c_thumb.gif?w=384&#038;h=124" border="0" alt="cliptext_menu_c" width="384" height="124" /></a></p>
<p>We select “Copy as C array” and press ENTER:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/cliptext_copied_c3.gif"><img style="display:inline;border-width:0;" title="cliptext_copied_c" src="http://0xeb.files.wordpress.com/2010/08/cliptext_copied_c_thumb.gif?w=533&#038;h=142" border="0" alt="cliptext_copied_c" width="533" height="142" /></a></p>
<p>To verify that it works, let us open a text editor and paste from the clipboard:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/cliptext_out_c2.gif"><img style="display:inline;border-width:0;" title="cliptext_out_c" src="http://0xeb.files.wordpress.com/2010/08/cliptext_out_c_thumb.gif?w=644&#038;h=117" border="0" alt="cliptext_out_c" width="644" height="117" /></a></p>
<p>It works! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Let us now run the Decompress script by first loading a PDF file that got some streams with FlateDecode filter:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/decompress1_select_stream2.gif"><img style="display:inline;border-width:0;" title="decompress1_select_stream" src="http://0xeb.files.wordpress.com/2010/08/decompress1_select_stream_thumb.gif?w=544&#038;h=192" border="0" alt="decompress1_select_stream" width="544" height="192" /></a></p>
<p>We manually select the stream (we don’t have to if we write a small script that detected the boundaries for us) and press F11 –&gt; PyHiew –&gt; Decompress:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/decompress1_outfile2.gif"><img style="display:inline;border-width:0;" title="decompress1_outfile" src="http://0xeb.files.wordpress.com/2010/08/decompress1_outfile_thumb.gif?w=576&#038;h=72" border="0" alt="decompress1_outfile" width="576" height="72" /></a></p>
<p>The script will ask for an output file name, and after that we can open that file and verify if decompression went okay:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/decompress1_out2.gif"><img style="display:inline;border-width:0;" title="decompress1_out" src="http://0xeb.files.wordpress.com/2010/08/decompress1_out_thumb.gif?w=646&#038;h=331" border="0" alt="decompress1_out" width="646" height="331" /></a></p>
<p>Neat huh?! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you’re curious, here’s the Decompress.py source code:</p>
<p><a href="http://0xeb.files.wordpress.com/2010/08/decompress_src3.gif"><img style="display:inline;border-width:0;" title="decompress_src" src="http://0xeb.files.wordpress.com/2010/08/decompress_src_thumb1.gif?w=519&#038;h=622" border="0" alt="decompress_src" width="519" height="622" /></a></p>
<p>That’s it for now. Make sure you refer to the “doc” folder if you want to write your own scripts.</p>
<p>A discussion <a href="http://groups.google.com/group/pyhiew" target="_blank">group</a> has been created to share useful scripts and address technical problems.</p>
<p>Last but not least, for those who do not know, you can have process editing facilities in Hiew simply by using my old utility Hiew+  (which still works with the latest versions of Hiew). Get it from <a href="http://lgwm.org/projects/hiewplus/">http://lgwm.org/projects/hiewplus/</a>.</p>
<p>Stay tuned!<br />
Elias</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/0xeb.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/0xeb.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/0xeb.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=0xeb.wordpress.com&amp;blog=10209773&amp;post=60&amp;subd=0xeb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://0xeb.wordpress.com/2010/08/21/introducing-pyhiew/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f7a678b6b38492f46e59f48c03a777c3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0xeb</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/hello_world_thumb.gif" medium="image">
			<media:title type="html">hello_world</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/hem_list_thumb1.gif" medium="image">
			<media:title type="html">hem_list</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/cliptext_hem_thumb.gif" medium="image">
			<media:title type="html">cliptext_hem</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/cliptext_menu_c_thumb.gif" medium="image">
			<media:title type="html">cliptext_menu_c</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/cliptext_copied_c_thumb.gif" medium="image">
			<media:title type="html">cliptext_copied_c</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/cliptext_out_c_thumb.gif" medium="image">
			<media:title type="html">cliptext_out_c</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/decompress1_select_stream_thumb.gif" medium="image">
			<media:title type="html">decompress1_select_stream</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/decompress1_outfile_thumb.gif" medium="image">
			<media:title type="html">decompress1_outfile</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/decompress1_out_thumb.gif" medium="image">
			<media:title type="html">decompress1_out</media:title>
		</media:content>

		<media:content url="http://0xeb.files.wordpress.com/2010/08/decompress_src_thumb1.gif" medium="image">
			<media:title type="html">decompress_src</media:title>
		</media:content>
	</item>
	</channel>
</rss>
