<?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>Red Stars &#187; Software</title>
	<atom:link href="http://blog.red-stars.net/category/technology/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.red-stars.net</link>
	<description>Programming, food, and rambling</description>
	<lastBuildDate>Sat, 08 May 2010 16:19:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Message Hasher</title>
		<link>http://blog.red-stars.net/technology/software/message-hasher/</link>
		<comments>http://blog.red-stars.net/technology/software/message-hasher/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 01:09:09 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.red-stars.net/?p=168</guid>
		<description><![CDATA[A small web-based message hasher, good for generating hashes of small amounts of text. No binary support yet, but it's planned via file uploads! #hasherform { display: inline-block; width: 400px; } #hasherform .wide { width: 100%; } #hasherform form * { margin-top: 8px; } #hasherform textarea { height: 10em; } Short Message Hasher Algorithm md2 [...]]]></description>
			<content:encoded><![CDATA[<p>A small web-based message hasher, good for generating hashes of small amounts of text. No binary support yet, but it's planned via file uploads!</p>
<p><span id="more-168"></span><br />
<style type="text/css">
	#hasherform {
		display: inline-block;
		width: 400px;
	}
	#hasherform .wide {
		width: 100%;
	}
	#hasherform form * {
		margin-top: 8px;
	}
	#hasherform textarea {
		height: 10em;
	}
</style>
<fieldset id="hasherform">
<legend>Short Message Hasher</legend>
<form method="get" target="/index.php">
		<label for="algorithm">Algorithm</label></p>
<select name="algorithm" class="wide" id="algorithm">
<option value="md2">md2</option>
<option value="md4">md4</option>
<option value="md5">md5</option>
<option value="sha1">sha1</option>
<option value="sha256">sha256</option>
<option value="sha384">sha384</option>
<option value="sha512">sha512</option>
<option value="ripemd128">ripemd128</option>
<option value="ripemd160">ripemd160</option>
<option value="ripemd256">ripemd256</option>
<option value="ripemd320">ripemd320</option>
<option value="whirlpool">whirlpool</option>
<option value="tiger128,3">tiger128,3</option>
<option value="tiger160,3">tiger160,3</option>
<option value="tiger192,3">tiger192,3</option>
<option value="tiger128,4">tiger128,4</option>
<option value="tiger160,4">tiger160,4</option>
<option value="tiger192,4">tiger192,4</option>
<option value="snefru">snefru</option>
<option value="gost">gost</option>
<option value="adler32">adler32</option>
<option value="crc32">crc32</option>
<option value="crc32b">crc32b</option>
<option value="haval128,3">haval128,3</option>
<option value="haval160,3">haval160,3</option>
<option value="haval192,3">haval192,3</option>
<option value="haval224,3">haval224,3</option>
<option value="haval256,3">haval256,3</option>
<option value="haval128,4">haval128,4</option>
<option value="haval160,4">haval160,4</option>
<option value="haval192,4">haval192,4</option>
<option value="haval224,4">haval224,4</option>
<option value="haval256,4">haval256,4</option>
<option value="haval128,5">haval128,5</option>
<option value="haval160,5">haval160,5</option>
<option value="haval192,5">haval192,5</option>
<option value="haval224,5">haval224,5</option>
<option value="haval256,5">haval256,5</option>
</select>
<p>
		<label for="message">Message</label><br />
		<textarea name="data" class="wide" id="message"></textarea></p>
<input type="checkbox" name="raw" id="rawcheckbox" /><label for="rawcheckbox">Return as raw data</label></p>
<input type="submit" value="Hash!" />
	</form>
