Tuesday, March 1, 2011

Foscam FI8908W #2

$ hd -n 32 system_11.14.2.28.bin
00000000 42 4e 45 47 01 00 00 00 01 00 00 00 ae f7 0b 00 |BNEG........®÷..|
00000010 00 08 0b 00 50 4b 03 04 14 00 02 00 08 00 37 2f |....PK........7/|
00000020

$ dd if=system_11.14.2.28.bin ibs=1 skip=20 2> /dev/null | file -
/dev/stdin: Zip archive data, at least v2.0 to extract

$ hd -n 20 system_11.14.2.28.bin
00000000 42 4e 45 47 01 00 00 00 01 00 00 00 ae f7 0b 00 |BNEG........®÷..|
00000010 00 08 0b 00                                     |....|
00000014

$ du -b system_11.14.2.28.bin | cut -f1
1507266

$ echo $((0x0bf7ae + 0x0b0800))
1507246

$ dd if=system_11.14.2.28.bin ibs=1 skip=$((0x0bf7ae + 20)) 2> /dev/null | file -
/dev/stdin: romfs filesystem, version 1 722288 bytes, named rom 4cdf0ba4.

$ dd if=system_11.14.2.28.bin of=4cdf0ba4.romfs ibs=1 skip=$((0x0bf7ae+20))
722944+0 records in
1412+0 records out
722944 bytes (723 kB) copied, 0.234873 s, 3.1 MB/s

$ dd if=system_11.14.2.28.bin of=file.zip ibs=1 skip=20
1507246+0 records in
2943+1 records out
1507246 bytes (1.5 MB) copied, 0.486474 s, 3.1 MB/s

$ zipinfo file.zip
Archive: file.zip
Zip file size: 1507246 bytes, number of entries: 1
-rw------- 2.0 fat 1666336 b- defX 10-Mar-24 05:57 linux.bin
1 file, 1666336 bytes uncompressed, 784186 bytes compressed: 52.9%

$ rm file.zip

$ echo $((0x0bf7ae))
784302

$ dd if=system_11.14.2.28.bin of=linux.bin.zip ibs=1 skip=20 count=784302
784302+0 records in
1531+1 records out
784302 bytes (784 kB) copied, 0.260929 s, 3.0 MB/s

$ du -b linux.bin.zip | cut -f1
784302

$ unzip linux.bin.zip
Archive: linux.bin.zip
inflating: linux.bin

$ du -b linux.bin | cut -f1
1666336

No comments:

Post a Comment