<?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; IP Cam</title>
	<atom:link href="http://www.computersolutions.cn/blog/category/ip-cam/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>IPCam Hacking Part #7</title>
		<link>http://www.computersolutions.cn/blog/2011/01/ipcam-hacking-part-7/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ipcam-hacking-part-7</link>
		<comments>http://www.computersolutions.cn/blog/2011/01/ipcam-hacking-part-7/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 00:21:46 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Firmware]]></category>
		<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[arm7]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nc745]]></category>
		<category><![CDATA[nuvoton]]></category>
		<category><![CDATA[uclinux]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=661</guid>
		<description><![CDATA[Its been a while since I did any IPCam stuff, but I&#8217;ve now got most of the bits I needed together again, as well as a new laptop for dev work (curse the thieves that stole my last one!) As we recall from previous work, the main binary for the IPCam runs off a file [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a while since I did any IPCam stuff, but I&#8217;ve now got most of the bits I needed together again, as well as a new laptop for dev work (curse the thieves that stole my last one!)</p>
<p>As we recall from previous work, the main binary for the IPCam runs off a file called &#8220;camera&#8221;.</p>
<p>As some people have discovered, it likes to reboot the equipment when its not happy (eg when the camera is unplugged, it has issues talking to hardware, or when someone has flashed the wrong firmware).</p>
<p>So, lets take a look at the executable to see what interesting bits we can find out from it.</p>
<p>#file camera tells us  &#8211; BINFLT file format. Fileflags: RAM GZIP.<br />
So we know its a compressed bflt elf &#8211; bflt stands for binary flat file, and it uses gzip compression. It also sits in ram.</p>
<p>A hex dump of camera shows this for the first few bytes:</p>
<p><code>62 46 4C 54 00 00 00 04  |   bFLT . . . . </code></p>
<p>[<span style="color: red;">Note - I had about 4 pages of #$%# work done on this, and WordPress decided to flake once finished due to an errant pasted 0x0 null byte above, cutting off the rest of my post, so this is going to be shorter and angrier than it was originally written. <br />Lesson learned, always save stuff elsewhere before posting.</span>]</p>
<p>bFLT headers consist of 4 bytes identifier, then 4 bytes for the version number.<br />
In this case, its a version 4  bFLT file.</p>
<p>If we take a look at the header file source for bflt at the uclinux site we see the below layout.</p>
<p><code><br />
      struct flat_hdr {<br />
      	char magic[4];<br />
      	unsigned long rev;          /* version */<br />
      	unsigned long entry;        /* Offset of first executable instruction with text segment from beginning of file */<br />
      	unsigned long data_start;   /* Offset of data segment from beginning of file */<br />
      	unsigned long data_end;     /* Offset of end of data segment from beginning of file */<br />
      	unsigned long bss_end;      /* Offset of end of bss segment from beginning of file */<br />
      	/* (It is assumed that data_end through bss_end forms the bss segment.) */<br />
      	unsigned long stack_size;   /* Size of stack, in bytes */<br />
      	unsigned long reloc_start;  /* Offset of relocation records from beginning of file */<br />
      	unsigned long reloc_count;  /* Number of relocation records */<br />
      	unsigned long flags;<br />
      	unsigned long filler[6];    /* Reserved, set to zero */<br />
      };<br />
</code></p>
<p>It doesn&#8217;t match up properly, as the sizes or code don&#8217;t make sense (yet).</p>
<p>If we take a closer look, the header file has this to say:</p>
<p><code><br />
      #define FLAT_FLAG_RAM    0x0001 /* load program entirely into RAM */<br />
      #define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */<br />
      #define FLAT_FLAG_GZIP   0x0004 /* all but the header is compressed */<br />
</code></p>
<p>Ahah!</p>
<p>So, all but the header is compressed for a version 4 file.</p>
<p>Lets check this out, and see if its correct.<br />
Excluding the initial file identifier (bFLT), our header consists of  10 longs.  Thats 40 bytes long.<br />
Lets jump to offset 40 in the file, and see what we have there.</p>
<p>1F 8B 08</p>
<p>Those of you familiar with gzipped files will recognize that  &#8211; its the gzip header identifier.  So, so far, so good.<br />
Compressed files aren&#8217;t very useful to us, as they don&#8217;t show much text content.<br />
So, we could unzip the file to take a look at whats inside.</p>
<p>There are a number of ways we can unzip this (zcat, gzip -d etc), but I&#8217;m going to be lazy, and use someone elses premade code.</p>
<p>See below for some perl to safely uncompress our binary , taken from here &#8211; <a href="http://www.openwiz.org/wiki/BWFWTools_Release">http://www.openwiz.org/wiki/BWFWTools_Release</a></p>
<p><code><br />
#!/usr/bin/perl</p>
<p>=pod</p>
<p>=head1 NAME</p>
<p>gunzip_bflt - convert gzip-compressed bFLT executable files into uncompressed bFLT</p>
<p>=head1 SYNOPSIS</p>
<p>    gunzip_bflt zipped_blflt_files...</p>
<p>=head1 DESCRIPTION</p>
<p>Convert gzipped bFLT files into an uncompressed bFLT files.<br />
The unzipped bFLT files have B<.unz> added to their file names.<br />
If the file is already ungzipped bFLT, it isn't converted,<br />
but a warning is printed.</p>
<p>=head1 PREREQUSITES</p>
<p>Uses packages C<IO::Uncompress::Gunzip> and C<POSIX>.</p>
<p>=cut</p>
<p>use strict;<br />
use warnings;</p>
<p># gunzip_bflt zipped_blflt_files...</p>
<p>use IO::Uncompress::Gunzip qw/gunzip $GunzipError/;<br />
use POSIX;</p>
<p># Read and return the BFLT header<br />
# prints a warning and returns undef on error.<br />
# $bfltZfh is the BFLT file handle,<br />
# $bfltZ is the BFLT file name (for error messages)</p>
<p>sub get_bflt_hdr($$) {<br />
    my ($bfltZfh, $bfltZ) = @_;<br />
    my $buf;<br />
    my $res = sysread $bfltZfh, $buf, 64;<br />
    if(!defined($res)) {<br />
	warn "$bfltZ: $!\n";<br />
	return undef;<br />
    }<br />
    if($res < 64) {<br />
	warn "$bfltZ: Too short!\n";<br />
	return undef;<br />
    }<br />
    # Align the buffered file handle with the unbuffered<br />
    seek $bfltZfh, sysseek($bfltZfh, 0, SEEK_CUR), SEEK_SET;<br />
    return $buf;<br />
}</p>
<p># Expand a gzipped BFLT intoi an ungziped BFLT</p>
<p>sub expand_blftZ($) {<br />
    my ($bfltZ) = @_;<br />
    my $bflt = $bfltZ . '.unz';<br />
    if(!open BFLTZ, '<' . $bfltZ) {<br />
	warn "$bfltZ: $!\n";<br />
	return;<br />
    }<br />
    my $hdr = get_bflt_hdr(\*BFLTZ, $bfltZ);<br />
    if(!defined $hdr) {<br />
	return;<br />
    }<br />
    if(substr($hdr, 0, 4) eq 'bFLT') {<br />
	# Pack/unpack template for the BFLT header, 4 bytes ACSII,<br />
	# 15 little-endian words<br />
	my $hdrFmt = 'a4 N15';</p>
<p>	my @unpHdr = unpack $hdrFmt, $hdr;</p>
<p>	# Test the header flags 'gzipped' bit<br />
	if($unpHdr[9] &#038; 4) {</p>
<p>	    # Unset the header flags 'gzipped' bit, and make a new header<br />
	    $unpHdr[9] &#038;= ~4;<br />
	    $hdr = pack $hdrFmt, @unpHdr;</p>
<p>	    if(open BFLT, '>' . $bflt) {</p>
<p>		# Write the header<br />
		syswrite BFLT, $hdr;</p>
<p>		# Align the buffered file handle with the unbuffered<br />
		seek BFLT, sysseek(BFLT, 0, SEEK_CUR), SEEK_SET;</p>
<p>		# Ungzip from the compressed file into the uncompressed<br />
		# file<br />
		gunzip \*BFLTZ => \*BFLT<br />
		    or die "gunzip failed: $GunzipError\n";</p>
<p>		close BFLTZ;<br />
	    } else {<br />
		warn "$bflt: $!\n";<br />
		return;<br />
	    }<br />
	} else {<br />
	    warn "$bfltZ: Not a compressed bFLT file, not gunzipped\n";<br />
	    return;<br />
	}<br />
    } else {<br />
	warn "$bfltZ: Not a bFLT file\n";<br />
    }<br />
    close BFLT;<br />
}</p>
<p># Expand the arguments...</p>
<p>foreach my $bfltZ (@ARGV) {<br />
    expand_blftZ($bfltZ)<br />
}<br />
</code></p>
<p>If we run that on our &#8216;camera&#8217; executable, we should have an uncompressed bFLT file as output &#8216;camera.unz&#8217;.<br />
Lets run strings on &#8216;camera.unz&#8217;, to see what interesting text content is in there.</p>
<p>Some interesting things of note:</p>
<p>From the variables list below, looks like there is a way to turn off the LED&#8230;</p>
<blockquote><p>
led_mode<br />
ptz_center_onstart<br />
ptz_auto_patrol_interval<br />
ptz_auto_patrol_type<br />
ptz_patrol_h_rounds<br />
ptz_patrol_v_rounds<br />
ptz_patrol_rate<br />
ptz_patrol_up_rate<br />
ptz_patrol_down_rate<br />
ptz_patrol_left_rate<br />
ptz_patrol_right_rate
</p></blockquote>
<p>We also have a full list of the internal cgi functions now, which might prove useful&#8230;</p>
<blockquote><p>
snapshot.cgi<br />
get_status.cgi<br />
get_camera_params.cgi<br />
decoder_control.cgi<br />
camera_control.cgi<br />
reboot.cgi<br />
restore_factory.cgi<br />
upgrade_firmware.cgi<br />
upgrade_htmls.cgi<br />
get_params.cgi<br />
set_alias.cgi<br />
set_datetime.cgi<br />
set_users.cgi<br />
set_devices.cgi<br />
set_network.cgi<br />
set_wifi.cgi<br />
set_pppoe.cgi<br />
set_upnp.cgi<br />
set_ddns.cgi<br />
set_ftp.cgi<br />
set_mail.cgi<br />
set_alarm.cgi<br />
videostream.cgi<br />
video.cgi<br />
test_ftp.cgi<br />
test_mail.cgi<br />
set_misc.cgi<br />
get_misc.cgi<br />
set_p2p.cgi<br />
get_p2p.cgi<br />
set_forbidden.cgi<br />
get_forbidden.cgi<br />
set_decoder.cgi<br />
comm_write.cgi<br />
wifi_scan.cgi<br />
get_wifi_scan_result.cgi<br />
get_log.cgi<br />
check_user.cgi<br />
check_user2.cgi<br />
backup_params.cgi<br />
restore_params.cgi<br />
erase_allparams.cgi<br />
set_mac.cgi<br />
do_cgi: unknown cgi
</p></blockquote>
<p>You can see that Maverick decided to fake the X-Mailer smtp header (Foxmail is a commonly used Mail Program in China).</p>
<blockquote><p>
MIME-Version: 1.0<br />
Content-Type: multipart/mixed;<br />
boundary=&#8221;smtp_msg_boundary&#8221;<br />
X-Mailer: Foxmail<br />
&#8211;smtp_msg_boundary<br />
Content-Type: image/jpeg;<br />
name=&#8221;%s(%s)_%c%s.jpg&#8221;<br />
Content-Transfer-Encoding: base64<br />
&#8211;smtp_msg_boundary&#8211;
</p></blockquote>
<p>I&#8217;m interested in why the firmware reboots on some firmwares though, so lets take a deeper look at the code.</p>
<p>To do so, we&#8217;ll need to decompile it.<br />
The better equipped than me will probably use something like the nice ARM decompiler plugin for IDA-Pro called <a href="http://www.hex-rays.com">Hex-Ray</a>.  Unfortunately that costs $$$, and I&#8217;m just a hobbyist.</p>
<p>Luckily there is a free windows decompiler called arm2html available <a href="http://www.sigmaplayer.com/filebase.php?d=1&#038;id=13&#038;c_old=5&#038;what=c&#038;page=1">here.</a><br />
arm2html doesn&#8217;t handle compressed bFLT files though, so you&#8217;ll need to point it at the freshly ungzipped code you got from the perl script above.</p>
<p>As we know that the camera executable reboots after issuing i2c errors, the first piece of decompiled code I wanted to look at was the first piece of code related to i2c:</p>
<p>(excerpted piece below)<br />
<code>02588:  e1a0c00d	mov	ip, sp<br />
00258c:  e92dd810	stmdb	sp!, {r4, fp, ip, lr, pc}<br />
002590:  e24cb004	sub	fp, ip, #4	; 0x4<br />
002594:  e24dd00c	sub	sp, sp, #12	; 0xc<br />
002598:  e59f023c	ldr	r0, [pc, #572] ; [0027dc]	"/dev/i2c0"<br />
00259c:  e3a01002	mov	r1, #2	; 0x2<br />
0025a0:  eb00c9b8	bl	034c88(c9b8)<br />
0025a4:  e1a04000	mov	r4, r0<br />
0025a8:  e3540000	cmp	r4, #0	; 0x0<br />
0025ac:  aa000003	bge	0025c0(3) ; jump<br />
0025b0:  e59f0228	ldr	r0, [pc, #552] ; [0027e0]	"%s: can not open i2c device"<br />
0025b4:  e59f1228	ldr	r1, [pc, #552] ; [0027e4]	"zoom_test"<br />
0025b8:  eb00bc86	bl	0317d8(bc86)<br />
0025bc:  e91ba810	ldmdb	fp, {r4, fp, sp, pc} ; return</code></p>
<p>The full piece of code essentially loops 7 times trying to open the i2c sensor to call the zoom_test code.  If it fails, it calls for a reboot.<br />
Success proceeds to setting up the camera. </p>
<p>We know from our boot log that my camera in this model is a Sonix288.</p>
<blockquote><p>dvm usb cam driver 0.0.0.0 by Maverick Gao in 2006-8-12<br />
usb.c: registered new driver dvm<br />
dvm usb cam driver 0.1 for sonix288 by Maverick Gao in 2009-4-20<br />
usb.c: registered new driver dvm usb cam driver for sonix288</p></blockquote>
<p>The Sonix288 is a chipset SoC that will talk to an attached image sensor via i2c.  I think that the Sonix288 is probably a standard USB 1.1/2.0 compatible UVC  (USB Video Class) chipset from a bit of googling about it.</p>
<p>We don&#8217;t have the source for our particular camera though (its secret, much like the data sheets, grrr&#8230;).<br />
What to do?<br />
Linux generally uses spcaxxx (and UVC) drivers for talking to camera&#8217;s, so lets start taking a look there.</p>
<p><a href="http://read.pudn.com/downloads127/sourcecode/unix_linux/539050/zc030x/zc030x_cameras.c__.htm">http://read.pudn.com/downloads127/sourcecode/unix_linux/539050/zc030x/zc030x_cameras.c__.htm<br />
</a><br />
<a href="http://www.hackchina.com/r/54654/zc030x_i2c.c__html">http://www.hackchina.com/r/54654/zc030x_i2c.c__html</a></p>
<p>Taking a look at some spcaxxx driver header files and code shows that i2c is setup by first getting the USB VID, USB PID of the hardware, then talking to the i2c device on that hardware.</p>
<p>So, we need to know what our USB VID and PID&#8217;s are.</p>
<p>Generally all devices from a given manufacturer will have a single VID as issued by the USB Forum.</p>
<p>If we search through the code for Sonix, it appears that Sonix&#8217;s VID is 0x0c45</p>
<p><code>{USB_DEVICE(0x0c45, 0x607c)}, /* Sonix sn9c102p Hv7131R */ </code><br />
(from http://linux.downloadatoz.com/linux-kernel-webcams-driver-gspca-spca5xx/ )</p>
<p>The Linux UVC page confirms this <a href="http://www.ideasonboard.org/uvc/">http://www.ideasonboard.org/uvc/</a>.</p>
<p>(Listings of webcams excerpted &#8211; note the VID of 0c45)</p>
<blockquote><p>0c45:6310 	USB 2.0 Camera (Trust Chat Webcam) 	Sonix Technology<br />
0c45:63e0 	Sonix Integrated Webcam (Dell notebooks) 	Sonix Technology<br />
0c45:63ea 	Laptop Integrated Webcam 2M (Dell Studio 1555 notebooks) 	Sonix Technology<br />
0c45:6409 	USB 2.0 Camera (Nokia Booklet 3G netbooks) 	Sonix Technology<br />
0c45:6415 	Laptop Integrated Webcam 1.3M (Dell Inspiron 13z notebooks) 	Sonix Technology</p></blockquote>
<p>Ideally at this point, I&#8217;d have a data sheet for the Sonix288 chip, but the #$%#$ people at <a href="http://www.sonix.com.tw/">Sonix</a> don&#8217;t seem to publish one for us mere mortals.</p>
<p>So, we&#8217;ll use the next best thing, and use one for their other chipsets.</p>
<p>SN9C1xx PC Camera Controllers &#8211;<br />
<a href="http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/video4linux/sn9c102.txt">http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/video4linux/sn9c102.txt</a></p>
<p>There is a lot of good useful info in that particular file.  We don&#8217;t know how much is useful yet, but generally chipsets are quite similar for a given range.</p>
<blockquote><p>
Image sensor / SN9C1xx bridge      | SN9C10[12]  SN9C103  SN9C105  SN9C120<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
HV7131D    Hynix Semiconductor     | Yes         No       No       No<br />
HV7131R    Hynix Semiconductor     | No          Yes      Yes      Yes<br />
MI-0343    Micron Technology       | Yes         No       No       No<br />
MI-0360    Micron Technology       | No          Yes      Yes      Yes<br />
OV7630     OmniVision Technologies | Yes         Yes      Yes      Yes<br />
OV7660     OmniVision Technologies | No          No       Yes      Yes<br />
PAS106B    PixArt Imaging          | Yes         No       No       No<br />
PAS202B    PixArt Imaging          | Yes         Yes      No       No<br />
TAS5110C1B Taiwan Advanced Sensor  | Yes         No       No       No<br />
TAS5110D   Taiwan Advanced Sensor  | Yes         No       No       No<br />
TAS5130D1B Taiwan Advanced Sensor  | Yes         No       No       No
</p></blockquote>
<p>Interesting&#8230; Hmm, so it seems that Sonix uses a SN9Cxxx for its product names.<br />
Lets google for SN9C288 instead, and see if we get any results.</p>
<p>Bingo.</p>
<p>From here &#8211; <a href="http://www.lh-invest.com/en/showpro.asp?id=308&#038;proid=3">www.lh-invest.com/en/showpro.asp?id=308&#038;proid=3</a></p>
<blockquote><p>
* MCU: SONIX SN9C288<br />
* Sensor: MICRON K14 1,300,000 pixels CMOS<br />
* 5-glass lens,can reach 30 frames/sec. under 640*480<br />
  resolutions,software insertion value 1,300,000 pixels<br />
* Focus range: 3CM to infinitude farness<br />
* Dynamic video resolutions: 1280*960 pixels(max.)<br />
* Support microsoft UVC driver-free function<br />
* Support RGB24 and YUY2 two kinds of image formats<br />
* USB 2.0 port,support plug and play<br />
* Human face tracking function
</p></blockquote>
<p>Seems our chipset is finally getting some details.<br />
Max resolution, video modes, face tracking capability, etc<br />
We also know that it can be paired with a Micron K14 image sensor.</p>
<p>Further googling reveals it can also be paired with the MI-0360 (which is listed above).</p>
<p>SN9C288+MI0360</p>
<p> This page also gives us a possible pid:</p>
<p> <a href="http://forums.lenovo.com/t5/SL-Series-ThinkPad-Laptops/camera-problem-in-all-windows-Creation-of-the-Video-preview/m-p/163019/highlight/true">http://forums.lenovo.com/t5/SL-Series-ThinkPad-Laptops/camera-problem-in-all-windows-Creation-of-the-Video-preview/m-p/163019/highlight/true</a></p>
<blockquote><p>
&#8220;Device Name: ?USB Video Device</p>
<p>PnP Device ID: VID = 0C45 PID = 62C0<br />
Serial Number: 6&#038;&#038;2BCAFCF3&#038;&#038;0&#038;&#038;0000<br />
Revision: (Information not returned)</p>
<p>Device Type: Standard USB device &#8211; USB2.0 High-Speed</p>
<p>Chip Vendor: SONiX<br />
Chip Part-Number: SN9C288PFG</p>
</blockquote>
<p>In Microsoft parlance, this looks like this USB\VID_0C45&#038;PID_62C0</p>
<p>Googling that gives us a product with windows drivers (HP) and more.</p>
<p><a href="http://www.downloadwindowsdrivers.info/usb/vid_0c45/pid_62c0/mi_00/">http://www.downloadwindowsdrivers.info/usb/vid_0c45/pid_62c0/mi_00/</a></p>
<p>Also says that these product drivers also work.<br />
USB\VID_0C45&#038;PID_62C0 ;SN9C211/213/230</p>
<p>That means we can take a look at their inf file and see if anything useful in there.  Unfortunately I did, and there isn&#8217;t much <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Sonix has datasheets for some of their other products available though (SN9C2028AF).</p>
<p>First, a quick overview of UVC devices (snarfed from elsewhere).</p>
<p>USB devices are required by the USB specification to respond to the Host device (the computer) with a stream of data describing the device and the interface to the device.  This “Device Descriptor” includes vendor, product, and version IDs specific to the manufacturer, the product, and the version of the product.  In addition to the device information, the descriptor also includes information on how to talk to the device through a series of “Interface Descriptors”.  </p>
<p>The device descriptor for Video is 13.</p>
<p>#define USB_DEVICE_CLASS_VIDEO         0x0E</p>
<p>In addition to the end points described in the interface descriptors, all USB devices support a control pipe to end point 0.  This is used to manipulate some of the low level functions of the device such as power, and error status queries.</p>
<p>The USB Video specification describes two interfaces, a control interface to manage the camera, and a stream interface to send or receive video information from the camera.   </p>
<p>The control interface is used to manipulate the camera parameters such as brightness and contrast as well as to negotiate a valid set of the video format, frame size, frame rate, and compression rates parameters that describe a video stream.  In addition, the control interface can ask the camera for still frame.</p>
<p>In the datasheet for the 2028, it basically states that they use end point 0 for STD Commands, with a maximum packet size of 64 bytes.</p>
<p>Further googling reveals that there is no special driver for it, its a plain UVC 1.0 device.</p>
<blockquote><p>usb 1-2: New USB device strings: Mfr=2, Product=1, SerialNumber=0<br />
usb 1-2: Product: USB 2.0 Camera<br />
usb 1-2: Manufacturer: Sonix Technology Co., Ltd.<br />
Linux video capture interface: v2.00<br />
uvcvideo: Found UVC 1.00 device USB 2.0 Camera</p></blockquote>
<p>Further heavy baidu&#8217;ing in Chinese sites finds that the SN9C213 and SN9C288 are the same pretty much.</p>
<p>其内部编号是SN9C213，功能完全和SN9C288一样。From  <a href="http://ep.cbifamily.com/2007/04/44/87819.html">http://ep.cbifamily.com/2007/04/44/87819.html</a></p>
<p>David McCullough very nicely also compiled in usb debug support on his kernel and ran some tests too:</p>
<p>> > > T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0<br />
> > > D: Ver= 2.00 Cls=ef(unk. ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1<br />
> > > P: Vendor=0c45 ProdID=62f1 Rev= 1.00<br />
> > > S: Manufacturer=Sonix Technology Co., Ltd.<br />
> > > S: Product=USB 2.0 Camera<br />
> > > C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA<br />
> > > I: If#= 0 Alt= 0 #EPs= 1 Cls=0e(unk. ) Sub=01 Prot=00 Driver=(none)<br />
> > > E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=6ms<br />
> > > I: If#= 1 Alt= 0 #EPs= 0 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > I: If#= 1 Alt= 1 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=1ms<br />
> > > I: If#= 1 Alt= 2 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 256 Ivl=1ms<br />
> > > I: If#= 1 Alt= 3 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 512 Ivl=1ms<br />
> > > I: If#= 1 Alt= 4 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 600 Ivl=1ms<br />
> > > I: If#= 1 Alt= 5 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 800 Ivl=1ms<br />
> > > I: If#= 1 Alt= 6 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)<br />
> > > E: Ad=81(I) Atr=05(Isoc) MxPS= 956 Ivl=1ms</p>
<p>The uvc driver status is obviously an issue as we&#8217;re on a 2.4 Kernel.  No uvc support on 2.4.<br />
So&#8230;, we either compile 2.6 with UVC support, and reflash, or we continue to use Mavericks driver in lieu of any source.</p>
<p>With that, you have some background on things..<br />
Now, why does this cause a reboot on some machines?</p>
<p>Well, the hardware is different, so the hardware isn&#8217;t seen by the driver.<br />
From looking at a few different boards I have seen a few devices id&#8217;s used.</p>
<p>So far I have seen these:<br />
<strong>vid_0c45/pid_62f1</strong> &#8211;   (The Sonix Chipset allows you to write pid&#8217;s into the device, so this can be changed, or alternately change the driver from 62c0 to 62f1 on these models)</p>
<p><strong>vid_0c45/pid_62c0</strong> &#8211;    (Our driver is compiled for this)</p>
<p>For those of you with rebooting machines, remove &#8216;camera &#038;&#8217; from the boot sequence, recompile the kernel with USB verbose debug message logging, and start posting your vid/pid&#8217;s here so we can compare, and add to the list.</p>
<p>If someone twisted my arm I could probably oblige&#8230;</p>
<p><strong>References:</strong><br />
<a href="http://www.beyondlogic.org/uClinux/bflt.htm">http://www.beyondlogic.org/uClinux/bflt.htm</a> &#8211; bFLT file format details.<br />
<a href="http://www.garykessler.net/library/file_sigs.html">http://www.garykessler.net/library/file_sigs.html</a> &#8211; Common file format headers<br />
<a href="http://www.openwiz.org/wiki/BWFWTools_Release">http://www.openwiz.org/wiki/BWFWTools_Release</a> &#8211; bFLT unzip and other tools<br />
<a href="http://www.hex-rays.com">http://www.hex-rays.com</a> &#8211; IDA Pro and Hex-Ray ARM Decompiler<br />
<a href="http://www.sigmaplayer.com/filebase.php?d=1&#038;id=13&#038;c_old=5&#038;what=c&#038;page=1">http://www.sigmaplayer.com/filebase.php?d=1&#038;id=13&#038;c_old=5&#038;what=c&#038;page=1</a> &#8211; Arm Decompiler<br />
<a href="http://www.ideasonboard.org/uvc/">http://www.ideasonboard.org/uvc/</a><br />
<a href="http://read.pudn.com/downloads127/sourcecode/unix_linux/539050/zc030x/zc030x_cameras.c__.htm">http://read.pudn.com/downloads127/sourcecode/unix_linux/539050/zc030x/zc030x_cameras.c__.htm</a><br />
<a href="http://www.hackchina.com/r/54654/zc030x_i2c.c__html">http://www.hackchina.com/r/54654/zc030x_i2c.c__html</a><br />
<a href="http://linux.downloadatoz.com/linux-kernel-webcams-driver-gspca-spca5xx/">http://linux.downloadatoz.com/linux-kernel-webcams-driver-gspca-spca5xx/</a><br />
<a href="http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/video4linux/sn9c102.txt">http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/video4linux/sn9c102.txt</a></p>
<p><strong>Files from this post:</strong><br />
(arm2html.exe, bFLT gunzip perl script, original camera bFLT, uncompressed camera bFLT, and camera asm source )<br />
<a href='http://www.computersolutions.cn/blog/wp-content/uploads/2011/01/Camera-Disassembly-unpacked-bFLT-and-Tools.zip'>Camera Disassembly, unpacked bFLT and Tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2011/01/ipcam-hacking-part-7/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>IP Cam Hacking – pt#6</title>
		<link>http://www.computersolutions.cn/blog/2010/05/ip-cam-hacking-%e2%80%93-pt6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ip-cam-hacking-%25e2%2580%2593-pt6</link>
		<comments>http://www.computersolutions.cn/blog/2010/05/ip-cam-hacking-%e2%80%93-pt6/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:07:41 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[arm7]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nc745]]></category>
		<category><![CDATA[nuvoton]]></category>
		<category><![CDATA[uclinux]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=509</guid>
		<description><![CDATA[I&#8217;ve uploaded a zip of my built test image here. I&#8217;ve only included telnetd, and ftpd, as the sshd binary is very large, and won&#8217;t fit into our rom image space! If someone is willing to test, feel free. Test Rom with FTPD and TELNETD binaries added This rom is 700k+- vs the normal 550kb. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded a zip of my built test image here.  I&#8217;ve only included telnetd, and ftpd, as the sshd binary is very large, and won&#8217;t fit into our rom image space!</p>
<p>If someone is willing to test, feel free.</p>
<p><a href='http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/testrom.zip'>Test Rom with FTPD and TELNETD binaries added</a></p>
<p>This rom is 700k+- vs the normal 550kb. So this may / may not overwrite the web ui.</p>
<p>As China&#8217;s firewall is being particularly obnoxious this week as to what I can view on the web, I can&#8217;t actually get to the info I need to see where they typically write the UI to in rom.</p>
<p>In theory, we should be able to write to the same base address via the boot loader.</p>
<p>The original rom is written here -</p>
<p>Image: 6 name:romfs.img base:0×7F0E0000 size:0×0008D000 exec:0×7F0E0000 -a</p>
<p>And I&#8217;m pretty sure that the UI gets written somewhere after this, and not as a separate image.  I&#8217;d have to run Windows and a sniffer to test this though (using their firmware update software).</p>
<p>Our boot logs show that linux blkmem driver is set to view the whole area from 0×7F0E0000 through to 0x7F16D3FF, so we should easily have 200kb to waste^Hplay with.</p>
<p>From my boot logs:</p>
<p>Blkmem 1 disk images:<br />
0: 7F0E0000-7F16D3FF [VIRTUAL 7F0E0000-7F16D3FF] (RO)</p>
<p>Obstensibly, this should be a matter of going to the bootloader over serial, then uploading our img file.<br />
Suggest rename from testrom.img to romfs.img to be consistent.</p>
<p>It should be something like this:</p>
<p>bootloader > del 6<br />
(delete the current romfs.img)</p>
<p>bootloader > fx 6 romfs.img 0x7f0e0000 0x7f0e0000 -a<br />
Waiting for download<br />
Press Ctrl-x to cancel &#8230;  (while it waits, you have to select Transfer > Send File in Hyperterminal menu, choose the Xmodem protocol and select my rom image)<br />
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC<br />
Flash programming &#8230;</p>
<p>bootloader> boot</p>
<p>Then see what happens in the logs.</p>
<p>It should boot, then attempt to run telnetd and ftpd.<br />
That probably WON&#8217;T work just yet, as they&#8217;ll complain about missing /etc/ config files. </p>
<p>You might also be missing the UI (as I think this gets written somewhere after our romfs.img in flash)</p>
<p>Send me the serial logs in the comments, and I can fix that up, and repackage.</p>
<p>I also know why the alleged clones (NB they&#8217;re not f..king clones sigh, they&#8217;re all made by 1 manufacturer here for different people, including FOSCAM) don&#8217;t work.  The linux.bin for older firmware is set to boot from  0x7f0D0000  as opposed to  0x7f0e0000, so image 6 and 7 both need to be reflashed.</p>
<p>Also of note is that the newer units have gone cheaper, and use 2M flash, previous units had 4M.<br />
uCLinux reports 8M, but its not talking about Flash, just RAM</p>
<p>Be prepared to brick (not completely, as we have a bootloader, and can reflash the original firmware) if it doesn&#8217;t work.</p>
<p>If my rom above doesn&#8217;t work initially for you, try flashing this <a href='http://www.computersolutions.cn/blog/wp-content/uploads/2010/05/linux.zip'>linux.zip</a> before reverting, and see if that helps it boot.</p>
<p>eg<br />
<code><br />
bootloader> del 7</p>
<p>bootloader> fx 7 linux.zip 0x7f020000 0x8000 -acxz<br />
Waiting for download<br />
Press Ctrl-x to cancel ...  (while it waits, you have to select Transfer > Send File in Hyperterminal menu, choose the Xmodem protocol and select my linux.zip)<br />
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC<br />
Flash programming ...</p>
<p>bootloader> fx 6 romfs.img 0x7f0e0000 0x7f0e0000 -a<br />
Waiting for download<br />
Press Ctrl-x to cancel ...  (while it waits, you have to select Transfer > Send File in Hyperterminal menu, choose the Xmodem protocol and select my rom image)<br />
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC<br />
Flash programming ...<br />
</code></p>
<p>Why aren&#8217;t I doing this?</p>
<p>Mostly as I don&#8217;t currently have a good serial connection, I&#8217;m waiting on headers.  Currently I have to hold the serial ports onto the board with fingers, and thats less than reliable!</p>
<p>I should get around to fixing that soonish though, I&#8217;m interested in testing this myself&#8230;</p>
<blockquote><p>I&#8217;d also appreciate the French contingent adding some info. I&#8217;m particularly interested in paillassou&#8217;s board photos, and any other firmware people have found for these so I can compare.</p></blockquote>
<p> I can&#8217;t get to Picasa, GadgetVictims, IrishJesus now in China. Grrr.</p>
<p>Yes, I know, use a VPN or proxy&#8230;  Unfortunately what we do precludes doing so, as I&#8217;d probably get told off by our beloved government here, and thats not worth the risk&#8230;</p>
<p>Comments please.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/05/ip-cam-hacking-%e2%80%93-pt6/feed/</wfw:commentRss>
		<slash:comments>122</slash:comments>
		</item>
		<item>
		<title>IP Cam Hacking – pt#5</title>
		<link>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ip-cam-hacking-pt5</link>
		<comments>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt5/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 08:04:11 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arm7]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nc745]]></category>
		<category><![CDATA[nuvoton]]></category>
		<category><![CDATA[uclinux]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=489</guid>
		<description><![CDATA[So far in this series, we&#8217;ve learnt a few things. First, is that this hardware is quite nice for hacking purposes, as they&#8217;ve left the uBoot in a nice state, and have easily accessible debug ports. Second is that doing this kind of thing isn&#8217;t really that complicated, and can be quite fun. We&#8217;re pretty [...]]]></description>
			<content:encoded><![CDATA[<p>So far in this series, we&#8217;ve learnt a few things.<br />
First, is that this hardware is quite nice for hacking purposes, as they&#8217;ve left the uBoot in a nice state, and have easily accessible debug ports.<br />
Second is that doing this kind of thing isn&#8217;t really that complicated, and can be quite fun.</p>
<p>We&#8217;re pretty much ready to start doing our own coding, as we know how the images are packed, and we can use the uBoot to either flash onl the romfs on or own, or alternately roll a complete linux + romfs binary image.</p>
<p>For that, we&#8217;ll need to be ready to roll up our sleeves, and actually do some development (finally!).</p>
<p>Getting a development environment setup is our next step, as we&#8217;re ready to test out adding binaries.</p>
<p>I&#8217;m using Debian, but most Linux environments should be similar.  OSX is BSD based, and more of a pain due to Apple not putting everything needed in the normal places, so I&#8217;m doing this in a VM on my Macbook under Debian.</p>
<p>Go grab a copy of &#8220;NUC700 Series MCU uCLinux BSP.zip&#8221; from here <a href="http://www.metavert.com/public/NO-SUPPORT/">http://www.metavert.com/public/NO-SUPPORT/</a></p>
<p>Setup a VM for Debian (not going to cover that) or install Debian or similar.</p>
<p>Copy the zip file to /home in the OS you use.</p>
<p><code>cd /home<br />
mkdir N745<br />
cd N745<br />
unzip ../NUC700\ Series\ MCU\ uCLinux\ BSP.zip</code></p>
<p>You should now see something like this:</p>
<p><code>:/home/N745/NUC700 Series MCU uCLinux BSP# ls -al<br />
total 68<br />
drwxr-xr-x 6 root root  4096 2009-05-15 20:02 .<br />
drwxr-xr-x 3 root root  4096 2010-04-30 02:23 ..<br />
drwxr-xr-x 3 root root  4096 2009-05-15 20:06 bootloader<br />
drwxr-xr-x 2 root root  4096 2009-05-15 20:03 bsp<br />
drwxr-xr-x 2 root root  4096 2009-05-15 20:02 doc<br />
drwxr-xr-x 4 root root  4096 2009-05-15 20:02 mkrom<br />
-r--r--r-- 1 root root 44632 2009-03-27 11:49 NUC700 uClinux BSP Release Note.pdf<br />
debian:/home/N745/NUC700 Series MCU uCLinux BSP# </code></p>
<p>Unfortunately the build *really* doesn&#8217;t like long filenames, so lets move all this to the N745 folder, and get rid of the annoyingly named folder.</p>
<p><code><br />
/home/N745/NUC700 Series MCU uCLinux BSP# mv * ..<br />
/home/N745/# cd ..<br />
/home/N745/# rm -r NUC700\ Series\ MCU\ uCLinux\ BSP/<br />
</code></p>
<p>We still need to unzip the BSP, as its compressed, so go into bsp</p>
<p><code><br />
/home/N745/# cd bsp<br />
/home/N745/bsp# tar -xzvf NUC700BSP.tar.gz<br />
NUC700BSP/<br />
NUC700BSP/arm_tools.tar.gz<br />
NUC700BSP/install.sh<br />
NUC700BSP/arm_tools_3.3.tar.gz<br />
NUC700BSP/build.tar.gz<br />
NUC700BSP/applications.tar.gz<br />
NUC700BSP/uClinux-dist.tar.gz<br />
</code></p>
<p>Yay, yet another bloody subdirectory.  Sigh.</p>
<p><code><br />
/home/N745/bsp# cd NUC700BSP<br />
debian:/home/N745/bsp/NUC700BSP# ls -al<br />
total 183300<br />
drwxr-xr-x 2 shanghaiguide shanghaiguide     4096 2009-03-26 22:38 .<br />
drwxr-xr-x 3 root          root              4096 2010-04-30 02:29 ..<br />
-rw-r--r-- 1 shanghaiguide shanghaiguide 29521418 2009-03-26 21:55 applications.tar.gz<br />
-rw-r--r-- 1 shanghaiguide shanghaiguide 43742203 2009-03-26 21:22 arm_tools_3.3.tar.gz<br />
-rw-r--r-- 1 shanghaiguide shanghaiguide 36108739 2009-03-26 21:11 arm_tools.tar.gz<br />
-rw-r--r-- 1 shanghaiguide shanghaiguide  5643452 2009-03-26 21:24 build.tar.gz<br />
-rwxr--r-- 1 shanghaiguide shanghaiguide     4370 2009-03-26 22:31 install.sh<br />
-rw-r--r-- 1 shanghaiguide shanghaiguide 72439431 2009-03-26 20:53 uClinux-dist.tar.gz<br />
debian:/home/N745/bsp/NUC700BSP#<br />
</code></p>
<p>Run the install &#8211; I&#8217;ve decided to install the whole shebang to /home/N745</p>
<blockquote><p>Note &#8211; The observant amongst you will notice I&#8217;m running this as root.<br />
This is <strong>NOT</strong> recommended.  I&#8217;m running under a VM solely created to play with this, so I don&#8217;t really care if I break it (as I can roll back to the initial install image fairly easy in vmware).  Don&#8217;t do this yourselves (unless you want to break things). </p></blockquote>
<p><code><br />
debian:/home/N745/bsp/NUC700BSP# ./install.sh<br />
firstly install arm_tools.tar.gz -->/usr/local/<br />
wait for a while<br />
successfully finished installing arm_tools.tar.gz<br />
now begin to install build.tar.gz,applications.tar.gz and uClinux-dist.tar.gz<br />
Please enter your absolute path for installing build.tar.gz, applications.tar.gz and uClinux-dist.tar.gz:<br />
/home/N745<br />
/home/N745 has existed<br />
please wait for a while, it will take some time<br />
whole installation finished successfully!<br />
debian:/home/N745/bsp/NUC700BSP#<br />
</code></p>
<p>We finally have our build environment unzipped, and its sitting in nuc700-uClinux.</p>
<p><code>debian:/home/N745# cd nuc700-uClinux/<br />
debian:/home/N745/nuc700-uClinux# ls -al<br />
total 24<br />
drwxr-xr-x  6 root root 4096 2010-04-30 02:31 .<br />
drwxr-xr-x  7 root root 4096 2010-04-30 02:31 ..<br />
drwxr-xr-x  7 root root 4096 2009-03-25 00:44 applications<br />
drwxr-xr-x  2 root root 4096 2009-03-26 21:23 image<br />
drwxr-xr-x 12 root root 4096 2009-03-26 04:54 romdisk<br />
drwxr-xr-x 10 root root 4096 2009-03-26 06:50 uClinux-dist<br />
debian:/home/N745/nuc700-uClinux# </code></p>
<p>uClinux-dist has the default binaries we want, plus we need to configure the kernel, so lets visit there first (the more adventurous can look at the other folders)</p>
<p><code><br />
debian:/home/N745/nuc700-uClinux# cd uClinux-dist/<br />
debian:/home/N745/nuc700-uClinux/uClinux-dist# ls -al<br />
total 84<br />
drwxr-xr-x  10 root root  4096 2009-03-26 06:50 .<br />
drwxr-xr-x   6 root root  4096 2010-04-30 02:31 ..<br />
drwxr-xr-x   2 root root  4096 2009-01-22 23:27 bin<br />
drwxr-xr-x   3 root root  4096 2009-03-26 06:50 config<br />
-rw-r--r--   1 root root 18007 2009-01-22 23:29 COPYING<br />
drwxr-xr-x   3 root root  4096 2009-01-22 23:27 Documentation<br />
drwxr-xr-x  11 root root  4096 2009-01-22 23:29 freeswan<br />
drwxr-xr-x   5 root root  4096 2009-01-22 23:29 lib<br />
drwxr-xr-x  15 root root  4096 2009-03-26 06:50 linux-2.4.x<br />
-rw-r--r--   1 root root  3228 2009-01-22 23:28 MAINTAINERS<br />
-rw-r--r--   1 root root  7977 2009-01-22 23:27 Makefile<br />
-rw-r--r--   1 root root  4935 2009-01-22 23:29 README<br />
-rw-r--r--   1 root root  1654 2009-01-22 23:29 SOURCE<br />
drwxr-xr-x 158 root root  4096 2009-01-22 23:28 user<br />
drwxr-xr-x   4 root root  4096 2009-03-12 03:54 vendors<br />
debian:/home/N745/nuc700-uClinux/uClinux-dist#<br />
</code></p>
<p>Looks like it should be fairly easy, right?<br />
Wrong.</p>
<p>The default build doesn&#8217;t work.   Why would it be that easy.</p>
<p>You&#8217;ll end up with issues like:</p>
<blockquote><p>entry-armv.S:782: Error: Internal_relocation (type 210) not fixed up<br />
(OFFSET_IMM)<br />
entry-armv.S:784: Error: Internal_relocation (type 208) not fixed up<br />
(IMMEDIATE)
</p></blockquote>
<p>So, we need to make sure we start off fresh.<br />
Also, note that we&#8217;re building for an N745 cpu, so we&#8217;ll need to configure that at the make config stage.<br />
Lastly, and <strong>EXTREMELY</strong> important, is that we&#8217;ll need to put our required tools in the path.</p>
<p><strong>DO NOT FORGET TO DO THIS</strong><br />
sample PATH below:</p>
<p>PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/arm_tools/bin</p>
<p><code><br />
debian:/home/N745/nuc700-uClinux/uClinux-dist# PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/arm_tools/bin</p>
<p>debian:/home/N745/nuc700-uClinux/uClinux-dist#make clean</p>
<blockquote><p>Now we have a choice - Recommend use make xconfig if possible.<br />
You need to  have a GUI, and have tk installed.  (apt-get install tk)<br />
Otherwise run make config, and run through the tediously large amount of questions</p></blockquote>
<p><strong>OPTION#preferred</strong></p>
<p>debian:/home/N745/nuc700-uClinux/uClinux-dist#make xconfig     </p>
<p><strong>OPTION#not recommended</strong></p>
<p>debian:/home/N745/nuc700-uClinux/uClinux-dist# make config<br />
config/mkconfig > config.in<br />
#<br />
# No defaults found<br />
#<br />
*<br />
* Target Platform Selection<br />
*<br />
*<br />
* Choose a Vendor/Product combination.<br />
*<br />
Vendor/Product (nuvoton/nuc710, nuvoton/nuc740, nuvoton/nuc745) [nuvoton/nuc710] (NEW) nuvoton/nuc745</p>
<p>[For the rest, I used the defaults (except for the Network Tools questions, which I said Y to all)]</p>
<blockquote><p>Continue here from whatever menu (x)config you used.</p></blockquote>
<p>debian:/home/N745/nuc700-uClinux/uClinux-dist#make oldconfig</p>
<p>[Needed, or compile doesn't work]</p>
<p>debian:/home/N745/nuc700-uClinux/uClinux-dist#make dep</p>
<p>[A gazillion pages of info later, we have a build environment!]<br />
</code></p>
<p>We&#8217;re finally ready to use our weapon of mass destruction.</p>
<p><code><br />
debian:/home/N745/nuc700-uClinux/uClinux-dist#make<br />
...</p>
<p></code></p>
<p>It should compile without issue.  </p>
<p>Next step is to mount our created rom image, and copy the binaries off, or just go to the compiled folders, and get the binaries.</p>
<p>I&#8217;ve done this step already, and have a zip file of a few useful files ready.</p>
<p>-rwxr-xr-x  1 root root  110888 2010-04-30 03:50 ftpd<br />
-rwxr-xr-x  1 root root   55164 2010-04-30 03:52 ping<br />
-rwxr-xr-x  1 root root 1201904 2010-04-30 03:51 ssh<br />
-rwxr-xr-x  1 root root 1219864 2010-04-30 03:51 sshd<br />
-rwxr-xr-x  1 root root  118004 2010-04-30 03:45 telnet<br />
-rwxr-xr-x  1 root root   45460 2010-04-30 03:45 telnetd</p>
<p> file *<br />
ftpd:    BFLT executable &#8211; version 4 ram<br />
ping:    BFLT executable &#8211; version 4 ram<br />
ssh:     BFLT executable &#8211; version 4 ram<br />
sshd:    BFLT executable &#8211; version 4 ram<br />
telnet:  BFLT executable &#8211; version 4 ram<br />
telnetd: BFLT executable &#8211; version 4 ram</p>
<p>Download that here &#8211; <a href='http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/arm7-nettools.zip'>arm7-nettools</a></p>
<p>All we need to do now is mount our romfs image, unzip the arm7-nettools.zip, copy the arm7 bFLT binaries over to bin, add telnetd, sshd, and  ftpd to our /bin/init, and rebuild by running genromfs on our filesystem.</p>
<p>We can then finally flash our new romfs, and test it out.</p>
<blockquote><p>
Don&#8217;t forget that romfs is a read only file system, so we can&#8217;t modify it by mounting it.  We need to mount, copying everything to elsewhere, do our required bits and pieces, then rebuild.</p>
<p>eg</p>
<p>mount -o loop -t romfs still_unsure.img /mnt/test -r</p>
<p>mkdir /mnt/new<br />
cd /mnt<br />
rsync -arv /mnt/test/ new<br />
cd new/bin<br />
wget http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/arm7-nettools.zip<br />
unzip arm7-nettools.zip<br />
rm arm7-nettools.zip</p>
<p>[We need to also edit init]<br />
pico init</p>
<p>Add </p>
<p>sshd&#038;<br />
telnetd&#038;<br />
ftpd&#038;</p>
<p>eg &#8211;<br />
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 />
sshd&#038;<br />
telnetd&#038;<br />
ftpd&#038;<br />
sh</p>
<p>Change to the next directory up, and lets run genromfs</p>
<p> genromfs -d new -f testrom.img<br />
debian:/mnt# ls testrom.img<br />
testrom.img<br />
debian:/mnt# ls -al testrom.img<br />
-rw-r&#8211;r&#8211; 1 root root 3329024 2010-04-30 04:18 testrom.img</p>
<p>In theory, this should be usable (famous last words!).
</p></blockquote>
<p>Unfortunately, I can&#8217;t try testing on that at home, as all the equipment is at the office, but that should be fairly easy.</p>
<p>Probably also some small config issues to sort out, as ftpd, telnetd and sshd will probably choke without their related /etc/whatever config files needed, but we can sort that out via serial on the debug ports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt5/feed/</wfw:commentRss>
		<slash:comments>14</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>IP Cam Hacking – pt#3</title>
		<link>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ip-cam-hacking-pt3</link>
		<comments>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt3/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 07:43:41 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[ipcam]]></category>
		<category><![CDATA[nc745]]></category>
		<category><![CDATA[nuvoton]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=468</guid>
		<description><![CDATA[I&#8217;ve finally received my 2nd camera, so I can now start working properly on it (assuming I get some free time too!) High resolution photos of the board are below: Main parts used are: RAM &#8211; Winbond W9812G61H-6 (2M) According to the data sheet, that 2M X 4 BANKS X 16 BITS SDRAM @ 3.3V [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally received my 2nd camera, so I can now start working properly on it (assuming I get some free time too!)</p>
<p>High resolution photos of the board are below:</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_underside.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_underside-300x200.jpg" alt="" title="ipcam_underside" width="300" height="200" class="aligncenter size-medium wp-image-471" /></a></p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_topside.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_topside-300x200.jpg" alt="" title="ipcam_topside" width="300" height="200" class="aligncenter size-medium wp-image-470" /></a></p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_wifi_daughter_board.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/ipcam_wifi_daughter_board-300x200.jpg" alt="" title="ipcam_wifi_daughter_board" width="300" height="200" class="aligncenter size-medium wp-image-469" /></a></p>
<p>Main parts used are:</p>
<p><strong>RAM &#8211;  Winbond W9812G61H-6 (2M)</strong><br />
According to the data sheet, that 2M X 4 BANKS X 16 BITS SDRAM @ 3.3V / 166MHz/CL3<br />
Data sheet is here &#8211; <a href="http://jp.ic-on-line.cn/IOL/datasheet/w9812g6ih_4223255.pdf">http://jp.ic-on-line.cn/IOL/datasheet/w9812g6ih_4223255.pdf</a></p>
<p><strong>Flash &#8211; Spansion S29AL016D (2M)</strong><br />
Other boards are populated with different providers &#8211; some people have Samsung flash&#8230;<br />
Mine has the Spansion onboard both units.  Its programmable onboard (via the uBoot)<br />
Data sheet here &#8211; <a href="http://www.datasheetpro.com/259722_view_S29AL016D_datasheet.html">http://www.datasheetpro.com/259722_view_S29AL016D_datasheet.html</a></p>
<p><strong>Sound Card &#8211; ALC203</strong><br />
This is obviously used as the BSP for the Novotel provides sample code for that card, making their life easier&#8230;<br />
Data sheet here &#8211; <a href="http://realtek.info/pdf/alc203.pdf">http://realtek.info/pdf/alc203.pdf</a></p>
<p><strong>Wired Ethernet &#8211; Davicom DM9161AEP (10/100 Ethernet)</strong><br />
Data sheet here &#8211;<br />
<a href="http://www.davicom.com.tw/userfile/24247/DM9161AEPProductBrief_v1.0.pdf">http://www.davicom.com.tw/userfile/24247/DM9161AEPProductBrief_v1.0.pdf</a></p>
<p><strong>8 Port Relay Driver (for the motors etc) &#8211; ULN2803</strong><br />
Data sheet here  &#8211; <a href="http://www.rentron.com/Files/uln2803.pdf">http://www.rentron.com/Files/uln2803.pdf</a><br />
More info / explanation here &#8211; <a href="http://wiki.answers.com/Q/What_is_Relay_driver_ULN2803">http://wiki.answers.com/Q/What_is_Relay_driver_ULN2803</a></p>
<p><strong>Wifi &#8211; RALINK 2571 (on daughterboard).  Wireless G </strong><br />
This is a USB based chipset, so we&#8217;re using 4 usb connector pins for this one.<br />
No datasheet, as Ralink are dicks.</p>
<p><strong>CPU &#8211; ARM7 N745CDG (Arm 7 by Nuvoton)</strong><br />
Lot of info for chip available at Nuvoton. </p>
<p>W90N745 makes use of the ARM7TDMI microprocessor core of ARMR and 0.18um production to achieve standard operation at 80MHz. 128-Pin LQPF packing is also used to save electricity and lower costs. The built-in 4KBytes I-Cache and 4KBytes D-Cache of W90N745 can also be set as On-Chip RAM according to the needs of product developers. With regards to system integration, W90N745 is suitable for network-related applications such as management switch, IP cameras, VoIP and printer servers.<br />
Features<br />
    * One Ethernet MAC<br />
    * One USB 2.0 full speed Host controller<br />
    * One USB 2.0 full speed Host/Device controller<br />
    * AC97/I2S<br />
    * 4 UARTs<br />
    * I²C Master<br />
    * 31 GPIOs<br />
    * Power Management</p>
<p>Data sheets &#8211; <a href="http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller/NUC745A.htm">http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller/NUC745A.htm</a><br />
The uclinux sample distribution and files can be downloaded here &#8211; <a href="http://www.metavert.com/public/NO-SUPPORT/NUC700%20Series%20MCU%20uCLinux%20BSP.zip">http://www.metavert.com/public/NO-SUPPORT/NUC700%20Series%20MCU%20uCLinux%20BSP.zip</a></p>
<p>I&#8217;m just waiting on a JLINK USB adaptor, then I&#8217;m ready to roll.</p>
<p>[Updates]</p>
<p>David M from comments at <a href="http://irishjesus.wordpress.com/2010/03/30/hacking-the-foscam-fi8908w/#comments">http://irishjesus.wordpress.com/2010/03/30/hacking-the-foscam-fi8908w/#comments</a> provided his rom sizing from his device, I&#8217;ve got some notes on that here.</p>
<p>MAC Address : 00:30:10:C1:D0:39<br />
IP Address : 0.0.0.0<br />
DHCP Client : Enabled<br />
CACHE : Enabled<br />
BL buffer base : 0×00300000<br />
BL buffer size : 0×00100000<br />
Baud Rate : -1<br />
USB Interface : Disabled<br />
Serial Number : 0xFFFFFFFF</p>
<p>For help on the available commands type ‘h’</p>
<p>Press ESC to enter debug mode …</p>
<p>bootloader > ls<br />
Image: 0 name:BOOT INFO base:0x7F010000 size:0×00000038 exec:0x7F010000 -af<br />
Image: 7 name:linux.bin base:0x7F020000 size:0x000BB334 exec:0×00008000 -acxz<br />
Image: 6 name:romfs.img base:0x7F0E0000 size:0x0008D000 exec:0x7F0E0000 -a</p>
<p>My notes:</p>
<p>Image: 0 name:BOOT INFO base:0x7F010000 size:0×00000038 exec:0x7F010000 -af</p>
<p>[Image 0 is 38 bytes (small!).<br />
Boot info is not the bootloader - 38bytes is way too small for that.<br />
It actually stores our bootloader config settings.<br />
eg ip address, cache setting, boot loader buffer address etc.<br />
Our initial settings are below:</p>
<p>MAC Address : 00:30:10:C1:D0:39 (should be changed, this Mac range belongs to Cisco!)<br />
IP Address : 0.0.0.0 (unset)<br />
DHCP Client : Enabled  (pulls ip from dhcp..)<br />
CACHE : Enabled (onboard chip cache)<br />
BL buffer base : 0×00300000<br />
BL buffer size : 0×00100000<br />
Baud Rate : -1 (unset / so defaults to 115,200,8,n,1)<br />
USB Interface : Disabled (NC745 has no USB for bootloader)<br />
Serial Number : 0xFFFFFFFF (unset)</p>
<p>-af indicates Active (a) , and is a Filesystem image (f)]</p>
<p>Image: 7 name:linux.bin base:0x7F020000 size:0x000BB334 exec:0×00008000 -acxz<br />
[Image 7 is our OS - Linux 2.4.20 ucLinux  Not sure why Maverick didn't build on 2.6, there is more hardware support.  Probably time dependant - 2.6 may not have been available, plus the Nuvoton sample code is also 2.4 based...</p>
<p>-axcz says  active (a)  executable (x) copied to ram (c) compressed (z)  ]</p>
<p>Image: 6 name:romfs.img base:0x7F0E0000 size:0x0008D000 exec:0x7F0E0000 -a</p>
<p>[Our rom image - aka userland stuff.  This is where we'll be putting our own code.  Looks like its stuck quite high up in the flash, although doesn't need to be given size of the Linux rom.  We have plenty of room available.</p>
<p>We'll need to make appropriate changes to Image 6 size on flashing</p>
<p>-a says active partition.]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>IPCam Hacking &#8211; pt#2</title>
		<link>http://www.computersolutions.cn/blog/2010/04/ipcam-hacking-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ipcam-hacking-part-2</link>
		<comments>http://www.computersolutions.cn/blog/2010/04/ipcam-hacking-part-2/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 16:23:20 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[IP Cam]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[arm5]]></category>
		<category><![CDATA[arm7]]></category>
		<category><![CDATA[f8908w]]></category>
		<category><![CDATA[foscam]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[ipcam]]></category>
		<category><![CDATA[uclinux]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=455</guid>
		<description><![CDATA[Finally got a chance to play around with the second ipcam I bought. This one is a little bit smarter than the previous one &#8211; its running off an ARM5ARM7 CPU (Nuvoton NUC745ADN), so has a bit more oomph. 16M ram is a whole lot more to play with for a start! The last device [...]]]></description>
			<content:encoded><![CDATA[<p>Finally got a chance to play around with the second ipcam I bought.</p>
<p>This one is a little bit smarter than the previous one &#8211; its running off an <del datetime="2010-04-21T03:02:29+00:00">ARM5</del>ARM7 CPU (Nuvoton NUC745ADN), so has a bit more oomph.  16M ram is a whole lot more to play with for a start!  The last device only had 16KB, so this puppy can be taught to do some tricks!</p>
<p>Serial was a little bit trickier to solder on this time &#8211; my initial connectors were too small, so had to resolder with larger ones, and I managed to mess up a tad.  Never said my soldering was any good <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Getting it to talk to the computer was a bit painful too &#8211; eventually I settled on 115,200 8,n,1, xon/xoff which should have worked the first time around, but I was getting garbage.</p>
<p>Probably flow control (xon/xoff), as fiddling with the connections got it going eventually.</p>
<p>First output from the board is below &#8211; this is from a clean boot (with no ethernet or wifi).</p>
<p><code><br />
W90P745 Boot Loader [ Version 1.1 $Revision: 1 $ ] Rebuilt on Dec 10 2009<br />
Memory Size is 0x1000000 Bytes, Flash Size is 0x200000 Bytes<br />
Board designed by Winbond<br />
Hardware support provided at Winbond<br />
Copyright (c) Winbond Limited 2001 - 2006. All rights reserved.<br />
Boot Loader Configuration:</p>
<p>        MAC Address         : 0E:F2:B3:DC:08:05<br />
        IP Address          : 0.0.0.0<br />
        DHCP Client         : Enabled<br />
        CACHE               : Enabled<br />
        BL buffer base      : 0x00300000<br />
        BL buffer size      : 0x00100000<br />
        Baud Rate           : -1<br />
        USB Interface       : Disabled<br />
        Serial Number       : 0xFFFFFFFF</p>
<p>For help on the available commands type 'h'</p>
<p>Press ESC to enter debug mode ......<br />
Cache enabled!<br />
Processing image 1 ...<br />
Processing image 2 ...<br />
Processing image 3 ...<br />
Processing image 4 ...<br />
Processing image 5 ...<br />
Processing image 6 ...<br />
Processing image 7 ...<br />
Unzip image 7 ...<br />
Executing image 7 ...<br />
Linux version 2.4.20-uc0 (root@maverick-linux) (gcc version 3.0) #1013 Èý 12ÔÂ 2 13:17:32 CST 2009<br />
Processor: Winbond W90N745 revision 1<br />
Architecture: W90N745<br />
On node 0 totalpages: 4096<br />
zone(0): 0 pages.<br />
zone(1): 4096 pages.<br />
zone(2): 0 pages.<br />
Kernel command line: root=/dev/rom0 rw<br />
Calibrating delay loop... 39.83 BogoMIPS<br />
Memory: 16MB = 16MB total<br />
Memory: 14376KB available (1435K code, 288K data, 40K init)<br />
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)<br />
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)<br />
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)<br />
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)<br />
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)<br />
POSIX conformance testing by UNIFIX<br />
Linux NET4.0 for Linux 2.4<br />
Based upon Swansea University Computer Society NET3.039<br />
Initializing RT netlink socket<br />
Starting kswapd<br />
Winbond W90N745 Serial driver version 1.0 (2005-08-15) with no serial options enabled<br />
ttyS00 at 0xfff80000 (irq = 9) is a W90N745<br />
Winbond W90N7451 Serial driver version 1.0 (2005-08-15) with no serial options enabled<br />
ttyS00 at 0xfff80100 (irq = 10) is a W90N7451<br />
I2C Bus Driver has been installed successfully.<br />
Blkmem copyright 1998,1999 D. Jeff Dionne<br />
Blkmem copyright 1998 Kenneth Albanowski<br />
Blkmem 1 disk images:<br />
0: 7F0E0000-7F16D3FF [VIRTUAL 7F0E0000-7F16D3FF] (RO)<br />
AM29LV160DB Flash Detected<br />
01 eth0 initial ok!<br />
which:0<br />
PPP generic driver version 2.4.2<br />
Linux video capture interface: v1.00<br />
Winbond Audio Driver v1.0 Initialization successfully.<br />
usb.c: registered new driver hub<br />
add a static ohci host controller device<br />
: USB OHCI at membase 0xfff05000, IRQ 15<br />
hc_alloc_ohci<br />
usb-ohci.c: AMD756 erratum 4 workaround<br />
hc_reset<br />
usb.c: new USB bus registered, assigned bus number 1<br />
hub.c: USB hub found<br />
hub.c: 2 ports detected<br />
usb.c: registered new driver audio<br />
audio.c: v1.0.0:USB Audio Class driver<br />
usb.c: registered new driver serial<br />
usbserial.c: USB Serial Driver core v1.4</p>
<p> _____     ____    _    ____<br />
|__  /   _|  _ \  / \  / ___|<br />
  / / | | | | | |/ _ \ \___ \<br />
 / /| |_| | |_| / ___ \ ___) |<br />
/____\__, |____/_/   \_\____/<br />
     |___/<br />
ZD1211B - version 2.24.0.0<br />
usb.c: registered new driver zd1211b<br />
main_usb.c: VIA Networking Wireless LAN USB Driver 1.13<br />
usb.c: registered new driver vntwusb<br />
usb.c: registered new driver rt73<br />
dvm usb cam driver 0.0.0.0 by Maverick Gao in 2006-8-12<br />
usb.c: registered new driver dvm<br />
dvm usb cam driver 0.1 for sonix288 by Maverick Gao in 2009-4-20<br />
usb.c: registered new driver dvm usb cam driver for sonix288<br />
NET4: Linux TCP/IP 1.0 for NET4.0<br />
IP Protocols: ICMP, UDP, TCP<br />
IP: routing cache hash table of 512 buckets, 4Kbytes<br />
TCP: Hash tables configured (established 1024 bind 2048)<br />
VFS: Mounted root (romfs filesystem) readonly.<br />
Freeing init memory: 40K<br />
BINFMT_FLAT: bad magic/rev (0x74202d74, need 0x4)<br />
BINFMT_FLAT: bad magic/rev (0x74202d74, need 0x4)<br />
Shell invoked to run file: /bin/init<br />
Command: mount -t proc none /proc<br />
Command: mount -t ramfs none /usr<br />
Command: mount -t ramfs none /swap<br />
Command: mount -t ramfs none /var/run<br />
Command: mount -t ramfs none /etc<br />
Command: mount -t ramfs none /flash<br />
Command: mount -t ramfs none /home<br />
Command: camera&#038;<br />
[8]<br />
Command: sh<br />
no support</p>
<p>Sash command shell (version 1.1.1)<br />
/> hub.c: connect-debounce failed, port 1 disabled<br />
new USB device :80fd7e04-fed640<br />
hub.c: new USB device 1, assigned address 2<br />
dvm cmos successfully initialized<br />
dvm camera registered as video0<br />
new USB device :80fb0204-fed640<br />
hub.c: new USB device 2, assigned address 3<br />
idVendor = 0x148f, idProduct = 0x2573</p>
<p>Wait for auto-negotiation complete...ResetPhyChip Failed<br />
video0 opened<br />
1<br />
1<br />
1<br />
1<br />
1<br />
1<br />
set resolution 5<br />
set brightness 144<br />
set contrast 3<br />
set sharpness 3<br />
set mode 2<br />
__pthread_initial_thread_bos:34c000<br />
manage pid:16<br />
audio_dev.state not AU_STATE_RECORDING<br />
wb_audio_start_record<br />
=> usb_rtusb_open<br />
retide_ddns.c: can not get server dns.camcctv.com ip<br />
ntpc.c: can not resolve ntpserver(time.nist.gov)'s ip<br />
get oray info<br />
upnp get ip error<br />
inet_sr.c INET_rinput 321<br />
action===1<br />
options==33<br />
inet_sr.c INET_setroute 75<br />
*args===255.255.255.255<br />
*args===netmask<br />
*args===eth1<br />
inet_sr.c INET_rinput 321<br />
action===1<br />
options==33<br />
inet_sr.c INET_setroute 75<br />
*args===default<br />
*args===gw<br />
*args===eth1<br />
MlmeAssocReqAction(): WPA2/WPA2PSK fill the ReqVarIEs with CipherTmp!<br />
3<br />
3<br />
3<br />
3<br />
3<br />
3<br />
</code></p>
<p>Initially I had the board setup on its own without the camera attached, but the boot scripts require it connected, otherwise they reboot..<br />
Ostensibly, this is the same hardware as the fi8908w (who are just reselling the OEM version with marginally different firmware as far as I can tell).</p>
<p>Next step is to setup a cross compiler for uclinux so I can make some binaries, and test.<br />
Luckily all the available tools are open source / free.  Yay!</p>
<p>I&#8217;m in contact with the factory, and they&#8217;ll be sending an SDK over at some point soonish, although its only in Chinese.<br />
Luckily for me, that shouldn&#8217;t be a problem, as i&#8217;m reasonably capable at groking both code, and simplified chinese <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ucLinux should be easy enough to build a rom image for though &#8211; tons of examples, and I already have a few firmware files to compare.  </p>
<p>It shouldn&#8217;t be too hard for me to roll another firmware with ssh installed, so that we can get in without serial, that would be more useful for others too.</p>
<p>I&#8217;ve had a quick look inside the folders in the device from the device itself &#8211; fairly minimal, pretty much the only binaries are the necessary ones.<br />
My initial aim is to redo the UI to a nicer one, and fix some of the more glaring bugs.    The factory people are at a trade show in Taiwan this week, so hopefully next week I&#8217;ll get some dev tools (otherwise its reverse engineering, bleh&#8230;).  </p>
<p> <a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/IMG_9149.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/IMG_9149-300x200.jpg" alt="" title="IMG_9149" width="300" height="200" class="alignnone size-medium wp-image-457" /></a></p>
<p>Some more people are playing with these as well (links below):</p>
<p><a href="http://irishjesus.wordpress.com/2010/03/30/hacking-the-foscam-fi8908w/">http://irishjesus.wordpress.com/2010/03/30/hacking-the-foscam-fi8908w/</a></p>
<p><a href="http://www.gadgetvictims.com/2009/12/bring-your-fi8908w-paperweight-back-to.html"></p>
<p>http://www.gadgetvictims.com/2009/12/bring-your-fi8908w-paperweight-back-to.html</a></p>
<p>Unfortuanately for me, both are variably accessible.  WordPress is available this week woohoo, but its an on / off dealio with the GFW&#8230;, so I might have to stop commenting there once the government decides if WordPress is &#8220;teh evil&#8221; again.</p>
<p>The irishjesus blog guy has done some of the harder bits like file extraction already (although not strictly necessary, as there are existing tools for that kind of thing).</p>
<p>&#8212;</p>
<p><strong>Updates</strong></p>
<p>Have some docs from the factory now, see attached file for the CGI spec.</p>
<p><a href='http://www.computersolutions.cn/blog/wp-content/uploads/2010/04/IP-Camera-CGI-应用指南-1.11.pdf'>IP Camera CGI 应用指南-1.11</a></p>
<p>I have others, but not so relevant especially for those than don&#8217;t read Chinese!</p>
<p>Data sheet for the Chip and build instructions here -</p>
<p><a href="http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller/NUC745A.htm">http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller/NUC745A.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/04/ipcam-hacking-part-2/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