</fieldset>
]]></content:encoded>
			<wfw:commentRss>http://blog.red-stars.net/technology/software/message-hasher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Windows 7 from and to the same hard drive</title>
		<link>http://blog.red-stars.net/technology/software/installing-windows-7-from-and-to-the-same-hard-drive/</link>
		<comments>http://blog.red-stars.net/technology/software/installing-windows-7-from-and-to-the-same-hard-drive/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 01:25:42 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://red-stars.net/wordpress/?p=105</guid>
		<description><![CDATA[The reason why is pretty simple, DVDs are not remotely as fast as any other media, and in 2009, it's starting to show. Flash drives are larger, faster, and more versatile than DVDs, and they're costing less and less. But what about an older system that can not boot from USB storage? Well, there is [...]]]></description>
			<content:encoded><![CDATA[<p>The reason why is pretty simple, DVDs are not remotely as fast as any other media, and in 2009, it's starting to show. Flash drives are larger, faster, and more versatile than DVDs, and they're costing less and less. But what about an older system that can not boot from USB storage? Well, there is an option, and that's to use the destination drive as the source. Install the drive into a separate computer (via a usb dongle is fine) and follow these steps. Note that these directions work if you're trying to make a bootable USB flash drive, too.</p>
<p><span id="more-105"></span><div class='toc wptoc'>
<h2>Contents</h2>
<ol class='toc-odd level-1'>
	<li>
		<a href="#Making_partitions_and_setting_the_drive_as_active">Making partitions and setting the drive as active</a>
	</li>
	<li>
		<a href="#Installing_the_boot_loader">Installing the boot loader</a>
	</li>
</ol>
</ol>
</ol>
</div>
<div class='wptoc-end'>&nbsp;</div></p>
<p>First on a different system you should remove all existing partitions and create new ones (optional), then set the partition as active, give it a boot loader, then give it the installation files.</p>
<span id="Making_partitions_and_setting_the_drive_as_active"><h3>Making partitions and setting the drive as active</h3></span>
<p>First execute <code>diskpart.exe</code> from inside of a console. You'll need to determine which drive is the hard drive you intend to do this to. Type in <code>list disk</code>. From now on, the drive number will be referred to as <em>n</em>.</p>
<p><code>select disk <em>n</em><br />
clean<br />
create partition primary<br />
select partition 1<br />
active<br />
format fs=NTFS quick<br />
assign<br />
exit</code></p>
<p><code>clean</code> will remove all existing partitions, then the partition is made and selected, <code>active</code> will mark is at an active partition which signals a bootloader to use this partition, the partition is then formatted, and mounted. Determine the drive letter assigned to the partition, this will be referred to as <em>m</em>.</p>
<span id="Installing_the_boot_loader"><h3>Installing the boot loader</h3></span>
<p>Using the <code>bootsect.exe</code> executable found in the <code>\boot\</code> directory of your Vista or Windows 7 DVD, install <b>Windows Boot Manager</b> (BOOTMGR) onto the drive using <code>bootsect.exe /nt60 <em>m:</em></code> . I can confirm that using a 32 bit executable to make a 64 bit installer does work, and vice versa.</p>
<p>That's it! You're all done! Boot from the drive and the installer will run.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.red-stars.net/technology/software/installing-windows-7-from-and-to-the-same-hard-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking Windows XP PowerToy Calculator to run in Vista/Windows 7</title>
		<link>http://blog.red-stars.net/technology/software/hacking-windows-xp-powertoy-calculator-to-run-in-vista/</link>
		<comments>http://blog.red-stars.net/technology/software/hacking-windows-xp-powertoy-calculator-to-run-in-vista/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 19:29:05 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://red-stars.net/wordpress/?p=74</guid>
		<description><![CDATA[How far would you go to use your favorite calculator? If the answer isn't a 75mb trace log, than you fail.]]></description>
			<content:encoded><![CDATA[<p>This was more of a project than I was originally expecting, Microsoft prevents the Windows XP Powertoy Calculator from running in Vista or Windows 7 in 2 separate places, but in the end, it runs perfectly in Vista, all the limitations are false.</p>
<p>Don't feel like doing this yourself? <a href="http://red-stars.net/random/PowerCalc.exe">No need!</a> <img src='http://blog.red-stars.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-74"></span><div class='toc wptoc'>
<h2>Contents</h2>
<ol class='toc-odd level-1'>
	<li>
		<a href="#Part_1:_The_Installer">Part 1: The Installer</a>
	</li>
	<li>
		<a href="#Part_2:_Oh..._no...">Part 2: Oh... no...</a>
	</li>
</ol>
</ol>
</ol>
</div>
<div class='wptoc-end'>&nbsp;</div></p>
<span id="Part_1:_The_Installer"><h3>Part 1: The Installer</h3></span>
<p><img src="http://red-stars.net/pictures/powercalc/01-cant_install.png" /><br />
When running <code>PowerCalcPowertoySetup.exe</code>, it complained that I'm not on Windows XP. Fair enough, but is that really important?</p>
<p>The exe installer dumped the MSI file at <code>C:\Windows\Downloaded Installations\Calculator Powertoy for Windows XP.msi</code> which I ran <a href="http://dennisbareis.com/msidiff.htm">MsiDiff</a> on to dump the MSI script. This gave me <code>Calculator Powertoy for Windows XP.msi.MmDumpTxt</code> which I searched for the above error in.</p>
<pre class="brush:plain"><$Row
	Condition="VersionNT = 501"
	Description="The powertoys require Windows XP or a service pack. They will not function on a version of Windows earlier or later than Windows XP."
></pre>
<p>Perfect. 501 is the Windows XP kernel version. Lets change that to the Vista kernal version in the MSI...<br />
<img src="http://red-stars.net/pictures/powercalc/02-hex.png" /></p>
<p><img src="http://red-stars.net/pictures/powercalc/03-installer.png" /><br />
Sweet! It worked!</p>
<span id="Part_2:_Oh..._no..."><h3>Part 2: Oh... no...</h3></span>
<p>Running <code>PowerCalc.exe</code> causes it to exit before ever giving us a GUI. Lets do a trace in <a href="http://www.ollydbg.de/">OllyDbg</a> and see what we can figure out.</p>
<pre class="brush:plain">01018405	Main	JE SHORT PowerCal.0101840C
0101840C	Main	TEST BYTE PTR SS:[EBP-30],1
01018410	Main	JE SHORT PowerCal.01018423
01018412	Main	MOVZX ECX,WORD PTR SS:[EBP-2C]	ECX=0000000A
01018416	Main	JMP SHORT PowerCal.01018426
01018426	Main	PUSH ECX	Arg4 = 0000000A
01018427	Main	PUSH EAX	Arg3 = 001E1F33
01018428	Main	PUSH EBX	Arg2 = 00000000
01018429	Main	PUSH PowerCal.01000000	Arg1 = 01000000
0101842E	Main	CALL PowerCal.01001FD3	EAX=00000000, ECX=D73F2C3E, EDX=7F68081A
01018433	Main	MOV ESI,EAX
01018435	Main	MOV DWORD PTR SS:[EBP-7C],ESI
01018438	Main	CMP DWORD PTR SS:[EBP-60],EBX
0101843B	Main	JNZ SHORT PowerCal.01018444
0101843D	Main	PUSH ESI	status = 0
0101843E	Main	CALL DWORD PTR DS:[<&#038;msvcrt.exit>]	ECX=0006FE28, EDX=00000000, EBP=0006FE84, ESI=00000001, EDI=00831BF0
    Process terminated, exit code 0</pre>
<p>The bottom of the trace-over  isn't telling us much. Lets check out some of these offsets in <a href="http://www.hex-rays.com/idapro/">IDA Pro</a> and see what we can come up with.</p>
<p><img src="http://red-stars.net/pictures/powercalc/04-ida_lower.png" /><br />
All the stuff around <code>0101843B</code> seems to exit the program, and none of these other offsets get us anywhere... lets run a trace-into and see what we get.</p>
<p>Aside from a 75mb text file, we get: (search from the bottom up for our programs address space! There's a lot of external code in there!).</p>
<pre class="brush:plain">010180E3	Main	RETN
01001FD1	Main	LEAVE	EBP=0006FEE4
01001FD2	Main	RETN
01001FDF	Main	TEST EAX,EAX
01001FE1	Main	JE PowerCal.010020A0
010020A0	Main	XOR EAX,EAX
010020A2	Main	POP ESI
010020A3	Main	LEAVE	EBP=0006FF88
010020A4	Main	RETN 10
01018433	Main	MOV ESI,EAX
01018435	Main	MOV DWORD PTR SS:[EBP-7C],ESI
01018438	Main	CMP DWORD PTR SS:[EBP-60],EBX
0101843B	Main	JNZ SHORT PowerCal.01018444
0101843D	Main	PUSH ESI	status = 0
0101843E	Main	CALL DWORD PTR DS:[<&#038;msvcrt.exit>]
exit	Main	MOV EDI,EDI</pre>
<p>Now we're talking! It looks like a function returns and then the program exits. Lets check out the call to that function.<br />
<img src="http://red-stars.net/pictures/powercalc/05-function_call.png" /></p>
<p>One path goes to the exit, the other... doesn't! Lets check out <code>sub_1001F60</code> to see what it does...<br />
<br /><img src="http://red-stars.net/pictures/powercalc/06-evil_version_check.png" /><br />
It's our evil Windows Version Checking function!</p>
<p>In OllyDbg lets goto the <code>jz loc_10020A0</code> after the function call, right click, and goto "nop" and press run. This causes the program to <em>always</em> follow the non-exiting code path.<br />
<img src="http://red-stars.net/pictures/powercalc/07-noping.png" /></p>
<p><img src="http://red-stars.net/pictures/powercalc/08-success.png" /><br />
Success!</p>
<p><img src="http://red-stars.net/pictures/powercalc/09-hex.png" /><br />
Lets hex edit that into the executable so it's like this all the time.</p>
<p>We can now use our calculator!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.red-stars.net/technology/software/hacking-windows-xp-powertoy-calculator-to-run-in-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Process Monitor and other tools to fix a broken installation.</title>
		<link>http://blog.red-stars.net/technology/software/using-process-monitor-and-other-tools-to-fix-a-broken-installation/</link>
		<comments>http://blog.red-stars.net/technology/software/using-process-monitor-and-other-tools-to-fix-a-broken-installation/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:30:27 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://red-stars.net/wordpress/?p=67</guid>
		<description><![CDATA[Sometimes things break, sometimes the only way to fix them breaks, sometimes you need to use kernel hooks to fix your favorite toy.]]></description>
			<content:encoded><![CDATA[<p>Today the stars were aligned and my VMWare installation decided to stop working. It's time for an upgrade, anyways.</p>
<p><img src="http://red-stars.net/pictures/vmwarefix/01-cannot_install.png" /><br />
Oh, that makes sense. So lets uninstall the old version.</p>
<p><img src="http://red-stars.net/pictures/vmwarefix/02-cannot_uninstall.png" /><br />
Can't install the new, can't uninstall the old. Time for some hackery!</p>
<p><span id="more-67"></span><div class='toc wptoc'>
<h2>Contents</h2>
<ol class='toc-odd level-1'>
</ol>
</div>
<div class='wptoc-end'>&nbsp;</div></p>
<p>First lets find out the name of the culprit installer with <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">Process Explorer</a>'s find tool, then in <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor</a> lets setup a filter to this executable.<br />
<img src="http://red-stars.net/pictures/vmwarefix/03-01-setup_filter.png" /><br />Re-running the installer lets us see what it's accessing. Using that we can find out what makes it think it's installed so we can trick it into thinking it's doing a fresh install. Once the error screen comes up, unattach the event monitor in Process Monitor (control+e).</p>
<p><img src="http://red-stars.net/pictures/vmwarefix/03-finding_traces.png" /><br />
This looks interesting. It's the registry key used by Window's Add/Remove Programs.</p>
<p><img src="http://red-stars.net/pictures/vmwarefix/04-renaming_installer_class.png" /><br />
Lets rename it to prevent the installer from seeing it then re-run the installer. Hmm... Semi-success. The installer now gives us the same error, but in a different place, so lets re-Process Monitor the installer.<br />
<img src="http://red-stars.net/pictures/vmwarefix/05-finding_more_traces.png" /><br />
Well! This looks very interesting! Lets rename this one as well...<br />
<img src="http://red-stars.net/pictures/vmwarefix/06-renaming.png" /></p>
<p>Hey! It's installing!</p>
<p>Finally, time to get back to work.<br />
<img src="http://red-stars.net/pictures/vmwarefix/07-dll_error.png" /><br />
Crap!</p>
<p>A DLL did not get replaced during the installation and a version mis-match is causing problems (why put the version number in the filename and not update it?). After a harddrive-wide search, I found sigc-2.0.dll in <code>C:\Program Files\VMware\VMware Workstation</code>. Good news is the installer has all of the installation files out in the open, so no need to dump cabs or hack the msi. I replaced copy in the Program Files directory with the one from the installer's directory and...<br />
<img src="http://red-stars.net/pictures/vmwarefix/08-working.png" /><br />
Success!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.red-stars.net/technology/software/using-process-monitor-and-other-tools-to-fix-a-broken-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated Local Backup of a Remote MySQL Database</title>
		<link>http://blog.red-stars.net/technology/software/automated-local-backup-of-a-remote-mysql-database/</link>
		<comments>http://blog.red-stars.net/technology/software/automated-local-backup-of-a-remote-mysql-database/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:15:39 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://red-stars.net/wordpress/?p=33</guid>
		<description><![CDATA[Scared your $10.00/year web host is going to blow up or disappear some evening? Me too! So I wrote this script.]]></description>
			<content:encoded><![CDATA[<p>I always like to take backing up into my own hands, and a database is potentially the most important thing on your server next to only the code driving it all, which in nature typically has a local copy anyways.</p>
<p><span id="more-33"></span><div class='toc wptoc'>
<h2>Contents</h2>
<ol class='toc-odd level-1'>
	<li>
		<a href="#Step_1:_mysqldump_and_the_remote_script">Step 1: mysqldump and the remote script</a>
	</li>
	<li>
		<a href="#Step_2:_wget_rar_and_the_local_script">Step 2: wget, rar and the local script</a>
	</li>
	<li>
		<a href="#Step_3:_Scheduling">Step 3: Scheduling</a>
	</li>
</ol>
</ol>
</ol>
</div>
<div class='wptoc-end'>&nbsp;</div></p>
<p>The local machine is a Windows Vista workstation and the remote is a webserver running LAMP.</p>
<p>The security of the locally backup database file is only as secure as the machine it-self. If you're not sure what this means, do <em>not</em> backup sensitive data using this method.</p>
<span id="Step_1:_mysqldump_and_the_remote_script"><h3>Step 1: mysqldump and the remote script</h3></span>
<p><code>mysqldump</code> is a program which can dump the contents of a MySQL database. It should be used with a MySQL user which has read access to all of the databases on your server that you wish to backup.</p>
<p><code>mysqldump</code> will be executed by PHP on the remote server and the output will be passed back over standard http.</p>
<pre class="brush:php">
</pre>
<p>Update the variables in the above script and save as <code>index.php</code>. Upload this file to it's own directory on your server, for example <code>/www/sqlbackup/</code>.</p>
<p><code>/www/sqlbackup/</code> should be configured as a password protected directory to prevent access by anyone to it.</p>
<span id="Step_2:_wget_rar_and_the_local_script"><h3>Step 2: wget, rar and the local script</h3></span>
<p><a href="http://users.ugent.be/~bpuype/wget/" target="_blank">Download wget</a> into your <code>%windir</code>. This is a command line utility that can be used to download remote files and pages from http and ftp servers.</p>
<p>Optionally, <a href="http://www.rarlabs.com/" target="_blank">install WinRAR</a> to add compression.</p>
<pre class="brush:text">wget --http-user=... --http-password=... --output-document=C:\Users\Joe\Documents\Scripts\sqlbackup\backup.txt http://www.yourserver.com/sqlbackup/
"C:\program files\winrar\rar.exe" u -dw -y -p... backup.rar backup.txt</pre>
<p>The first line uses <code>wget</code> to download the output from our remote script to <code>backup.txt</code>. The user, password, remote, and local locations all need to be changed to suite your configuration. This should be saved into <code>script.bat</code> in it's own directory on your local workstation, example <code>C:\Users\Joe\Documents\Scripts\sqlbackup\</code>.</p>
<p>The second line compresses the downloaded file into <code>backup.rar</code> and sets the password of the rar to whatever follows the -p argument. Note that the rar password ads very minimal security due to the script, which contains the password, being in the same directory. This line is optional and can be omitted.</p>
<p>Run <code>backup.bat</code> to make sure that everything is working fine.</p>
<span id="Step_3:_Scheduling"><h3>Step 3: Scheduling</h3></span>
<p>In a command window, enter <code>at 13:00 /EVERY:M,T,W,Th,F,S,Su C:\Users\Joe\Documents\Scripts\sqlbackup\backup.bat</code></p>
<p>This will cause the above local script to execute everyday at 1:00PM everyday of the week.</p>
<p>There's nothing else to it! Keep in mind, once again, that this will make any of the dumped MySQL contents as insecure as your computer is!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.red-stars.net/technology/software/automated-local-backup-of-a-remote-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
