I found some nice tools and doc­u­ments which do help you analysing embed­ded firmware files.

Analyser tools
FIIN — Firmware Inspec­tor
A bit out­dated but still useful

uwfirm­force
Very nice file analyser which knows quite a lot of file types

draca — Crypto Analyser
Search for known cryp­to­graphic con­stants in a file

Doc­u­ments
23C3-Fudging-with-firmware-analysis.pdf (khor­ben)
Reverse Engi­neer­ing of Embed­ded Devices (dash)
Exploit­ing Embed­ded Sys­tems, Black­hat 2006 (Barn­aby Jack)
Hack­ing Embed­ded Linux Based Home Appli­ances (Alexan­der Sirotkin)
Hack­ing into Tom­Tom GO (Thomas Klef­fel, Chris­t­ian Daniel)

Some handy dd exam­ples
Con­vert firmware to ebcdic

1
dd if=sw_t2e_6504.bin of=./sw_t2e_6504.ebcdic conv=ebcdic

Con­vert firmware, switch endian-ness of whole file (16b)

1
dd if=sw_t2e_6504.bin of=./sw_t2e_6504.swab conv=swab

Split up the firmware (off­set is 828200 bytes)

1
dd if=sw_t2e_6504.bin of=part2 bs=1 skip=828200

An exam­ple, using the asus wrt 500gp firmware
Out­put of uwfirmforce:

1
2
3
4
Ana­lyz­ing file: ./WL500gp_1.9.7.7_TW.trx
Match­ing TRX sig­na­ture #0 at off­set 0
big endian, length 7237632, flags 0, ver­sion 1, off­set #0 0x0000001c, off­set #1 0x000ca328, off­set #2 0x00000000
Score: 100%
1
2
3
Match­ing GZIP sig­na­ture #0 at off­set 28
com­pres­sion deflate, flags FNAME, 12/05/2008 12:59:48, OS Unix
Score: 100%
1
2
3
Match­ing CRAMFS sig­na­ture #0 at off­set 828200
lit­tle endian, size 65536, flags NONE, 2069691273 blocks, 470036845 files, name “Com­pressed“
Score: 100%

Get the initrd:

1
dd if=WL500gp_1.9.7.7_TW.trx of=initrd.gz bs=1 skip=28

Get the cramfs image and mount it:

1
2
dd if=WL500gp_1.9.7.7_TW.trx of=1.cramfs bs=1 skip=828200
mount –t cramfs –o loop ./1.cramfs /mnt/cramfs

This is of course an easy exam­ple, there are also scram­bled firmware files which are not that easy to unpack (philips tv firmware files or son­icwall firmware files to name some exam­ples). If you man­age to unpack such an firmware file, please let me know!