<?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>MachineGrid &#187; flash</title>
	<atom:link href="http://www.machinegrid.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.machinegrid.com</link>
	<description>robots at work</description>
	<lastBuildDate>Thu, 14 Apr 2011 15:42:50 +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>Hacking the Hannah Montana Photocube &#8211; Almost!</title>
		<link>http://www.machinegrid.com/2009/02/hacking-the-hannah-montana-photocube/</link>
		<comments>http://www.machinegrid.com/2009/02/hacking-the-hannah-montana-photocube/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 14:11:52 +0000</pubDate>
		<dc:creator>bluehash</dc:creator>
				<category><![CDATA[Hackable Toys]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[A29L800]]></category>
		<category><![CDATA[digital frames]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[KeyChain Displays]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[ST2205U]]></category>

		<guid isPermaLink="false">http://www.machinegrid.com/?p=628</guid>
		<description><![CDATA[Things with LCDs are very interesting. I found a Hannah Montana Digital Photocube on sale and decided to look what&#8217;s inside it. Good for a day of hacking :) First a description: Storage capacity: 8 M bit (Up to 70 photos) Resolution: 128&#215;128 dpi Display: 1.5-inch color LCD Supported File Format: JPG (JPEG),BMP, GIF, PNG, [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><!-- New window script from http://blog.ginchen.de/en/2008/12/20/links-xhtml-konform-in-neuem-fenster-oeffnen/ --><script src="http://www.machinegrid.com/machinepress/jscripts/externalLinks.js" type="text/javascript"></script><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hannah_montana_photocube.jpg"><img class="size-medium wp-image-629 alignright" title="hannah_montana_photocube" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hannah_montana_photocube-300x225.jpg" alt="hannah_montana_photocube" width="150" height="112" /></a>Things with LCDs are very interesting. I found a Hannah Montana Digital Photocube on sale and decided to look what&#8217;s inside it. Good for a day of hacking :)</p>
<p>First a description:</p>
<ul>
<li>Storage capacity: 8 M bit (Up to 70 photos) Resolution: 128&#215;128 dpi</li>
<li>Display: 1.5-inch color LCD</li>
<li>Supported File Format: JPG (JPEG),BMP, GIF, PNG, &amp; TIF</li>
<li>Power: 2 xAAA batteries (not included)</li>
<li>USB Ports: Mini-USB 1.1 interface</li>
</ul>
<p>Searching around the net produced a lot of work done by <a rel="external" href="http://spritesmods.com/?art=picframe">Sprite</a>. He and a couple of guys maintain a <a rel="external" href="http://picframe.spritesserver.nl/wiki/index.php/Main_Page">wiki</a> containg information about hacked lcd keychains. Most of the keychains that have been hacked contain a ST2205U Microcontroller. With this information I proceeded ripping apart my photocube. This was what was inside:</p>
<p><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_a29l800_flash_chip.jpg"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_a29l800_flash_chip-150x150.jpg" alt="hack_photo_cube_a29l800_flash_chip" title="hack_photo_cube_a29l800_flash_chip" width="150" height="150" class="alignnone size-thumbnail wp-image-661" /></a><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_pcb_2.jpg"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_pcb_2-150x150.jpg" alt="hack_photo_cube_pcb_2" title="hack_photo_cube_pcb_2" width="150" height="150" class="alignnone size-thumbnail wp-image-662" /></a><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_pcb.jpg"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_pcb-150x150.jpg" alt="hack_photo_cube_pcb" title="hack_photo_cube_pcb" width="150" height="150" class="alignnone size-thumbnail wp-image-660" /></a><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_frame_lcd.jpg"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_frame_lcd-150x150.jpg" alt="hack_photo_frame_lcd" title="hack_photo_frame_lcd" width="150" height="150" class="alignnone size-thumbnail wp-image-663" /></a><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_open_photo_cube.jpg"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_open_photo_cube-150x150.jpg" alt="hack_open_photo_cube" title="hack_open_photo_cube" width="150" height="150" class="alignnone size-thumbnail wp-image-653" /></a></p>
<p>A 1Mb A29L800( <a rel="external" href="http://www.amictechnology.com/pdf/A29L800.pdf">datasheet</a> ) flash chip and a micrcontroller hidden behind a big black blob along with the LCD, buttons, USB port and an on-off switch. With some reading on Sprite&#8217;s blog and modifyng his script a little, I was able to verify that the microcontroller was indeed a ST2205U. If you browse through main.c, a function is_photoframe checks if the controller is a ST2205U. So I inserted a   printf(&#8220;Response : %s\n&#8221;,buff) to verify if the chip gave back the correct string, which it did.</p>
<p><code>/*<br />
Checks if the device is a photo frame by reading the first 512 bytes and<br />
comparing against the known string that's there<br />
*/<br />
int is_photoframe(int f) {<br />
    int y,res;<br />
    char id[]="SITRONIX CORP.";<br />
    char *buff;<br />
    buff=malloc_aligned(0x200);<br />
    lseek(f,0x0,SEEK_SET);<br />
    y=read(f,buff,0x200);<br />
    buff[15]=0;<br />
    printf("Response : %s\n",buff);<br />
//    fprintf(stderr,"ID=%s\n",buff);<br />
    res=strcmp(buff,id)==0?1:0;<br />
    free_aligned(buff,0x200);<br />
    return res;<br />
}</code></p>
<p>I&#8217;ll try documenting my steps going further. It&#8217;s in Linux( RedHat ) since I work on it, and you could do the same using a linux live cd.</p>
<p>1. Unpack Sprite&#8217;s hack from <a rel="external" href="http://spritesmods.com/?art=picframe&amp;page=3">here</a>. You will need to install libgd if you don&#8217;t have it. As root install gd-devel. Please read the README file in the unpacked directory. It&#8217;s written for a reason.</p>
<p>   <code>yum install gd-devel </code></p>
<p>2. Then as a user type &#8220;make&#8221; in the unpacked directory. This will compile the hack to give you the &#8220;phack&#8221; binary.<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/make_hackfw.png"><img class="alignnone size-medium wp-image-631" title="make_hackfw" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/make_hackfw-300x86.png" alt="make_hackfw" width="300" height="86" /></a></p>
<p>3. Now connect the photocube and turn it on. You will see &#8220;USB Connect&#8221; displayed on the screen. Open a terminal on your linux machine and type</p>
<p>   <code>dmesg | tail</code></p>
<p>This will give you any hardware information that occurred last. You will see the following:<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/dmesg_hannah_montana_photocube.png"><img class="alignnone size-medium wp-image-632" title="dmesg_hannah_montana_photocube" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/dmesg_hannah_montana_photocube-300x150.png" alt="dmesg_hannah_montana_photocube" width="300" height="150" /></a></p>
<p>If you see something like:</p>
<p>  <code>4096 512-byte hdwr sectors (2 MB)</code></p>
<p>then your close. Also note where your cube is mounted so you can access it. If you look at the pic above it says &#8220;Attached scsi removable disk sdg&#8221;, which means that the cube is mounted at /dev/sdg</p>
<p>4. Now to hack the firmware.<br />
<strong>WARNING : Anything you do after this is at your own risk.</strong></p>
<p>Type the following as root in your terminal, using the mount point which you got from step 3.</p>
<p>   <code>./hackfw.sh /dev/sdg</code></p>
<p>You will see the following as checks are made and eventually an error:<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_error.png"><img class="alignnone size-medium wp-image-633" title="hack_st2205tool_error" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_error-300x150.png" alt="hack_st2205tool_error" width="300" height="150" /></a></p>
<p>Sprite&#8217;s script makes a backup of the firmware and an image of the memory. It however says that &#8220;The hack won&#8217;t work for my Firmware.&#8221; When I looked into the script, it looks if my cube&#8217;s firmware is same as Sprite&#8217;s when he hacked his keychain, which is an entirely different product.</p>
<p>   <code>dd if=fwimage.bin bs=256 skip=58 count=2 of=fwbit 2&gt;/dev/null<br />
   #check for all FFs Md5sum may not be _the_ tool for that, but it works OK.<br />
   if ! md5sum fwbit | grep -q de03fe65a6765caa8c91343acc62cffc; then<br />
   echo "No room at the location we want to place the hack!"<br />
   echo "This specific hack won't work for this particular firmware, I'm sorry."<br />
   exit 1;<br />
   fi</code></p>
<p>I did not have anything to loose, so I commented it out to bypass the check. Just put a &#8220;#&#8221; to comment out code.</p>
<p>5. I ran the script again (run as root), this time it went through the whole flashing process, till I rebooted</p>
<p><a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_success.png"><img class="alignnone size-medium wp-image-634" title="hack_st2205tool_success" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_success-300x237.png" alt="hack_st2205tool_success" width="300" height="237" /></a></p>
<p>6. The script ends with &#8220;No Photoframe found here&#8221;. Turn off, Disconnect, Turn On and the Connect  the photoframe. Get the mount point as in step 3. Type the following as root.<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_hi_lcd.png"><img class="alignnone size-medium wp-image-635" title="hack_st2205tool_hi_lcd" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_st2205tool_hi_lcd-300x72.png" alt="hack_st2205tool_hi_lcd" width="300" height="72" /></a></p>
<p>You should see the following on the LCD<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_lcd_debug.jpg"><img class="alignnone size-medium wp-image-640" title="hack_photo_cube_lcd_debug" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_lcd_debug-296x300.jpg" alt="hack_photo_cube_lcd_debug" width="296" height="300" /></a></p>
<p>The script allows a maximum of 10 characters. Another example<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_lcd_debug_2.jpg"><img class="alignnone size-medium wp-image-641" title="hack_photo_cube_lcd_debug_2" src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/02/hack_photo_cube_lcd_debug_2-300x256.jpg" alt="hack_photo_cube_lcd_debug_2" width="300" height="256" /></a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-1367209070807564";
/* 336x280, created 2/14/09 */
google_ad_slot = "6299204715";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>
I was however unsuccessful in getting PNGs or JPEGs uploaded to the device. That&#8217;s when I bricked my cube trying different memory addresses. It doesn&#8217;t even turn on now. I&#8217;ll update when I get my hands on another one. If you have any questions or comments, you could  enter them below. Thanks for reading and don&#8217;t forget to <a href="http://feeds2.feedburner.com/machinegrid">Subscribe </a>for more followups and hacks.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.machinegrid.com/2009/02/hacking-the-hannah-montana-photocube/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

