<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Matt Merry &#187; 2008 &#187; June &#187; 08</title>
	<atom:link href="http://www.mattmerry.com/blog/2008/06/08/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mattmerry.com/blog</link>
	<description>MattMerry.com</description>
	<pubDate>Thu, 19 Feb 2009 01:19:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>matt@mattmerry.com ()</managingEditor>
		<webMaster>matt@mattmerry.com()</webMaster>
		<category></category>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>MattMerry.com</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>matt@mattmerry.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.mattmerry.com/blog/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.mattmerry.com/blog/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>Matt Merry</title>
			<link>http://www.mattmerry.com/blog</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Perl Parser</title>
		<link>http://www.mattmerry.com/blog/2008/06/08/perl-parser</link>
		<comments>http://www.mattmerry.com/blog/2008/06/08/perl-parser#comments</comments>
		<pubDate>Sun, 08 Jun 2008 21:42:57 +0000</pubDate>
		<dc:creator>Matt Merry</dc:creator>
		
		<category><![CDATA[SD14 Firmware Hacking]]></category>

		<guid isPermaLink="false">http://www.mattmerry.com/blog/2008/06/08/perl-parser</guid>
		<description><![CDATA[I love perl. Its great for parsing files, even binary files. The ParseBin.zip zip file contains a perl script I wrote (releasing under GPL 2.0).
The script file basically attempts to parse the binary file, looking for sections. It will keep track of section location and size, print out information on the section, print individual section [...]]]></description>
			<content:encoded><![CDATA[<p>I love perl. Its great for parsing files, even binary files. The <a href="http://www.mattmerry.com/blog/wp-content/uploads/2008/06/parsebin.zip" title="ParseBin.zip">ParseBin.zip</a> zip file contains a perl script I wrote (releasing under GPL 2.0).</p>
<p>The script file basically attempts to parse the binary file, looking for sections. It will keep track of section location and size, print out information on the section, print individual section types and even dump or ignore sections at a given location. The command line arguments to the script are:</p>
<blockquote>
<pre><font color="#000080">./parsebin.pl [-h -s [-i Location] [-p Section] [-d Location]] BINFILE  SECFILE
        -s: Print Strings as well
        -i [Location]: Ignore (dont print) the section at [Location]. Can be used multiple times.
        -p [Section]: print a section. ALL for all. Can be used multiple times
        -d [Location]: Dump the section at location to a new file. </font></pre>
</blockquote>
<p>Its not pretty but it works for now. This will evolve to allow individual sections to be diffed between different firmware versions. For now, its a tool to investigate the firmware sections. The sections.txt file I use contains CMbP, CMbT, CMbM and CMbH, each on their own line.</p>
<p>The <a href="http://www.mattmerry.com/blog/wp-content/uploads/2008/06/section-info-101-102.zip" title="Section Info">Section Info</a> zip file contains the dumps of the script when ran against the s14v101.bin and s14v102.bin files. The sections look pretty smiliar. There are a couple large sections that I&#8217;ll want to look at closer. The -d option to the script will help here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattmerry.com/blog/2008/06/08/perl-parser/feed</wfw:commentRss>
		</item>
		<item>
		<title>Strings in Version 1.01</title>
		<link>http://www.mattmerry.com/blog/2008/06/08/strings-in-version-101</link>
		<comments>http://www.mattmerry.com/blog/2008/06/08/strings-in-version-101#comments</comments>
		<pubDate>Sun, 08 Jun 2008 20:47:14 +0000</pubDate>
		<dc:creator>Matt Merry</dc:creator>
		
		<category><![CDATA[SD14 Firmware Hacking]]></category>

		<guid isPermaLink="false">http://www.mattmerry.com/blog/2008/06/08/strings-in-version-101</guid>
		<description><![CDATA[ Lets take a look at the strings in the ver 1.01 SD14 firmware file.
We can dump the strings using the strings program:

$ strings s14v101.bin &#62; s14v101.strings.txt

This dumps all the strings in the s14v101.bin file to the s14v101.strings.txt file. Open that text file. You see right near the top:

 Converted using Foveon CamXML2Bin 1.2.15.2924 Release (Mar 20 [...]]]></description>
			<content:encoded><![CDATA[<p> Lets take a look at the strings in the ver 1.01 SD14 firmware file.</p>
<p>We can dump the strings using the strings program:</p>
<blockquote>
<h5>$ strings s14v101.bin &gt; s14v101.strings.txt</h5>
</blockquote>
<p>This dumps all the strings in the s14v101.bin file to the s14v101.strings.txt file. Open that text file. You see right near the top:</p>
<blockquote>
<pre><font color="#000080"> Converted using Foveon CamXML2Bin 1.2.15.2924 Release (Mar 20 2007 16:31:42)</font></pre>
</blockquote>
<p>This is located at offset 0&#215;00016C in the original file. Looks like they use some tool to take an XML file and convert it to a bin file. Googling this name does no good, it looks to be an internal proprietary tool.</p>
<p>Directly below that we see the text &#8220;CMbH&#8221;. In two more lines, we see &#8220;CMbT&#8221;, then &#8220;CMbM.&#8221; You can grep the strings file for all occurrences of CMb*</p>
<blockquote>
<h5>$ grep &#8220;^CMb.&#8221; s14v101.strings.txt &gt; sections.txt</h5>
</blockquote>
<p>Taking a look at this, we can see that there are four unique CMb* sections:</p>
<ul>
<li>CMbT</li>
<li>CMbH</li>
<li>CMbM</li>
<li>CMbP</li>
</ul>
<p>I&#8217;m thinking that these are the section identifiers we are looking for. the next step would be to break the binary file up based on these sections and to collect some basic data on these sections. Spend some time looking into the strings, these sections may not be the only ones.</p>
<p>We can grep for all the 4 character stings that are on one line in the strings  file. Lets try this:</p>
<blockquote>
<h5>$ grep &#8220;^&#8230;.$&#8221; s14v101.strings.txt &gt; sections.txt</h5>
</blockquote>
<p>There are lots of mishits here. a quick glance makes me want to look into the following more closely:</p>
<ul>
<li>SETN</li>
<li>SETH</li>
<li>FBIN</li>
<li>BINS</li>
<li>SIFC</li>
<li>SIFD</li>
<li>MCMN</li>
<li>MCBT</li>
<li>EXEC</li>
</ul>
<p>Also, of interest from the strings file:</p>
<ul>
<li>SECi</li>
<li>SECp</li>
<li>SECc</li>
<li>FOVb</li>
</ul>
<p>Hey, those are the sections in the X3F files <img src='http://www.mattmerry.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> And:</p>
<blockquote>
<pre><font color="#000080">Update MCDSP bootstrap code from CF.
Update BFDSP bootstrap code from CF.
Reprogram FPGA code from CF.
Update CAMCPU firmware from CF. </font></pre>
</blockquote>
<p>Looks like code for all the processors can be updated via the CF card! Awesome!</p>
<blockquote>
<pre> <font color="#000080">Starting debug console.  (type HELP for help)</font></pre>
</blockquote>
<p>I want access to this debug console. The software fror it appears to be included in te firmware. There is lots you can do with this, just take a look at all he descriptions for the possible commands!</p>
<p>The next step will be to break down the firmware into sections based on the CMb* tags. I&#8217;ll also take a closer look at the other sections.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattmerry.com/blog/2008/06/08/strings-in-version-101/feed</wfw:commentRss>
		</item>
		<item>
		<title>Plan of Action</title>
		<link>http://www.mattmerry.com/blog/2008/06/08/plan-of-action</link>
		<comments>http://www.mattmerry.com/blog/2008/06/08/plan-of-action#comments</comments>
		<pubDate>Sun, 08 Jun 2008 19:39:14 +0000</pubDate>
		<dc:creator>Matt Merry</dc:creator>
		
		<category><![CDATA[SD14 Firmware Hacking]]></category>

		<guid isPermaLink="false">http://www.mattmerry.com/blog/2008/06/08/plan-of-action</guid>
		<description><![CDATA[After spending an evening poking around the ver 1.01 firmware, I came up with a plan of action. It appears that the firmware has areas of strings that is human readable, areas of code that is not, areas of padding (i.e. repeated patterns that done seem mean much at first glance). We need a systematical [...]]]></description>
			<content:encoded><![CDATA[<p>After spending an evening poking around the ver 1.01 firmware, I came up with a plan of action. It appears that the firmware has areas of strings that is human readable, areas of code that is not, areas of padding (i.e. repeated patterns that done seem mean much at first glance). We need a systematical way of analyzing the firmware files.</p>
<p>I once put together my own decoder for the X3F files and I recall that the file was broken down into sections. The sections were all labeled (i.e. FOVb, SECd, ect). Perhaps this file is the same. This seems to be in line with first observations that there are string sections and data sections. This also somewhat aligns with some <a href="http://www.itee.uq.edu.au/~cristina/students/david/honoursThesis96/bff.htm" title="4 BFFs">other</a> <a href="http://en.wikipedia.org/wiki/Executable_and_Linkable_Format" title="ELF file format">executable</a> <a href="http://en.wikipedia.org/wiki/Portable_Executable" title="DOS PE">file</a> <a href="http://www.delorie.com/djgpp/doc/exe/" title="EXE Format">formats</a>.</p>
<p>My plan is to:</p>
<ol>
<li>Dump the strings for a firmware version and look for hints.</li>
<li>Look for section identifiers in the firmware.</li>
<li>Attempt to break the firmware down into sections</li>
<li>Compare various firmware versions to each other based on sections.</li>
</ol>
<p>The approach will use the first few versions of firmware for investigation/comparison. I&#8217;ll leave a couple versions, version 1.06 and the two 1.07s, uninvestigated as an unknown baseline to test my final product.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattmerry.com/blog/2008/06/08/plan-of-action/feed</wfw:commentRss>
		</item>
		<item>
		<title>SD14 Hardware</title>
		<link>http://www.mattmerry.com/blog/2008/06/08/sd14-hardware</link>
		<comments>http://www.mattmerry.com/blog/2008/06/08/sd14-hardware#comments</comments>
		<pubDate>Sun, 08 Jun 2008 19:00:50 +0000</pubDate>
		<dc:creator>Matt Merry</dc:creator>
		
		<category><![CDATA[SD14 Firmware Hacking]]></category>

		<guid isPermaLink="false">http://www.mattmerry.com/blog/2008/06/08/sd14-hardware</guid>
		<description><![CDATA[ So, as I pointed out in the last post, you can find great things just by poking around the firmware with the hex editor looks at strings. I&#8217;m looking to find out what hardware the SD14 has in it. I&#8217;ve heard reports on DPreview and elsewhere that the SD14 has a Blackfin DSP. Lets see [...]]]></description>
			<content:encoded><![CDATA[<p> So, as I pointed out in the last post, you can find great things just by poking around the firmware with the hex editor looks at strings. I&#8217;m looking to find out what hardware the SD14 has in it. I&#8217;ve heard reports on DPreview and elsewhere that the SD14 has a Blackfin DSP. Lets see if I can corroborate that.</p>
<p>At Offset 0&#215;093993 we find:</p>
<pre><font color="#000080">THe BF561 manual notes that a larger lock count may be necessary when changing the voltage significantly</font></pre>
<p>Complete with typo and all. I thought those Sigma guys were Japanese, what are they doing typing their notes in English? Perhaps its easier. Perhaps there is another reason. That would be a reference to the <a href="http://www.analog.com/en/prod/0,2877,ADSP%252DBF561,00.html" title="Blackfin BF561 DSP">Blackfin  BF 561 DSP.</a> The DSP is a dual core chip with a &#8220;High data throughput tailored for the needs of imaging and consumer multimedia applications.&#8221; Looks like we found our chip.</p>
<p>The Blackfin site has links for all the technical documentation and even development evironments for the BF561. Get reading, this is the brains behind the camera. But is it the only chip?</p>
<p>Not quite. Looking near the end of the file (offset 0&#215;0DFAC8), we see the following:</p>
<pre><font><font color="#000080">S</font></font><font color="#000080">DK for DSC: Copyright (c) 2003 MegaChips Corporation</font></pre>
<p>Further down, we that perhaps this is called the DSC 131. You can also see references to an FPGA throughout the file. Neither of these chips are FPGAs, so there is at least another chip in there we don&#8217;t have an ID for.</p>
<p>Lets go Googling. <a href="http://www.planetanalog.com/features/multimedia/showArticle.jhtml?articleID=202400370" title="Planet Analog Under the hood of the SD14">This page</a> from Planet Analog is interesting. It tells us that the SD14 has inside:</p>
<ul>
<li><a href="http://www.foveon.com/article.php?a=222" title="Foveon X3 14.1">Foveon X3 14.1 MPixel</a> sensor<a href="http://www.foveon.com/article.php?a=222" title="Foveon X3 14.1"> </a></li>
<li><a href="http://www.analog.com/en/epProd/0,,ADSP-BF561,00.html" title="Blackfin BF561 DSP">ASDP BF651 </a>Blackfin DSP<a href="http://www.analog.com/en/epProd/0,,ADSP-BF561,00.html" title="Blackfin BF561 DSP"><br />
</a></li>
<li><a href="http://www.xilinx.com/support/documentation/spartan-3.htm" title="Spartan-3 documentation">Xilinx Spartan-3 XC3S200</a> FPGA</li>
<li>Analog Devices <a href="http://www.analog.com/en/prod/0%2C2877%2CAD9228%2C00.html" title="AD 9228 A2D converter">AD9228</a> A2D converter</li>
<li>4 Samsung <a href="http://www.samsung.com/global/business/semiconductor/products/dram/downloads/sdr_product_guide_feb04.pdf" title="Product Guide PDF">K4S511632D-UC75</a> (512Mb SDRAMs)</li>
<li>MegaChips <a href="http://www.lsi.megachips.co.jp/english/assp.html#camera" title="DSC-3H">DSC-3H</a></li>
<li>2 Samsung <a href="http://www.samsung.com/global/business/semiconductor/products/dram/downloads/sdr_product_guide_feb04.pdf" title="Product Guide PDF">K4S561632H-UC75</a> (256 Mb SDRAM)</li>
<li>Toshiba <a href="javascript:location.href='http://media.digikey.com/pdf/Data%20Sheets/Toshiba%20PDFs/TC58FVM6(T,B)5B(TG,XG)65.pdf'" title="Datasheet PDF">TC58FVM6B5BTG65</a> (64 Mbit NOR flash)</li>
<li>Casio LCD</li>
</ul>
<p>A couple observations from this:</p>
<ul>
<li>The FPGA must be loaded with some sort of executable. Can they update this?</li>
<li>This camera has 2.5Gb of RAM!</li>
<li>What is run on the  MegaChips chip?</li>
<li>Whats run on the  Blackfin?</li>
<li>How is it all coordinated? I&#8217;d suspect that there is some form of OS on this camera.</li>
<li>How is all of this &#8220;booted?&#8221;</li>
</ul>
<p>At least the observations from the firmware are confirmed <img src='http://www.mattmerry.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattmerry.com/blog/2008/06/08/sd14-hardware/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
