I have been trying to extract the contents of a firmware and putting it to a binary file, but with no success.
I see the right hex contents, but am not sure how to laid them in bits into a file.
objdump -s -j .text firmware.ko | tail -n +5 | awk '{print "dd if='firmware.ko' of='content.bin' bs=1 count=$["$2 $3 $4 $5 "]"}'
Best Answer
Try this:
The file
firmware.text
should then contain what you want.UPDATE: The above should work if the firmware file is in the same format that your machine (running
objcopy
) uses. If it is not the case, you'll be getting:Then you'll have to specify the format yourself with
-I
. Usingfile
will tell you what format your firmware is in, e.g.:And then (for this case where you have an ELF 32 little endian) you'll need: