<?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>Computer Solutions Blog &#187; firmware</title>
	<atom:link href="http://www.computersolutions.cn/blog/tag/firmware/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.computersolutions.cn/blog</link>
	<description>Whats happening at Computer Solutions</description>
	<lastBuildDate>Fri, 13 Jan 2012 02:32:34 +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>Dell Mini 3i (possibly also Dell Aero too) Firmware Exploration</title>
		<link>http://www.computersolutions.cn/blog/2010/08/dell-mini-3i-firmware-exploration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dell-mini-3i-firmware-exploration</link>
		<comments>http://www.computersolutions.cn/blog/2010/08/dell-mini-3i-firmware-exploration/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 18:20:34 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Firmware]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[borqs]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[marvell]]></category>
		<category><![CDATA[mini 3i]]></category>
		<category><![CDATA[mini3i]]></category>
		<category><![CDATA[ophone]]></category>
		<category><![CDATA[pxa935]]></category>
		<category><![CDATA[tavor]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=593</guid>
		<description><![CDATA[As I&#8217;ve been reasonably successful in the past at figuring out file systems from flat files, I thought I&#8217;d have a go at the Dell Mini 3i 1.5 Firmware that surfaced at damipan (http://www.namipan.com/d/DELL_MINI3I_OMS1.5.rar/a5ba3b06ab0bfc9baeb2f09b44f54aa40bac3457ee8ebc04) The rar file unzips to a MFF file. This I&#8217;m probably guessing is probably named after Marvell File Format or Marvell [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been reasonably successful in the past at figuring out file systems from flat files, I thought I&#8217;d have a go at the Dell Mini 3i 1.5 Firmware that surfaced at damipan (<a href="http://www.namipan.com/d/DELL_MINI3I_OMS1.5.rar/a5ba3b06ab0bfc9baeb2f09b44f54aa40bac3457ee8ebc04">http://www.namipan.com/d/DELL_MINI3I_OMS1.5.rar/a5ba3b06ab0bfc9baeb2f09b44f54aa40bac3457ee8ebc04</a>)</p>
<p>The rar file unzips to a MFF file.</p>
<p>This I&#8217;m probably guessing is probably named after Marvell File Format or Marvell Flasher File.<br />
Here&#8217;s my initial work on the file system of MFF format, based on  DELL_Mini3i_OMS1.5.mff</p>
<p><strong>Initial 80 bytes [0x0 - 0x080] (MFF HEADER)</strong></p>
<p>0&#215;00 &#8211;  0&#215;03 :  3 Bytes Header MFF<br />
0&#215;03 &#8211; 0&#215;07 : Still to figure out, probably file length  or crc.<br />
Have to grab another firmware file to check though..</p>
<p>0&#215;08 : Number of files?  9 listed, so quite probably&#8230;<br />
Rest of header padded out with zero&#8217;s to end of 80 bytes.</p>
<p><strong>[0x80 - 0x180]  File Allocation Table</strong><br />
0&#215;80 &#8211; our first file.  Looks like 0&#215;100 / 256 bytes per file listed, padded with 0&#215;0&#8242;s</p>
<p>File listing looks like this:</p>
<p>File header (for each file)<br />
8 bytes, then filename, padded with 0&#8242;s to fill 256 bytes length</p>
<p>First 4 bytes &#8211; offset in MFF of start of file.<br />
Second 4 bytes &#8211; length of file.</p>
<p>Remaining files repeat from next 256 byte intervals.</p>
<p>eg<br />
0&#215;180 &#8211; 0&#215;280<br />
0&#215;280 &#8211; 0&#215;380<br />
&#8230;</p>
<p><strong>[0x80 + 9 files x 0x100 bytes = 0x980]  Start of Data.</strong></p>
<p>How did I work this out?</p>
<p>HEADER                            | Filename (not in hex below as easier to read)<br />
80 09 00 00 34 BB 00 00  | Tavor Flasher_Samsung_ONENAND_h.bin</p>
<p>0&#215;0980 is the start of our first file data, so the first 2 bytes are definitely File Start.<br />
0xBB34 looks quite possibly like File Length.</p>
<p>We can check this easily with one of the plain text files.</p>
<p>Flash_Protection_table.ini is prefixed with 63 EA AD 09   4B 00 00 00</p>
<p>So it should start at  0&#215;09 AD &#8211; hmm, readable text starts at offset 9AD D564.<br />
Not quite right.  Start offset looks close though.</p>
<p>Lets look at another one.</p>
<p>Tavor_saar_onenand.ini &#8211; prefix says<br />
64 d5 ad 09 6f 01 00 00</p>
<p>Ah, 0&#215;9 AD D5 64 is actually our Tavor_saar_onenand.ini content.  Cool, a match.  So, the first 4 bytes are definitely our location pointer.</p>
<p>Lets look at the Flash protection table again Flash_Protection_table.ini</p>
<p>63 EA AD 09   |  4B 00 00 00<br />
Should start at 09 AD EA 63, and go for 4B length.  Bingo, it does <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Our file contents for that area are:</p>
<p>[PROTECTED_REGION_0]<br />
Block_Offset=0&#215;100000<br />
Length=0&#215;20000<br />
Mode=SKIP_BLOCKS</p>
<p>So, now we can start to split the files apart into their associated parts.</p>
<p>factory_BENZ2GWIFI.fbf is probably going to be the most interesting, as its the largest.</p>
<p>That starts at 0xC564, length of 0x09AD1000 and starts with &#8220;Marvell_FBF&#8221;<br />
Basic math says that 0x9ADD564 (0x09AD1000 + 0xC564) should be our end of file.<br />
Well, it is, as we know flash protection table.ini starts at 9add564.</p>
<p>So, should be fairly easy with that info to write an unpacker tool to rip out the first interior files from the MFF file format.<br />
Some of the files inside are also &#8220;packed&#8221;, but those appear to be fairly easy to rip apart also <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m guessing with a bit more work I&#8217;ll be able to replace parts of the firmware with different versions quite soonish.</p>
<p>The file I&#8217;m using off of namipan has the following files inside:</p>
<blockquote><p>TavorFlasher_SAMSUNG_ONENAND_h.bin<br />
TavorFlasher_SAMSUNG_ONENAND_TIM.bin<br />
factory_BENZ2GWIFI.fbf<br />
Tavor_SAAR_OneNAND.ini<br />
factory_BENZ2GWIFI.mff.mlt<br />
magic_fbf.ini<br />
magic_fbf_inner.ini<br />
NTIM_fbw.ini<br />
Flash_Protection_Table.ini</p></blockquote>
<p>I&#8217;m guessing that our fbf file will probably be able to be split into parts as per our ntim_fbw.ini data.<br />
FBF = Flash Binary Format?</p>
<p>some interesting files listed<br />
ntim.bin &#8211; non trusted image module?<br />
blob_full.bin &#8211; from the borq&#8217;s blob gz?<br />
Tavor_M05_Poleg_AI_B0_Flash.bin &#8211; tavor = our product chip, as we&#8217;re running on a Marvel PXA935 (aka Tavor-P65)</p>
<p>Interesting thing of note &#8211; our OEM UniqueID: 0xF00F00 in Unicode is what glyph?<br />
Hint &#8211; its not an orange, or a pear <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>NTIM_fbw.ini</strong></p>
<blockquote><p>Version: 0&#215;030102<br />
Trusted: 0</p>
<p>Issue Date: 0&#215;08142006<br />
OEM UniqueID: 0xf00f00<br />
Boot Flash Signature: 0x4e414e02<br />
Number of Images: 10<br />
Size of Reserved in bytes: 0&#215;40</p>
<p>Image ID: 0x54494D48<br />
Next Image ID: 0x4F424D49<br />
Flash Entry Address: 0&#215;0<br />
Load Address: 0x5c008000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: NTIM.bin</p>
<p>Image ID: 0x4F424D49<br />
Next Image ID: 0x4F534C4F<br />
Flash Entry Address: 0&#215;20000<br />
Load Address: 0x5c013000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: obm_full.bin</p>
<p>Image ID: 0x4F534C4F<br />
Next Image ID: 0x5349474E<br />
Flash Entry Address: 0&#215;80000<br />
Load Address: 0&#215;83000000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: blob_full.bin</p>
<p>Image ID: 0x5349474E<br />
Next Image ID: 0x494D4549<br />
Flash Entry Address: 0&#215;00120000<br />
Load Address: 0&#215;84000000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: signature_full.bin</p>
<p>Image ID: 0x494D4549<br />
Next Image ID: 0x4152424C<br />
Flash Entry Address: 0&#215;00100000<br />
Load Address: 0xBFEE0000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: reliable_full.bin</p>
<p>Image ID: 0x4152424C<br />
Next Image ID: 0&#215;47524249<br />
Flash Entry Address: 0&#215;00140000<br />
Load Address: 0xBF600000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: arbel_full.bin</p>
<p>Image ID: 0&#215;47524249<br />
Next Image ID: 0x62746C67<br />
Flash Entry Address: 0&#215;00840000<br />
Load Address: 0xBFF00000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: tavor_full.bin</p>
<p>Image ID: 0x62746C67<br />
Next Image ID: 0x70636C67<br />
Flash Entry Address: 0x00A00000<br />
Load Address: 0xBF300000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: bootlogo_full.bin</p>
<p>Image ID: 0x70636C67<br />
Next Image ID: 0x464F5441<br />
Flash Entry Address: 0x00A20000<br />
Load Address: 0x8F300000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: prechangelogo_full.bin</p>
<p>Image ID: 0x464F5441<br />
Next Image ID: 0xFFFFFFFF<br />
Flash Entry Address: 0x0EA40000<br />
Load Address: 0&#215;80100000<br />
Image Size To CRC in bytes: 0&#215;0<br />
Image Filename: fota_full.bin</p>
<p>Reserved Data:<br />
0x4F505448<br />
0&#215;00000002<br />
0&#215;55415254<br />
0&#215;00000010<br />
0&#215;00004646<br />
0&#215;00000001<br />
0x50524F49<br />
0&#215;00000020<br />
0&#215;00000002<br />
0&#215;00000000<br />
0&#215;00000000<br />
0&#215;00000000<br />
0&#215;00000001<br />
0&#215;00000000<br />
0x5465726D<br />
0&#215;00000008</p></blockquote>
<p><strong>Flash_Protection_Table.ini</strong></p>
<blockquote><p>[PROTECTED_REGION_0]<br />
Block_Offset=0&#215;100000<br />
Length=0&#215;20000<br />
Mode=SKIP_BLOCKS</p></blockquote>
<p><strong>magic_fbf_inner.ini</strong></p>
<blockquote><p>[INTEL_FLASH_DEVICE_INPUT_FILE]<br />
Number_of_Images=20</p>
<p>[IMAGE_HEADER_0]<br />
Start_Address=0xfa00000<br />
Image_Length=0&#215;80000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_1]<br />
Start_Address=0xdd40000<br />
Image_Length=0&#215;800000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_2]<br />
Start_Address=0xeb40000<br />
Image_Length=0x8c0000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_3]<br />
Filename=NTIM.bin<br />
Start_Address=0&#215;00000000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_4]<br />
Filename=Arbel_NVM_SAC_NOCOMMRTC.bin<br />
Start_Address=0&#215;00140000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_5]<br />
Filename=blob<br />
Start_Address=0&#215;00080000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_6]<br />
Start_Address=0x0bd40000<br />
Image_Length=0&#215;02000000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0<br />
[IMAGE_HEADER_7]<br />
Filename=opl.img.yaffs<br />
Start_Address=0x0bd40000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_8]<br />
Filename=ramdisk_len.img<br />
Start_Address=0x00c40000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_9]<br />
Filename=ramdisk-recovery_len.img<br />
Start_Address=0x00cc0000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_10]<br />
Start_Address=0x00d40000<br />
Image_Length=0&#215;08000000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0<br />
[IMAGE_HEADER_11]<br />
Filename=system.img.yaffs<br />
Start_Address=0x00d40000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_12]<br />
Filename=TAVOR_LINUX_NTOBM.bin<br />
Start_Address=0&#215;00020000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_13]<br />
Filename=Tavor_M05_Poleg_AI_B0_Flash.bin<br />
Start_Address=0&#215;00840000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_14]<br />
Start_Address=0x08d40000<br />
Image_Length=0&#215;03000000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0<br />
[IMAGE_HEADER_15]<br />
Filename=userdata.img.yaffs<br />
Start_Address=0x08d40000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_16]<br />
Filename=zImage<br />
Start_Address=0x00a40000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_17]<br />
Filename=prdcfg.bin<br />
Start_Address=0&#215;00940000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_18]<br />
Filename=precharge_logo.out<br />
Start_Address=0x00a20000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_19]<br />
Filename=logo_pic.gz.out<br />
Start_Address=0x00a00000<br />
EraseBlocks=1<br />
WriteImage=1<br />
VerifyWrite=0</p></blockquote>
<p>Lastly, hi to the people at http://www.allphone.com.cn  <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/08/dell-mini-3i-firmware-exploration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IP Cam Hacking &#8211; pt#4</title>
		<link>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ip-cam-hacking-pt4</link>
		<comments>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt4/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 19:57:14 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[bflt]]></category>
		<category><![CDATA[bneg]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[ipcam]]></category>
		<category><![CDATA[linux.bin]]></category>
		<category><![CDATA[pkzip]]></category>
		<category><![CDATA[uclinix]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=477</guid>
		<description><![CDATA[Spent a while checking out the different binaries available for the different OEM versions. Some interesting things I&#8217;ve found. If I take a look at a sample kernel &#8211; eg lr_cmos_11_14_1_46.bin ls -al lr_cmos_11_14_1_46.bin -rw-r--r-- 1 lawrence staff 1350539 Mar 15 13:47 lr_cmos_11_14_1_46.bin Our file size for the file i have is 1350539 bytes. A [...]]]></description>
			<content:encoded><![CDATA[<p>Spent a while checking out the different binaries available for the different OEM versions.<br />
Some interesting things I&#8217;ve found.</p>
<p>If I take a look at a sample kernel &#8211; eg<br />
lr_cmos_11_14_1_46.bin</p>
<p><code> ls -al lr_cmos_11_14_1_46.bin<br />
-rw-r--r--  1 lawrence  staff  1350539 Mar 15 13:47 lr_cmos_11_14_1_46.bin<br />
</code></p>
<p>Our file size for the file i have is 1350539 bytes.</p>
<p>A hexdump of the header shows:</p>
<p>00000000  42 4e 45 47 01 00 00 00  01 00 00 00 77 cb 0b 00  |BNEG&#8230;&#8230;..w&#8230;|<br />
00000010  00 d0 08 00 50 4b 03 04  14 00 00 00 08 00 3a 2e  |&#8230;.PK&#8230;&#8230;..:.|<br />
00000020  87 3b 3b e7 b8 16 03 cb  0b 00 bc d9 18 00 09 00  |.;;&#8230;&#8230;&#8230;&#8230;.|</p>
<p>PK is the standard file header for Zip compression (as Zip was invented by Phil Katz)<br />
Zip fingerprint in hex is &#8211; 0x04034b50, which matches nicely in our second line &#8211; 50 4b 03 04</p>
<p>On the offchance it contained a zip file, I tried unzipping from the start of the PK.</p>
<p>We can totally misuse dd to write from an offset of 20 bytes to a test.zip file as follows:</p>
<p><code><br />
lawrence$ dd if=lr_cmos_11_14_1_46.bin of=test.zip skip=0x14 bs=1 </p>
<p>(check I actually did that right)<br />
lawrence$ hexdump -C test.zip  |more<br />
00000000  50 4b 03 04 14 00 00 00  08 00 3a 2e 87 3b 3b e7  |PK........:..;;.|<br />
00000010  b8 16 03 cb 0b 00 bc d9  18 00 09 00 00 00 6c 69  |..............li|</p>
<p></code></p>
<p>Unfortunately this didn&#8217;t unzip.</p>
<p>However&#8230; </p>
<p><code>zipinfo test.zip<br />
Archive:  test.zip   1350519 bytes   1 file<br />
-rw-------  2.0 fat  1628604 b- defN  7-Dec-09 05:49 linux.bin<br />
1 file, 1628604 bytes uncompressed, 772867 bytes compressed:  52.5%</code></p>
<p>Says there is a valid zip file there, so we&#8217;re getting somewhere.  It should be something like 772867 bytes + whatever Zip header / footer file bits in size.</p>
<p>If we take a look at the Zip file format, it says that the end of directory (aka end of zip file) marker is 0x06054b50</p>
<p><code>ZIP end of central directory record </p>
<p>Offset 	Bytes 	Description[4]<br />
 0 	4 	End of central directory signature = 0x06054b50<br />
 4 	2 	Number of this disk<br />
 6 	2 	Disk where central directory starts<br />
 8 	2 	Number of central directory records on this disk<br />
10 	2 	Total number of central directory records<br />
12 	4 	Size of central directory (bytes)<br />
16 	4 	Offset of start of central directory, relative to start of archive<br />
20 	2 	ZIP file comment length (n)<br />
22 	n 	ZIP file comment</code></p>
<p>If we search the file for that, we get:<br />
000bcb70  78 2e 62 69 6e 50 4b 05  06 00 00 00 00 01 00 01  |x.binPK&#8230;&#8230;&#8230;|</p>
<p>So, from our Start PK 03 04 through to PK 05 06 we&#8217;re at position 0&#215;14 through 0x0bcb79</p>
<p>If we write that out now &#8211;<br />
dd if=lr_cmos_11_14_1_46.bin of=test.zip skip=0&#215;14 bs=1 count=0x0bcb79</p>
<p>Then try unzip test.zip &#8211; we have a winner!</p>
<p><code>lawrence$ unzip test.zip<br />
Archive:  test.zip<br />
  inflating: linux.bin<br />
lawrence$ ls -al test.zip<br />
-rw-r--r--  1 lawrence  staff  772985 Apr 30 03:28 test.zip<br />
lawrence$ ls -al linux.bin<br />
-rw-------@ 1 lawrence  staff  1628604 Dec  7 05:49 linux.bin<br />
</code></p>
<p>So, we know that the file has a header, then a zip file (which uncompresses to linux.bin, and has our linux binary), then more data.</p>
<p>If we take a look at what follows &#8211; ie the rest of the data in the original file after the end of the zip, it doesn&#8217;t look compressed</p>
<p>000bcb79  00 00 00 00 01 00 01 00  37 00 00 00 2a cb 0b 00  |&#8230;&#8230;..7&#8230;*&#8230;|<br />
000bcb89  00 00 2d 72 6f 6d 31 66  73 2d 00 08 cf a0 98 16  |..-rom1fs-&#8230;&#8230;|<br />
000bcb99  76 dd 72 6f 6d 20 34 62  31 63 62 36 38 66 00 00  |v.rom 4b1cb68f..|<br />
000bcba9  00 00 00 00 00 49 00 00  00 20 00 00 00 00 d1 ff  |&#8230;..I&#8230; &#8230;&#8230;|<br />
000bcbb9  ff 97 2e 00 00 00 00 00  00 00 00 00 00 00 00 00  |&#8230;&#8230;&#8230;&#8230;&#8230;.|<br />
000bcbc9  00 00 00 00 00 60 00 00  00 20 00 00 00 00 d1 d1  |&#8230;..`&#8230; &#8230;&#8230;|<br />
000bcbd9  ff 80 2e 2e 00 00 00 00  00 00 00 00 00 00 00 00  |&#8230;&#8230;&#8230;&#8230;&#8230;.|<br />
000bcbe9  00 00 00 00 00 c9 00 00  00 80 00 00 00 00 8c 88  |&#8230;&#8230;&#8230;&#8230;&#8230;.|<br />
000bcbf9  9d 47 73 77 61 70 00 00  00 00 00 00 00 00 00 00  |.Gswap&#8230;&#8230;&#8230;.|</p>
<p>&#8230;</p>
<p>000bd969  50 7d 64 68 63 70 63 00  00 00 00 00 00 00 00 00  |P}dhcpc&#8230;&#8230;&#8230;|<br />
000bd979  00 00 62 46 4c 54 00 00  00 04 00 00 00 40 00 01  |..bFLT&#8230;&#8230;.@..|<br />
000bd989  11 70 00 01 37 60 00 01  50 e8 00 00 28 00 00 01  |.p..7`..P&#8230;(&#8230;|<br />
000bd999  37 60 00 00 02 b5 00 00  00 05 00 00 00 00 00 00  |7`&#8230;&#8230;&#8230;&#8230;..|<br />
000bd9a9  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |&#8230;&#8230;&#8230;&#8230;&#8230;.|<br />
000bd9b9  00 00 1f 8b 08 00 f4 6b  45 3f 02 03 dc 5b 0f 70  |&#8230;&#8230;.kE?&#8230;[.p|<br />
000bd9c9  14 d7 79 7f bb 77 a7 bf  07 9c fe f0 c7 48 a0 95  |..y..w.......H..|<br />
000bd9d9  50 88 5c 23 b3 02 19 64  23 e0 84 30 76 72 b8 9c  |P.\#...d#..0vr..|<br />
000bd9e9  31 50 6c 2b 58 06 d7 25  84 d6 ea 80 6d 02 8c 7d  |1Pl+X..%....m..}|<br />
000bd9f9  48 02 64 17 b0 00 91 12  17 fb b6 29 ed 60 86 c6  |H.d........).`..|<br />
000bda09  4c aa 74 34 0e 71 0e 90  03 d3 d2 54 fc 51 87 30  |L.t4.q.....T.Q.0|</p>
<p>In fact it looks like more files...</p>
<p>bFLT is our flat ELF header..., and the other bits in-between look suspiciously like more files, and folders.<br />
So, we probably have a filesystem in there.</p>
<p>Its late, and thats all for today, but it looks like we might even get to play around with both the linux image and the web UI image.</p>
<p>Just had another thought though - if you recall, our romfs size was  0x0008D000</p>
<p>Image: 6 name:romfs.img base:0x7F0E0000 size:0x0008D000 exec:0x7F0E0000 -a</p>
<p>What do we see here - in our header?   00000010 00 d0 08 00 </p>
<p><code><br />
00000000 42 4e 45 47 01 00 00 00 01 00 00 00 77 cb 0b 00 |BNEG……..w…|<br />
00000010 00 d0 08 00 50 4b 03 04 14 00 00 00 08 00 3a 2e |….PK……..:.|<br />
</code></p>
<p>Seem to have a match, no?  0x 08 d0 00<br />
I'm going to bet that our 0x 00 0b cb 77 also has some meaning too in our header 20 bytes,  especially as the linux.bin zip file size is close to that at 0x00 0b cb 79.</p>
<p>Its highly probable I've miscounted something with the offset, and thats going to turn out to be the zip file size.</p>
<p>Now I've gotten this far, I'm too excited to go to sleep (its 4am here now!)</p>
<p>Lets try the filesystem from where we left off (aka from 0x0bcb79)<br />
dd if=lr_cmos_11_14_1_46.bin of=unsure_what_filesystem.img skip=0x0bcb79 bs=1 </p>
<p> mount -r unsure_what_filesystem.img<br />
mount: unsure_what_filesystem.img: unknown special file or file system.</p>
<p>Nope.</p>
<p>Kyle's blog comment has this gem in </p>
<blockquote><p>however the ‘-romfs-’ tag is offset by 0×14</p>
<p>so I used the line</p>
<p>fx 6 romfs.img 0x7f0a0000 0x7f0a0014 -a</p>
<p>the system then rebooted correctly…”</p></blockquote>
<p>Lets use that as the start.</p>
<p>hexdump -C unsure_what_filesystem.img |more<br />
00000000  00 00 00 00 01 00 01 00  37 00 00 00 2a cb 0b 00  |........7...*...|<br />
00000010  00 00 2d 72 6f 6d 31 66  73 2d 00 08 cf a0 98 16  |..-rom1fs-......|<br />
00000020  76 dd 72 6f 6d 20 34 62  31 63 62 36 38 66 00 00  |v.rom 4b1cb68f..|</p>
<p>-rom1fs- starts at position 0x12 [which is another indicator that I'm off by 2 bytes somewhere - as they mention 0x14 bytes, and the 12bytes prefix I have prior to the -rom1fs- are going to be from our second file header, I'll bet...<br />
 0x0bcb79 - 2 = 0x0bcb77, which is what the previous header said, so that really makes me think thats the filesize now! </p>
<p>Our ROMFS works out to  be 577 536 bytes, which is 0x8D000, which is also what the boot loader said, so getting a lot of good confirmation on these figures!]</p>
<p>Write that out to another file:<br />
dd if=unsure_what_filesystem.img of=still_unsure.img skip=0&#215;12 bs=1 </p>
<p>Still doesn&#8217;t mount on my Mac, however, some more googling for rom1fs uclinux got me here</p>
<p>http://romfs.sourceforge.net/</p>
<p>Which specifically mentions &#8211; </p>
<blockquote><p>Embedded projects using romfs</p>
<p>uClinux, the microcontroller Linux, is a port of the kernel, and selected user-space programs to capable, embedded processors, like some &#8220;smaller&#8221; Motorola m68k, and ARM systems. </p></blockquote>
<p>ROMFS looks like:</p>
<p>offset      content<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+<br />
  0     |  &#8211;  |  r  |  o  | m  |  \<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+    The ASCII representation of those bytes<br />
  4     |  1  |  f  |  s  |  &#8211;  |  /    (i.e. &#8220;-rom1fs-&#8221;)<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+<br />
  8     |     full size       |    The number of accessible bytes in this fs.<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+<br />
 12     |    checksum   |       The checksum of the FIRST 512 BYTES.<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+<br />
 16     |  volume name     |    The zero terminated name of the volume,<br />
        :               :       padded to 16 byte boundary.<br />
        +&#8212;+&#8212;+&#8212;+&#8212;+<br />
 xx     |     file      |<br />
        :    headers    :</p>
<p>struct romfs_super_block<br />
{</p>
<p>__u32 word0;</p>
<p>__u32 word1;</p>
<p>__u32 size;</p>
<p>__u32 checksum;</p>
<p>char name[0];        /* volume name */</p>
<p>};</p>
<p>Which looks to be a *very* good match for what that header has!<br />
So, its in ROMFS format from the -rom1fs- start header.</p>
<p>(Mostly from here &#8211; <a href="http://zhwen.org/?p=articles/romfs">http://zhwen.org/?p=articles/romfs</a>) </p>
<p>Unfortunately my OSX box appears to be missing romfs support, so I can&#8217;t check it without going back to the office.</p>
<p>mount -o loop -t romfs  still_unsure.img /mnt<br />
mount: exec /System/Library/Filesystems/romfs.fs/Contents/Resources/mount_romfs for /mnt: No such file or directory</p>
<p>Booted up my Debian VM, and tried again.<br />
<code><br />
debian:/mnt/hgfs/FI8908，FI8908W# mount -o loop -t romfs still_unsure.img /mnt/test -r<br />
debian:/mnt/hgfs/FI8908，FI8908W# cd /mnt/test/<br />
debian:/mnt/test# ls -al<br />
total 4<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 .<br />
drwxr-xr-x 4 root root 4096 2010-04-29 16:19 ..<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 bin<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 dev<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 etc<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 flash<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 home<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 proc<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 swap<br />
drwxr-xr-x 1 root root   32 1969-12-31 18:00 usr<br />
</code></p>
<p>We have a winner!</p>
<p>Full file listing below:</p>
<p><code>.<br />
|-- bin<br />
|   |-- camera<br />
|   |-- dhcpc<br />
|   |-- ifconfig<br />
|   |-- init<br />
|   |-- iwconfig<br />
|   |-- iwpriv<br />
|   |-- mypppd<br />
|   |   |-- chap-secrets<br />
|   |   |-- options<br />
|   |   |-- pap-secrets<br />
|   |   `-- pppd<br />
|   |-- route<br />
|   |-- rt73.bin<br />
|   |-- sh<br />
|   |-- wetctl<br />
|   `-- wpa_supplicant<br />
|-- dev<br />
|   |-- console<br />
|   |-- display<br />
|   |-- dsp -> dsp1<br />
|   |-- dsp0<br />
|   |-- dsp1<br />
|   |-- fb0<br />
|   |-- hda<br />
|   |-- hda1<br />
|   |-- hda2<br />
|   |-- hdb<br />
|   |-- i2c0<br />
|   |-- i2c1<br />
|   |-- key<br />
|   |-- keypad<br />
|   |-- lp0<br />
|   |-- mixer -> mixer1<br />
|   |-- mixer0<br />
|   |-- mixer1<br />
|   |-- mouse<br />
|   |-- mtd0<br />
|   |-- mtd1<br />
|   |-- mtdblock0<br />
|   |-- mtdblock1<br />
|   |-- nftlA1<br />
|   |-- nftla<br />
|   |-- null<br />
|   |-- ppp<br />
|   |-- ppp1<br />
|   |-- ptmx<br />
|   |-- pts<br />
|   |-- ptyp0<br />
|   |-- ptyp1<br />
|   |-- ptyp2<br />
|   |-- ptyp3<br />
|   |-- ptyp4<br />
|   |-- ptyp5<br />
|   |-- ptyp6<br />
|   |-- ptyp7<br />
|   |-- ptyp8<br />
|   |-- ptyp9<br />
|   |-- ptz0<br />
|   |-- rom0<br />
|   |-- rom1<br />
|   |-- rom2<br />
|   |-- sda<br />
|   |-- sda1<br />
|   |-- sda2<br />
|   |-- sdb<br />
|   |-- sdb1<br />
|   |-- sdb2<br />
|   |-- smartcard0<br />
|   |-- smartcard1<br />
|   |-- tty<br />
|   |-- tty1<br />
|   |-- ttyS0<br />
|   |-- ttyS1<br />
|   |-- ttyS2<br />
|   |-- ttyS3<br />
|   |-- ttyp0<br />
|   |-- ttyp1<br />
|   |-- ttyp2<br />
|   |-- ttyp3<br />
|   |-- ttyp4<br />
|   |-- ttyp5<br />
|   |-- ttyp6<br />
|   |-- ttyp7<br />
|   |-- ttyp8<br />
|   |-- ttyp9<br />
|   |-- urandom<br />
|   |-- usb<br />
|   |   |-- lp.sh<br />
|   |   |-- lp0<br />
|   |   |-- lp1<br />
|   |   |-- lp2<br />
|   |   |-- lp3<br />
|   |   |-- lp4<br />
|   |   |-- lp5<br />
|   |   |-- lp6<br />
|   |   |-- lp7<br />
|   |   |-- lp8<br />
|   |   `-- lp9<br />
|   |-- usi<br />
|   |-- video0<br />
|   `-- video1<br />
|-- etc<br />
|-- flash<br />
|-- home<br />
|-- proc<br />
|-- swap<br />
|-- usr<br />
`-- var<br />
    `-- run</p>
<p>13 directories, 97 files</code></p>
<p>While I obviously can&#8217;t run any binaries locally, I can look at the text files to confirm that the ROMFS hasn&#8217;t just gotten the filesystem correct.</p>
<p><code>debian:/mnt/test/bin# cat init<br />
mount -t proc none /proc<br />
mount -t ramfs none /usr<br />
mount -t ramfs none /swap<br />
mount -t ramfs none /var/run<br />
mount -t ramfs none /etc<br />
mount -t ramfs none /flash<br />
mount -t ramfs none /home<br />
camera&#038;<br />
sh<br />
</code></p>
<p><code>debian:/mnt/test/bin# file camera<br />
camera: BFLT executable - version 4 ram gzip<br />
</code></p>
<p>Looking *very* good.</p>
<p>Thats all for tonight, but it looks like we can easily add bits to the firmware using genromfs, dd, and a hex editor, or just genromfs, and someone willing to test a rebuilt user rom with an extra binary.  Probably going to be telnetd as ssh requires a kernel recompile <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Next step, actually doing that, and testing.</p>
<p>I&#8217;m definitely going to bed now &#8211; its 5:30am.</p>
<p>Tomorrow is a holiday though (in China), so happy May holidays!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt4/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Dell Mini 3i / OPhone Hacking thoughts / notes</title>
		<link>http://www.computersolutions.cn/blog/2010/03/dell-mini-3i-ophone-hacking-thoughts-notes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dell-mini-3i-ophone-hacking-thoughts-notes</link>
		<comments>http://www.computersolutions.cn/blog/2010/03/dell-mini-3i-ophone-hacking-thoughts-notes/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 20:48:16 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[China Related]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[dell mini3i]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[mini3i]]></category>
		<category><![CDATA[ophone]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=370</guid>
		<description><![CDATA[Currently I have an iPhone (ancient 2G), and have just bought a Dell Mini3i (600RMB with an 18month contract @ China Telecom), as I donated my 3G iPhone to one of the extended family back home. The Mini3i runs an Android variant called OPhone. The 3i is a little underwhelming software wise. Its quite crap [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I have an iPhone (ancient 2G), and have just bought a Dell Mini3i (600RMB with an 18month contract @ China Telecom), as I donated my 3G iPhone to one of the extended family back home.</p>
<p>The Mini3i runs an Android variant called OPhone.</p>
<p>The 3i is a little underwhelming software wise.</p>
<p>Its quite crap at the moment as its sitting on Android 1.0 (OPhone 1.0), but for all intents and purposes Android = Ophone its pretty much the same underneath.</p>
<p>There are a bunch of similar phones to this &#8211; the Lenovo O1, LG GW880, Motorola something or other (can&#8217;t be hassled to go look) etc.</p>
<p>While I haven&#8217;t rooted mine just yet, I have been playing around, and reading the Chinese forums.</p>
<p>Boot loader appears to be similar on all the devices &#8211; its made by BORQ&#8217;s in Beijing, and appears to be quite basic.</p>
<p>Motorola and O1 seem to have the best support for now, the main problem in the Chinese forums is people bitching about being stuck on older versions.</p>
<p>Some are running 1.6, most on 1.5, and the unlucky few 1.0 &#8220;Ophone&#8221;<br />
2.0 and 2.1 has yet to hit the mainstream here.</p>
<p>There are people with N1/G5&#8242;s (Nexus 1 / HTC G5) on 2.1 though (yes, thats you in Beijing Tom!), pretty much any phone is available, although anything with wifi is essentially grey import from overseas (HK mostly)</p>
<p>Back to the phone -</p>
<p>Thankfully you can install any apps as apk&#8217;s, no need to hack for that  &#8211; so its fairly easy to get info on the innards.</p>
<p>RootExplorer is your friend <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>RootExplorer also allows you to remount partitions r/w, so root access is fairly easy too.  There are precompiled su binaries for 1.5 out there, although I&#8217;ve yet to do my phone.</p>
<p>The Dell mini3 is running on a Marvell Tabor.  Fast chip, nice touchscreen, decent resolution, just crap on 1.0.  </p>
<p>Firmware files for most of the &#8220;ophones&#8221; (except motorola) are mff files.</p>
<p>The mff files appear to just be compressed images with instructions for how to write the various partitions out.</p>
<p>eg the Lenovo O1 mff has this in the &#8220;mff&#8221; zip </p>
<p>2010/02/25  10:53       147,111,936 factory_CHERRY.fbf<br />
2010/02/25  10:53               249 factory_CHERRY.mff.mlt<br />
2010/02/25  10:53               364 JADE_EVB_RawNANDx16.ini<br />
2010/02/25  10:53               327 magic_fbf.ini<br />
2010/02/25  10:53             2,692 magic_fbf_inner.ini<br />
2010/02/25  10:53        10,236,719 mfw.pac<br />
2010/02/25  10:53            54,180 MHLV_NTDKB_h.bin<br />
2010/02/25  10:53               176 MHLV_NTDKB_TIM.bin<br />
2010/02/25  10:53               858 NTIM_td.ini</p>
<p>magic_fbf_inner.ini has the layout</p>
<p>[INTEL_FLASH_DEVICE_INPUT_FILE]<br />
Number_of_Images=24</p>
<p>[IMAGE_HEADER_0]<br />
Start_Address=0&#215;240000<br />
Image_Length=0&#215;40000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0</p>
<p>[IMAGE_HEADER_1]<br />
Start_Address=0&#215;6900000<br />
Image_Length=0xf00000<br />
EraseBlocks=1<br />
WriteImage=0<br />
VerifyWrite=0</p>
<p>(etc)</p>
<p>Different phones have different firmware writing software, the Motorola&#8217;s are using RSDLite, LG &#8211; SML_OMS, CTHall, others something homegrown called Firebolt, which is written by BORQS.  I have all the firmware tools already, despite the Ophone8 forums lack of courtesy in sharing, grrr.</p>
<p>Most firmware tools appear similar though functionality wise.<br />
Haven&#8217;t played around inside the phone yet to see if its easy to get jtag access, although that was mostly because i couldn&#8217;t work out how to remove the top part without breaking it.</p>
<p>If anyone wants more info, or a firmware dump let me know.</p>
<p>Hopefully there is some interest out there in the English speaking world for these!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/03/dell-mini-3i-ophone-hacking-thoughts-notes/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

