News:

Registered a URL and setup a forum as the IPCam stuff really needed its own site vs my irregular blog posts about IPCam hacking at http://www.computersolutions.cn/blog

Author Topic: Getting FoscamCloneRecovery output into usable form??  (Read 7969 times)

  • *****
April 28, 2011, 09:36:45 pm
How do I get the linux.bin greated by FoscamCloneRecovery into a form where I can load it into my camera. The image created by FoscamCloneRecovery starts with:
Code: [Select]
$ hd -n 255 nc541w-linux.bin
00000000  50 4b 03 04 14 00 02 00  08 00 e5 43 86 3d 3b 98  |PK.........C.=;.|
00000010  2b 19 e8 fd 0b 00 30 8d  19 00 09 00 00 00 6c 69  |+.....0.......li|
00000020  6e 75 78 2e 62 69 6e ec  fd 7d 7c 54 47 bd 07 8e  |nux.bin..}|TG...|
00000030  cf d9 87 64 09 5b 38 79  ec 36 a4 72 80 b4 a6 34  |...d.[8y.6.r...4|
00000040  6d 0f 90 b6 14 d3 b2 14  5a 51 d0 2e 0f 6d 51 b1  |m.......ZQ...mQ.|
00000050  a6 2d ad a8 d4 a6 15 15  bd b4 dd 24 9b 90 62 a0  |.-.........$..b.|
00000060  01 c2 43 69 da ac 2d 7a  d1 8b 57 54 ea c5 8a de  |..Ci..-z..WT....|
00000070  2d 50 c5 4a 2d 5a d4 de  5a f5 ec 6e 8e 09 59 54  |-P.J-Z..Z..n..YT|
00000080  54 f4 62 6d bb df f7 7b  66 36 bb 49 a9 0f f7 de  |T.bm...{f6.I....|
00000090  ef f7 f7 c7 cf bc 18 66  cf 9c 39 f3 f8 99 cf d3  |.......f..9.....|
000000a0  7c e6 33 22 11 4f 3e 69  c6 d3 2f 88 78 5a 9c 9a  ||.3".O>i../.xZ..|
000000b0  94 ac 8b 3c 94 6a 9a b2  75 50 84 e3 e9 80 b8 31  |...<.j..uP.....1|
000000c0  e9 0b b7 37 bc 9a cd ce  aa b5 fa 5c 61 75 b8 4f  |...7.......\au.O|
000000d0  5a c8 67 3d e8 8a bd f1  f4 f5 86 18 0a 9f 53 2d  |Z.g=..........S-|
000000e0  8e 95 56 8b e6 df d5 88  a3 88 45 34 24 8c e9 e6  |..V.......E4$...|
000000f0  f4 0b 85 c8 08 31 2b dd  2c e2 de 49 42 94 5c     |.....1+.,..IB.\|

This doesn't look right. A foscam linux.bin image starts with:
Code: [Select]
$ hd -n 255 lr_cmos_11_14_1_46.bin
00000000  42 4e 45 47 01 00 00 00  01 00 00 00 32 b3 0b 00  |BNEG........2...|
00000010  00 d0 08 00 50 4b 03 04  14 00 00 00 08 00 63 2b  |....PK........c+|
00000020  10 3b 72 88 39 83 be b2  0b 00 10 99 18 00 09 00  |.;r.9...........|
00000030  00 00 6c 69 6e 75 78 2e  62 69 6e ec fd 0b 78 5c  |..linux.bin...x\|
00000040  55 b9 07 0e af 3d 97 64  9a 4e db 9d 1b 49 db 40  |U....=.d.N...I.@|
00000050  77 db 80 a1 04 d8 6d 03  04 0c 30 bd 80 95 56 99  |w.....m...0...V.|
00000060  d2 02 15 2b 06 28 5a b5  40 c0 aa 3d e7 14 99 5c  |...+.(Z.@..=...\|
00000070  1b 6a 5a d2 36 bd 50 02  19 a5 7a 2a a7 1c a3 14  |.jZ.6.P...z*....|
00000080  ed c1 ea 19 7a d1 8a 05  8b 14 e5 60 3d ee 99 c9  |....z......`=...|
00000090  36 69 a6 6a d4 aa 15 91  f9 7e bf b5 d6 64 26 a1  |6i.j.....~...d&.|
000000a0  2a 9e 73 fe ff ef 79 be  cf 3c 5d 5d b3 d7 5e 7b  |*.s...y..<]]..^{|
000000b0  5d df f5 de d6 bb de 25  62 d1 f8 b3 66 34 f9 8a  |]......%b...f4..|
000000c0  88 26 c5 d0 d4 78 55 f8  91 44 fd f4 ad 03 22 14  |.&...xU..D....".|
000000d0  4d 06 c4 cd 71 5f a8 b5  e6 cd 74 fa aa 4a ab c7  |M...q_....t..J..|
000000e0  15 56 9b fb ac 85 7c d6  c3 ae e8 8d 26 af 37 c4  |.V....|.....&.7.|
000000f0  a0 35 71 a2 e8 3d 77 a2  68 f8 d5 64 b1 07 b1     |.5q..=w.h..d...|
000000ff

The header is obviously missing. What tool builds the header?

  • No avatar
  • *****
May 13, 2011, 12:03:51 am
Your linux.bin in the first link is ZIPPED, so you have PK header.

Philip Katz wrote the original ZIP program, hence the PK file header for ZIP files.
Much like DOS exe's start with MZ, as it was written by Mark Zbikowski.


Your second file includes some other header info.
You have a BNEG data header + some other bytes.

The actual linux bin file starts at position 0x14

If you read my blog post on debugging the file formats at http://www.computersolutions.cn you'll see some info on this exact thing

http://www.computersolutions.cn/blog/2010/04/ip-cam-hacking-pt4/