{"id":455,"date":"2010-04-21T00:23:20","date_gmt":"2010-04-20T16:23:20","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=455"},"modified":"2011-10-31T03:40:45","modified_gmt":"2011-10-30T19:40:45","slug":"ipcam-hacking-part-2","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2010\/04\/ipcam-hacking-part-2\/","title":{"rendered":"IPCam Hacking &#8211; pt#2"},"content":{"rendered":"<p>Finally got a chance to play around with the second ipcam I bought.<\/p>\n<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>\n<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 \ud83d\ude09<br \/>\nGetting 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>\n<p>Probably flow control (xon\/xoff), as fiddling with the connections got it going eventually.<\/p>\n<p>First output from the board is below &#8211; this is from a clean boot (with no ethernet or wifi).<\/p>\n<p><code><br \/>\nW90P745 Boot Loader [ Version 1.1 $Revision: 1 $ ] Rebuilt on Dec 10 2009<br \/>\nMemory Size is 0x1000000 Bytes, Flash Size is 0x200000 Bytes<br \/>\nBoard designed by Winbond<br \/>\nHardware support provided at Winbond<br \/>\nCopyright (c) Winbond Limited 2001 - 2006. All rights reserved.<br \/>\nBoot Loader Configuration:<\/p>\n<p>        MAC Address         : 0E:F2:B3:DC:08:05<br \/>\n        IP Address          : 0.0.0.0<br \/>\n        DHCP Client         : Enabled<br \/>\n        CACHE               : Enabled<br \/>\n        BL buffer base      : 0x00300000<br \/>\n        BL buffer size      : 0x00100000<br \/>\n        Baud Rate           : -1<br \/>\n        USB Interface       : Disabled<br \/>\n        Serial Number       : 0xFFFFFFFF<\/p>\n<p>For help on the available commands type 'h'<\/p>\n<p>Press ESC to enter debug mode ......<br \/>\nCache enabled!<br \/>\nProcessing image 1 ...<br \/>\nProcessing image 2 ...<br \/>\nProcessing image 3 ...<br \/>\nProcessing image 4 ...<br \/>\nProcessing image 5 ...<br \/>\nProcessing image 6 ...<br \/>\nProcessing image 7 ...<br \/>\nUnzip image 7 ...<br \/>\nExecuting image 7 ...<br \/>\nLinux version 2.4.20-uc0 (root@maverick-linux) (gcc version 3.0) #1013 \u00c8\u00fd 12\u00d4\u00c2 2 13:17:32 CST 2009<br \/>\nProcessor: Winbond W90N745 revision 1<br \/>\nArchitecture: W90N745<br \/>\nOn node 0 totalpages: 4096<br \/>\nzone(0): 0 pages.<br \/>\nzone(1): 4096 pages.<br \/>\nzone(2): 0 pages.<br \/>\nKernel command line: root=\/dev\/rom0 rw<br \/>\nCalibrating delay loop... 39.83 BogoMIPS<br \/>\nMemory: 16MB = 16MB total<br \/>\nMemory: 14376KB available (1435K code, 288K data, 40K init)<br \/>\nDentry cache hash table entries: 2048 (order: 2, 16384 bytes)<br \/>\nInode cache hash table entries: 1024 (order: 1, 8192 bytes)<br \/>\nMount-cache hash table entries: 512 (order: 0, 4096 bytes)<br \/>\nBuffer-cache hash table entries: 1024 (order: 0, 4096 bytes)<br \/>\nPage-cache hash table entries: 4096 (order: 2, 16384 bytes)<br \/>\nPOSIX conformance testing by UNIFIX<br \/>\nLinux NET4.0 for Linux 2.4<br \/>\nBased upon Swansea University Computer Society NET3.039<br \/>\nInitializing RT netlink socket<br \/>\nStarting kswapd<br \/>\nWinbond W90N745 Serial driver version 1.0 (2005-08-15) with no serial options enabled<br \/>\nttyS00 at 0xfff80000 (irq = 9) is a W90N745<br \/>\nWinbond W90N7451 Serial driver version 1.0 (2005-08-15) with no serial options enabled<br \/>\nttyS00 at 0xfff80100 (irq = 10) is a W90N7451<br \/>\nI2C Bus Driver has been installed successfully.<br \/>\nBlkmem copyright 1998,1999 D. Jeff Dionne<br \/>\nBlkmem copyright 1998 Kenneth Albanowski<br \/>\nBlkmem 1 disk images:<br \/>\n0: 7F0E0000-7F16D3FF [VIRTUAL 7F0E0000-7F16D3FF] (RO)<br \/>\nAM29LV160DB Flash Detected<br \/>\n01 eth0 initial ok!<br \/>\nwhich:0<br \/>\nPPP generic driver version 2.4.2<br \/>\nLinux video capture interface: v1.00<br \/>\nWinbond Audio Driver v1.0 Initialization successfully.<br \/>\nusb.c: registered new driver hub<br \/>\nadd a static ohci host controller device<br \/>\n: USB OHCI at membase 0xfff05000, IRQ 15<br \/>\nhc_alloc_ohci<br \/>\nusb-ohci.c: AMD756 erratum 4 workaround<br \/>\nhc_reset<br \/>\nusb.c: new USB bus registered, assigned bus number 1<br \/>\nhub.c: USB hub found<br \/>\nhub.c: 2 ports detected<br \/>\nusb.c: registered new driver audio<br \/>\naudio.c: v1.0.0:USB Audio Class driver<br \/>\nusb.c: registered new driver serial<br \/>\nusbserial.c: USB Serial Driver core v1.4<\/p>\n<p> _____     ____    _    ____<br \/>\n|__  \/   _|  _ \\  \/ \\  \/ ___|<br \/>\n  \/ \/ | | | | | |\/ _ \\ \\___ \\<br \/>\n \/ \/| |_| | |_| \/ ___ \\ ___) |<br \/>\n\/____\\__, |____\/_\/   \\_\\____\/<br \/>\n     |___\/<br \/>\nZD1211B - version 2.24.0.0<br \/>\nusb.c: registered new driver zd1211b<br \/>\nmain_usb.c: VIA Networking Wireless LAN USB Driver 1.13<br \/>\nusb.c: registered new driver vntwusb<br \/>\nusb.c: registered new driver rt73<br \/>\ndvm usb cam driver 0.0.0.0 by Maverick Gao in 2006-8-12<br \/>\nusb.c: registered new driver dvm<br \/>\ndvm usb cam driver 0.1 for sonix288 by Maverick Gao in 2009-4-20<br \/>\nusb.c: registered new driver dvm usb cam driver for sonix288<br \/>\nNET4: Linux TCP\/IP 1.0 for NET4.0<br \/>\nIP Protocols: ICMP, UDP, TCP<br \/>\nIP: routing cache hash table of 512 buckets, 4Kbytes<br \/>\nTCP: Hash tables configured (established 1024 bind 2048)<br \/>\nVFS: Mounted root (romfs filesystem) readonly.<br \/>\nFreeing init memory: 40K<br \/>\nBINFMT_FLAT: bad magic\/rev (0x74202d74, need 0x4)<br \/>\nBINFMT_FLAT: bad magic\/rev (0x74202d74, need 0x4)<br \/>\nShell invoked to run file: \/bin\/init<br \/>\nCommand: mount -t proc none \/proc<br \/>\nCommand: mount -t ramfs none \/usr<br \/>\nCommand: mount -t ramfs none \/swap<br \/>\nCommand: mount -t ramfs none \/var\/run<br \/>\nCommand: mount -t ramfs none \/etc<br \/>\nCommand: mount -t ramfs none \/flash<br \/>\nCommand: mount -t ramfs none \/home<br \/>\nCommand: camera&<br \/>\n[8]<br \/>\nCommand: sh<br \/>\nno support<\/p>\n<p>Sash command shell (version 1.1.1)<br \/>\n\/> hub.c: connect-debounce failed, port 1 disabled<br \/>\nnew USB device :80fd7e04-fed640<br \/>\nhub.c: new USB device 1, assigned address 2<br \/>\ndvm cmos successfully initialized<br \/>\ndvm camera registered as video0<br \/>\nnew USB device :80fb0204-fed640<br \/>\nhub.c: new USB device 2, assigned address 3<br \/>\nidVendor = 0x148f, idProduct = 0x2573<\/p>\n<p>Wait for auto-negotiation complete...ResetPhyChip Failed<br \/>\nvideo0 opened<br \/>\n1<br \/>\n1<br \/>\n1<br \/>\n1<br \/>\n1<br \/>\n1<br \/>\nset resolution 5<br \/>\nset brightness 144<br \/>\nset contrast 3<br \/>\nset sharpness 3<br \/>\nset mode 2<br \/>\n__pthread_initial_thread_bos:34c000<br \/>\nmanage pid:16<br \/>\naudio_dev.state not AU_STATE_RECORDING<br \/>\nwb_audio_start_record<br \/>\n=> usb_rtusb_open<br \/>\nretide_ddns.c: can not get server dns.camcctv.com ip<br \/>\nntpc.c: can not resolve ntpserver(time.nist.gov)'s ip<br \/>\nget oray info<br \/>\nupnp get ip error<br \/>\ninet_sr.c INET_rinput 321<br \/>\naction===1<br \/>\noptions==33<br \/>\ninet_sr.c INET_setroute 75<br \/>\n*args===255.255.255.255<br \/>\n*args===netmask<br \/>\n*args===eth1<br \/>\ninet_sr.c INET_rinput 321<br \/>\naction===1<br \/>\noptions==33<br \/>\ninet_sr.c INET_setroute 75<br \/>\n*args===default<br \/>\n*args===gw<br \/>\n*args===eth1<br \/>\nMlmeAssocReqAction(): WPA2\/WPA2PSK fill the ReqVarIEs with CipherTmp!<br \/>\n3<br \/>\n3<br \/>\n3<br \/>\n3<br \/>\n3<br \/>\n3<br \/>\n<\/code><\/p>\n<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 \/>\nOstensibly, 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>\n<p>Next step is to setup a cross compiler for uclinux so I can make some binaries, and test.<br \/>\nLuckily all the available tools are open source \/ free.  Yay!<\/p>\n<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 \/>\nLuckily for me, that shouldn&#8217;t be a problem, as i&#8217;m reasonably capable at groking both code, and simplified chinese \ud83d\ude42<\/p>\n<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>\n<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>\n<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 \/>\nMy 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>\n<p> <a href=\"http:\/\/www.computersolutions.cn\/blog\/wp-content\/uploads\/2010\/04\/IMG_9149.jpg\"><img loading=\"lazy\" decoding=\"async\" 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\" srcset=\"https:\/\/www.computersolutions.cn\/blog\/wp-content\/uploads\/2010\/04\/IMG_9149-300x200.jpg 300w, https:\/\/www.computersolutions.cn\/blog\/wp-content\/uploads\/2010\/04\/IMG_9149-1024x682.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Some more people are playing with these as well (links below):<\/p>\n<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>\n<p><a href=\"http:\/\/www.gadgetvictims.com\/2009\/12\/bring-your-fi8908w-paperweight-back-to.html\"><br \/>\nhttp:\/\/www.gadgetvictims.com\/2009\/12\/bring-your-fi8908w-paperweight-back-to.html<\/a><\/p>\n<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>\n<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>\n<p>&#8212;<\/p>\n<p><strong>Updates<\/strong><\/p>\n<p>Have some docs from the factory now, see attached file for the CGI spec.<\/p>\n<p><a href='http:\/\/www.computersolutions.cn\/blog\/wp-content\/uploads\/2010\/04\/IP-Camera-CGI-\u5e94\u7528\u6307\u5357-1.11.pdf'>IP Camera CGI \u5e94\u7528\u6307\u5357-1.11<\/a><\/p>\n<p>I have others, but not so relevant especially for those than don&#8217;t read Chinese!<\/p>\n<p>Data sheet for the Chip and build instructions here &#8211;<\/p>\n<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>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[252,25],"tags":[246,248,244,245,241,240,247],"class_list":["post-455","post","type-post","status-publish","format-standard","hentry","category-ip-cam","category-technical-mumbo-jumbo","tag-arm5","tag-arm7","tag-f8908w","tag-foscam","tag-hacking","tag-ipcam","tag-uclinux"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":7,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":760,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions\/760"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}