<?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/"
	>

<channel>
	<title>All Things IT Blog &#187; Reverse Engineering</title>
	<atom:link href="http://www.enusbaum.com/blog/category/reverse-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.enusbaum.com/blog</link>
	<description>My little nerded out corner of the Internets!</description>
	<lastBuildDate>Tue, 18 Oct 2011 20:22:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Did LulzSec poison Google&#8217;s search results?</title>
		<link>http://www.enusbaum.com/blog/2011/06/did-lulzsec-poison-googles-search-results/</link>
		<comments>http://www.enusbaum.com/blog/2011/06/did-lulzsec-poison-googles-search-results/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 18:15:57 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[LulzBoat]]></category>
		<category><![CDATA[LulzSec]]></category>
		<category><![CDATA[Poisoned Results]]></category>
		<category><![CDATA[Rainbow]]></category>
		<category><![CDATA[Search Results]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=447</guid>
		<description><![CDATA[I was looking for some more information on LulzSec this afternoon and while poking around Google, my search results went funky (and albeit, more colorful than normal): I thought this might have been some funny business either with my SSH tunnel or Firefox, but I was able to replicate the results using IE and a [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for some more information on <a title="Homepage -- LulzSec" href="http://lulzsecurity.com/">LulzSec </a>this afternoon and while poking around Google, my search results went funky (and albeit, more colorful than normal):</p>
<div id="attachment_448" class="wp-caption aligncenter" style="width: 440px"><a href="http://www.enusbaum.com/blog/wp-content/uploads/2011/06/lulz.png"><img class="size-large wp-image-448  " title="LulzSec poisons Google?" src="http://www.enusbaum.com/blog/wp-content/uploads/2011/06/lulz-1024x479.png" alt="" width="430" height="201" /></a><p class="wp-caption-text">LulzSec poisons Google?</p></div>
<p>I thought this might have been some funny business either with my SSH tunnel or Firefox, but I was able to replicate the results using IE and a different proxy altogether:</p>
<p style="text-align: center;">&nbsp;</p>
<div id="attachment_449" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.enusbaum.com/blog/wp-content/uploads/2011/06/lulz2.png"><img class="size-medium wp-image-449 " title="LulzSec poisoned results in IE" src="http://www.enusbaum.com/blog/wp-content/uploads/2011/06/lulz2-300x150.png" alt="" width="300" height="150" /></a><p class="wp-caption-text">LulzSec poisoned Google Results in IE</p></div>
<p style="text-align: left;">The poison itself looks like a CSS or Javascript injection where it  creates a rainbow connected to the search button. The rest of the search  results are skewed.</p>
<p style="text-align: left;">So essentially I was able to replicate the poisoned results multiple times across multiple browsers. You have to search for the term &#8220;LulzSec&#8221; and F5 until you happen to get the result. I imagine this is a case where the Google Index with the poisoned results hasn&#8217;t propagated across the ENTIRE Google farm yet, so you&#8217;ll have to play search results roulette until you get it.</p>
<p style="text-align: left;">This is either something weird going on at Google, or LulzSec is indeed the most badass group of hackers this world has ever known. Poisoning the Google Search results is like the Holy Grail of awesome hacks! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="su-linkbox" id="post-447-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.enusbaum.com/blog/2011/06/did-lulzsec-poison-googles-search-results/&quot;&gt;Did LulzSec poison Google&#8217;s search results?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2011/06/did-lulzsec-poison-googles-search-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Old School Game: Reuinion (and a Saved Game Editor)</title>
		<link>http://www.enusbaum.com/blog/2009/06/old-school-game-reuinion-and-a-saved-game-editor/</link>
		<comments>http://www.enusbaum.com/blog/2009/06/old-school-game-reuinion-and-a-saved-game-editor/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 01:00:46 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General Software]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Abandonware]]></category>
		<category><![CDATA[Cheater]]></category>
		<category><![CDATA[DOSBox]]></category>
		<category><![CDATA[Game Editor]]></category>
		<category><![CDATA[Reunion]]></category>
		<category><![CDATA[Trainer]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=309</guid>
		<description><![CDATA[Does anyone else remember playing Reunion back on their 386&#8242;s with a staggering 2MB of RAM? Lord knows I remember! Reunion came out over fifteen years ago and I still feel the urge to play it now and then even today. It&#8217;s a great game and can be downloaded from many abandonawre sites across the [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_310" class="wp-caption aligncenter" style="width: 648px"><img class="size-full wp-image-310" title="Reunion Title Screen" src="http://www.enusbaum.com/blog/wp-content/uploads/2009/06/reunion.png" alt="Reunion Title Screen" width="638" height="398" /><p class="wp-caption-text">Reunion Title Screen</p></div>
<p>Does anyone else remember playing <a title="Link -- Wikipedia Article: Reunion" href="http://en.wikipedia.org/wiki/Reunion_(video_game)" target="_blank">Reunion</a> back on their 386&#8242;s with a staggering 2MB of RAM? Lord knows I remember!</p>
<p>Reunion came out over fifteen years ago and I still feel the urge to play it now and then even today. It&#8217;s a great game and can be downloaded from many <a title="Abandonia -- Reunion (1994)" href="http://www.abandonia.com/en/games/150/Reunion.html" target="_blank">abandonawre</a> sites across the internet.</p>
<p>I started playing again recently using <a title="Link -- DOSBox Homepage" href="http://www.dosbox.com/" target="_blank">DOSBox</a> and I was amazed, because I didn&#8217;t even know the game had sound! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  When I played &#8220;back in the day&#8221;, my system didn&#8217;t have a Sound Card (because I couldn&#8217;t afford a <a title="Link -- Wikipedia Article: AWE32" href="http://en.wikipedia.org/wiki/Sound_Blaster_AWE32" target="_blank">Creative AWE32</a>), so needless to say it was a whole different experience. The game has a fantastic production value and even when modern development languages, I&#8217;m not sure that even I&#8217;d be able to create a game of such depth a complexity!</p>
<p>Anywho, I began to get frustrated because I knew there were parts of the game I was missing because I couldn&#8217;t meet certain goals or didn&#8217;t have enough resources. Granted, I should have spent the time perfecting the game and working towards those achievements&#8230;.. but it&#8217;s an old game and I don&#8217;t have as much free time as I did when I was thirteen years old <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>To that end, I sat down and studied the Save Game format for a while and also the (paltry) Save Editor that was included in the Abandonware version. I knew I could come up with something better that gives me even more options in the game. It took me a couple hours but I was able to come up with a pretty functional Saved Game Editor for Reunion that works around a couple glitches the previous version had.</p>
<p>I know, I&#8217;m a total cheater but it was a fun little project and I figure perhaps ONE person on the entirety of the Internet must need something like this as well, so I figure I&#8217;d throw it out there for anyone who needs it <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Reunion Saved Game Editor</strong> &#8211; <a href="http://www.enusbaum.com/blog/wp-content/uploads/2009/06/reunionsge.zip">Download</a> (92kb)</p>
<div class="su-linkbox" id="post-309-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.enusbaum.com/blog/2009/06/old-school-game-reuinion-and-a-saved-game-editor/&quot;&gt;Old School Game: Reuinion (and a Saved Game Editor)&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/06/old-school-game-reuinion-and-a-saved-game-editor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>.NET StringBuilder &#8212; Fast, but not as fast as you think!</title>
		<link>http://www.enusbaum.com/blog/2009/05/net-stringbuilder-fast-but-not-as-fast-as-you-think/</link>
		<comments>http://www.enusbaum.com/blog/2009/05/net-stringbuilder-fast-but-not-as-fast-as-you-think/#comments</comments>
		<pubDate>Thu, 28 May 2009 20:18:47 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Microsoft .NET 3.0 / WinFX]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[.NET Optimization]]></category>
		<category><![CDATA[.NET Profiler]]></category>
		<category><![CDATA[.NET Profiling]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C# Optimization]]></category>
		<category><![CDATA[C# String Concatenation]]></category>
		<category><![CDATA[C# String Manipulation]]></category>
		<category><![CDATA[C# Strings]]></category>
		<category><![CDATA[StringBuilder]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=294</guid>
		<description><![CDATA[StringBuilder: Friend or Foe?]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a situation where I was tasked to profile some .NET code and do some optimizations anywhere hot spots popped up. I was amazed to find out that one of the BIGGEST offenders in our code block was a simple call to <strong>StringBuilder.Append(char)</strong>. I had to take a step back and scratch my head and wonder if my profiler was confused.</p>
<p>I re-ran some tests using the <strong>StopWatch</strong> class to hard code some metrics into the application and they also confirmed the findings. What&#8217;s up? How could a class that everyone says you can use to your hearts content when it came to string concatenation was failing me?</p>
<p>Turns out, it was a mix of misuse and a common misconception about the <a title="MSDN Documentation -- StringBuilder Class" href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx" target="_blank">StringBuilder Class</a>.</p>
<p><span id="more-294"></span></p>
<p>One of the first things you learn while picking up .NET is that the <a title="MSDN Documentation -- StringBuilder Class" href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx" target="_blank">StringBuilder Class</a> is your friend when it comes to concatenating large strings in memory. It beats the pants off of <a title="MSDN Documentation -- String.Concat Method" href="http://msdn.microsoft.com/en-us/library/system.string.concat.aspx" target="_blank">String.Concat</a> and <a title="MSDN Documentation -- String.Format Method" href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx" target="_blank">String.Format</a>, while also being a mutable object in the Framework utilizing an in-memory buffer.</p>
<p>I used <a title="Homepage -- JetBrains dotTrace Profiler" href="http://www.jetbrains.com/profiler/" target="_blank">JetBrains dotTrace</a> to help profile the application and it was very evident from the get-go that StringBuilder was causing the whole process to slow down.</p>
<p>The nature of my application was basically reading in a text buffer 1 character as a time, and using the <strong>StringBuilder</strong> as an output buffer. So for a 1k file, The method <strong>Append(char)</strong> would be called 1024 times. A 600k file would call <strong>Append(char)</strong> 614,400 times.</p>
<p>So why was I getting burned in execution time? The issue turned out to be two fold.</p>
<p>First, there&#8217;s overhead cost to the call. I don&#8217;t care how lightweight your method is, if you&#8217;re calling it <span style="text-decoration: underline;"><strong>SIX HUNDRED THOUSAND TIMES</strong></span>, it&#8217;s going to take a bit. Let alone a method who handles a string buffer in memory and string manipulation. So basically, no matter how fast StringBuilder actually is, it&#8217;s not a free call and you should consider the fact that the call still has overhead when architecting your solution.</p>
<p>Architecture brings me to my second point. While writing each character individually made sense initally, it seems that it was just lazy <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  The optimized route would have been calling Append with a SUBSTRING of the input buffer, this way we avoid the overhead of multiple calls by writing all the neccisary data in one big blob.</p>
<p>So 600,000 calls to <strong>StringBuilder.Append(char)</strong> becomes only a few hundred calls to <strong>StringBuilder.Append(string.Substring(start, count))</strong>. Sure, the Substring Virtual Method itself has overhead, but it&#8217;s still less than the thousands of calls to <strong>Append(char)</strong> that we&#8217;re saving ourself <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Conclusion?</p>
<p>StringBuilder is fast, but it&#8217;s not free. Take this into consideration when utilizing it while appending large data sets in small chunks. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers!</p>
<div class="su-linkbox" id="post-294-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.enusbaum.com/blog/2009/05/net-stringbuilder-fast-but-not-as-fast-as-you-think/&quot;&gt;.NET StringBuilder &#8212; Fast, but not as fast as you think!&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/05/net-stringbuilder-fast-but-not-as-fast-as-you-think/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>To All BBS Software Authors &#8211; Please Donate Your Artwork To The People!</title>
		<link>http://www.enusbaum.com/blog/2008/01/to-all-bbs-software-authors-please-donate-your-artwork-to-the-people/</link>
		<comments>http://www.enusbaum.com/blog/2008/01/to-all-bbs-software-authors-please-donate-your-artwork-to-the-people/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 18:24:10 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[General Software]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Abandonware]]></category>
		<category><![CDATA[BBS]]></category>
		<category><![CDATA[MajorBBS]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2008/01/29/to-all-bbs-software-authors-please-donate-your-artwork-to-the-people/</guid>
		<description><![CDATA[I&#8217;m a child of the BBS generation. Well, to be fair to all the grey beards out there, I&#8217;m a child of the late BBS generation (1993-1998). I have many, many fond memories of my favorite door games, FidoNet threads and meet-ups. I frequented a local BBS here in San Diego, California called Dream Net. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a child of the <a href="http://en.wikipedia.org/wiki/Bulletin_board_system" title="Wikipedia -- Bulliten Board System" target="_blank">BBS</a> generation. Well, to be fair to all the grey beards out there, I&#8217;m a child of the late BBS generation (1993-1998). I have many, many fond memories of my favorite door games, FidoNet threads and meet-ups.</p>
<p>I frequented a local BBS here in San Diego, California called Dream Net. Dream Net ran a multi-line BBS software called <a href="http://en.wikipedia.org/wiki/MajorBBS" title="Wikipedia -- The MajorBBS System" target="_blank">MajorBBS</a> and was sysoped by Blondie (Tara) and Reep (George). What made Dream Net so great is that being multi-lined allowed it to host some of the first great MUD&#8217;s such as <a href="http://en.wikipedia.org/wiki/MajorMUD" title="Wikipedia -- MajorMUD" target="_blank">MajorMUD</a> and my personal favorite, Tele-Arena. Other great multi-user games included <a href="http://en.wikipedia.org/wiki/TradeWars_2002" title="Wikipedia -- TradeWars 2002" target="_blank">TradeWars 2002</a>, Farwest Trivia and T-LORD (Tournament LORD, which was a version of <a href="http://en.wikipedia.org/wiki/Legend_of_the_Red_Dragon" title="Wikipedia -- Legend Of The Red Dragon" target="_blank">Legend of the Red Dragon</a> for MajorBBS).</p>
<p>Now over fifteen years later, BBS&#8217;s are all but dead. Those of us who used them try and contact old friends using sites like <a href="http://www.bbsmates.com/" title="BBSMates -- Website Connecting old school BBS users!" target="_blank">BBSMates.com</a>. People have put out <a href="http://www.bbsdocumentary.com/" title="Homepage -- BBS: The Documentary" target="_blank">documentarties</a> and <a href="http://www.amazon.com/Commodork-Sordid-Tales-BBS-Junkie/dp/1847285821/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1201626811&amp;sr=1-1" title="Amazon.com -- Commodork: Sordid Tales from a BBS Junkie" target="_blank">books</a> on the BBS culture and lamenting of those days when carrier signals screamed from little boxes. I believe as a whole the remaining BBS community is very co-operative in trying to preserve their past and makes sure the software, which easily qualifies as <a href="http://en.wikipedia.org/wiki/Abandonware" title="Wikipedia -- Abandonware" target="_blank">abandonware</a>, doesn&#8217;t fall victim to the cyber ether to be lost forever on a floppy disk in a closet somewhere. A great example of this effort is <a href="http://www.themajorbbs.com/majorbbs/servlet/MBBSMain" title="Homepage -- The MajorBBS Resotration Project" target="_blank">The MajorBBS Restoration Project</a>.</p>
<p>The MajorBS Restoration Project is a group of people ranging from hardcore software developers to enthusiasts looking to preserve and restore everything relating to the MajorBBS bulletin board software and related software. One thing people are running into is the legality and morality of using &#8216;pirated&#8217; copies of software that is no longer for sale or the parent companies no longer exist. I have found myself in the same situation and began to dabble in MajorBBS reverse engineering in order to make the modules I wished to use for my own private purposes, functional.</p>
<p>For the most part, previous license holders for MajorBBS software have come forward and donated their source code, which represents thousands of hours in hard work and labor, to the community for preservation and continued development by enthusiasts. An example of this would be M.B. Murdock &amp; Associates and their MajorBBS game Galactic Empire.  As a company, they closed their doors in 1996 due to the decline in BBS sales, but in 2002 Mike Murdock released the source code for the Galactic Empires MajorBBS module under the GPL license.</p>
<p>There have been a few software vendors who have been known to protect the MajorBBS modules they&#8217;ve developed either as a corporation, or as an individual developer who ran his own business during this period. Part of me, as a software developer myself, can understand that you might not want to just give out the source code to something you&#8217;ve worked so hard on. Lord knows I don&#8217;t go around handing out my own <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   But some of these people actually go as far to being legal action against individuals who are running &#8216;pirated&#8217; copies of their software, fifteen years after it was released.</p>
<p>I&#8217;m not saying that it justifies piracy, but I think legally if I can prove:</p>
<ul>
<li>The software is over a certain age (perhaps ten+ years)</li>
<li>The originating company no longer exists, or</li>
<li>The company does exist but will no longer sell copies of the software</li>
</ul>
<p>Then, aren&#8217;t they just using their old software as bait to perhaps lure users into a lawsuit for pirating software that was impossible to purchase by legal means.</p>
<p>What I would love to see is a movement to simply preserve the past. My past. Millions of people&#8217;s pasts. Let&#8217;s try to come together using projects like the MajorBBS Restoration Project or others of it&#8217;s type, and get those programs we all love and remember back in the open before they&#8217;re lost forever! Even a simple keygen that would take a software author a few hours to package and release could help many, many people.</p>
<div class="su-linkbox" id="post-83-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.enusbaum.com/blog/2008/01/to-all-bbs-software-authors-please-donate-your-artwork-to-the-people/&quot;&gt;To All BBS Software Authors &#8211; Please Donate Your Artwork To The People!&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2008/01/to-all-bbs-software-authors-please-donate-your-artwork-to-the-people/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Semagic LiveJournal Client Password Decryption and Recovery</title>
		<link>http://www.enusbaum.com/blog/2007/02/semagic-livejournal-client-password-decryption-and-recovery/</link>
		<comments>http://www.enusbaum.com/blog/2007/02/semagic-livejournal-client-password-decryption-and-recovery/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 18:09:07 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[LiveJournal]]></category>
		<category><![CDATA[Password Decrypt]]></category>
		<category><![CDATA[Password Decrypter]]></category>
		<category><![CDATA[Semagic]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/02/15/semagic-livejournal-client-password-decryption-and-recovery/</guid>
		<description><![CDATA[Semagic (link) is a client application for LiveJournal (link). Recently I needed to recover a password that was &#8216;remembered&#8217; by Semagic, but it was hidden in the password field. Simple password unmasking applications weren&#8217;t helping me any as the field itself isn&#8217;t a simple password box. After further investigation I was able to find where [...]]]></description>
			<content:encoded><![CDATA[<p>Semagic (<a href="http://semagic.sourceforge.net/">link</a>) is a client application for LiveJournal (<a href="http://www.livejournal.com">link</a>).</p>
<p>Recently I needed to recover a password that was &#8216;remembered&#8217; by Semagic, but it was hidden in the password field. Simple password unmasking applications weren&#8217;t helping me any as the field itself isn&#8217;t a simple password box.</p>
<p>After further investigation I was able to find where Semagic stores the saved passwords in the Windows Registry. It was obvious that the password was encrypted and was stored in it&#8217;s entire form. Since Semagic is open source, I was able to find the code block which served as its password decrypter:</p>
<p>[cpp] m_password = m_app-&gt;GetProfileString(userkey, _T(&#8220;password&#8221;), _T(&#8220;&#8221;));    //Gets Encrypted password from registry<br />
enc = m_app-&gt;GetProfileInt(userkey, _T(&#8220;obscure&#8221;), 0);    //Checks to see if the password is &#8216;obscured&#8217;</p>
<p>if (enc) {    //If password is obscured<br />
LPTSTR str = m_password.GetBuffer(m_password.GetLength());    //Password<br />
LPTSTR key = new TCHAR[m_user.GetLength()+1];    //Sets Key Size (Username + 1)<br />
_tcsncpy(key, (LPCTSTR) m_user, m_user.GetLength()+1);    //Copies Username to Key<br />
LPTSTR orig = key;</p>
<p>while (*str) {<br />
if (!*key)    //If we&#8217;re OOB on the key, reset it<br />
key = orig;<br />
*(str) -= &#8216;a&#8217;;    //subtract the value of &#8216;a&#8217;, which is 97, from the encrypted value<br />
*(str++) ^= *(key++);    //XOR bitwise based on the key<br />
}<br />
key = orig;<br />
m_password.ReleaseBuffer();<br />
delete[] key;<br />
}</p>
<p>[/cpp]</p>
<p>So needless to say it was just a matter of debugging and some time before I was able to port the decryption routine over to a stand alone C# application.</p>
<p>[csharp]</p>
<p>for (int iLoop = 0; iLoop &lt; Convert.ToString(sPassword).Length; iLoop++)<br />
{<br />
int iInputCharacter = (int)Convert.ToChar(sPassword.ToString().Substring(iLoop,1));</p>
<p>if(iXORCharacter &gt;= sUserName.Length) iXORCharacter = 0;</p>
<p>iInputCharacter -= 97;<br />
iInputCharacter ^= (int)Convert.ToChar(sUserName.Substring(iXORCharacter, 1));</p>
<p>textBox1.Text += (char)iInputCharacter;</p>
<p>iXORCharacter++;<br />
}</p>
<p>[/csharp]</p>
<p>I&#8217;ve compiled a quick little program that&#8217;ll extract the usernames from the registry and display their passwords:</p>
<p><a id="p14" onmousedown="selectLink(14);" href="http://www.enusbaum.com/blog//wp-content/uploads/2007/02/semagicdecrypt.zip">Semagic Password Decrypter</a></p>
<p>This program is 100% safe and won&#8217;t e-mail your password to me or any other silly crap like that. I just figured someone out there would need it as well.</p>
<p>Cheers!</p>
<div class="su-linkbox" id="post-13-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.enusbaum.com/blog/2007/02/semagic-livejournal-client-password-decryption-and-recovery/&quot;&gt;Semagic LiveJournal Client Password Decryption and Recovery&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/02/semagic-livejournal-client-password-decryption-and-recovery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

