1

I am newcomer to this field. I would like to understand how these things work and what these file contain (and if I'm on the right path).

To explain my doubts, I will use the .hex file posted in a similar question: How can I decompile an ARM Coretex M0 .hex file to C++?

Link to .hex file: http://www.3fvape.com/images/3fvape-blog-img/20150806-4384-xcubeII-upgrade/SMOK_X_CUBE_II_firmware_v1.07.hex

The .hex file contains the instructions that will be executed by the microcontroller, and the format used is http://www.keil.com/support/docs/1584/, am I right?

Now I've tried to extract some information from this file (just for learning): I've converted the .hex file into .bin file with hex2bin (as suggested in the first answer), then I've run the command "strings file.bin", and I've found some readable strings.

What does this mean? Why can I read only some strings and not all the data? Exactly what happen when I convert .hex file to .bin file? Is there a way to extract the code in which these strings are used?

Maybe these questions are too silly, but I hope that someone could explain what these files are, and what they represent. Any good resource will be appreciated. Thanks in advance.

1 Answer 1

2

The .hex file contains the instructions that will be executed by the microcroller, and the format used is http://www.keil.com/support/docs/1584/ , am I right?

You're right about the format. The .hex file basically encodes binary data which contains instruction in assembly language, but also data.

What does it mean? Why can I read only some strings and not all the data?

It means strings could find some data its deems to be a string. it just searches the binary dump for byte sequences which reassembly ascii codes (with additional heuristics, like minimum length, different string formats, ...)

Exacly what happen when I convert .hex file to .bin file?

The file is decoded. its a symmetric encoding scheme as described at the source you privided.

Is there a way to extract the code in which these strings are used?

Yes, but you would need to find the code first to make this connection. Good diassemblers like IDA will find cross-references to data fields (like strings).

If you want to see the individual machine instructions, please use a disassembler like radare2, IDA, BinaryNinja, Hopper or something else capable of disassembling ARM.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.