
Strings is extremely useful for getting an initial lay-of-the-land. Regardless, the following tools are good all-rounders. If it’s for a more complex system, with an operating system like Linux, you’ll probably want to get files out of it. If you know that it’s for bare-metal, but you don’t have a datasheet, you might want to do some byte-level detective work. If you know the firmware’s for a specific bare-metal MCU, you’ll likely just want to grab the datasheet and pull it straight into IDA. Once you got your firmware in a binary format, you can analyse it for interesting information.Īgain, it’s useful to remember context here. So, you got a binary? That don’t impress-a me much. There’s also the Micron introduction to NAND flash (which is where the above image is from). The author wrote an extremely useful tool called Nand-dump-tool.py, which should be used in conjunction with reading that post. I always, always end up going back to this amazing blog post on raw NAND dumps, every time I have to work with them. You can then start interrogating the dump with some of the strategies mentioned below. This means that you’re going to have to strip all these out of a raw dump before you have a contiguous file of the actual data you want. But, if you dump the whole chip raw, you’re going to have these “spare” segments in the dump. They’re there for the controller to keep track of bad blocks, erase counters, etc.

Out-of-band (OOB) “spare” segments are inserted at the end of every page of data, or the end of each block, as you can see above. Well, it’s not that it’s that weird, it’s actually clever and useful when the data is still on a NAND chip, but you still need to do some pre-processing before you’ve got anything usable off-chip.

Raw NAND dumpsĭata is stored in a weird way on a NAND chip. It looks roughly like this:Īll Motorola S-record, Intel HEX and TI-TXT files can be converted to binary using the bincopy python library. Memory addresses are prepended with an and data is represented in hex. TI-TXT is a Texas Instruments format, usually for the MSP430 series.
#010 editor xor script full
A full breakdown of the format can be found here.Ī similar vibe to SREC, Intel HEX lines all start with a colon. All S-record file lines start with a capital S. There’s a few common file formats you might come across: Motorola S-Record Before you can do much with these files, you’ll first need to get them into a binary format. If the device you’re targeting runs a bare-metal MCU, you might find that the firmware files are distributed in text files, with the bytes literally transcribed as hexadecimal (often with some prepended identifier codes and/or address offset/location, and possibly an appended checksum on each line). Use head, cat, hexdump, or your favourite GUI text editor. So, what in the file? Is it literally ASCII strings? Or a blob of binary data? Have a look. Similarly, trying to load the ROM filesystem for and embedded Linux-based SoC directly into IDA is a mug’s game. Running binwalk on SREC-encoded firmware for an RH850 is unlikely to help anyone. Do you know what chip it’s supposed to be running on? What’s the architecture? Little or big endian? Do you know if it’s running an RTOS? Is it running Linux? Just bare-metal?Ĭontext will help guide you towards the right tool for the job. It’s ALWAYS useful to remember the context of the file you’re working with. Let’s go through some strategies for getting useful data out of a firmware dump. Sometimes you’ll be faced with proprietary (barely documented) file formats, strange raw data quirks, or even encryption. Taking a firmware dump and turning it into something useful can sometimes be painful.
#010 editor xor script update
Perhaps a raw read off a chip? An update file you downloaded off the internet? Now what?
