This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Markers in Binary file

Hello alltogether,

for me a binary-file (.hex or .bin) looks like there is no structure in it. 

Do you know if it could be possible, to mark all my binarys, so that i can recognize? E. g. with a unique string i could grep or ? Or let's say line xyz start always with with same chars.

Do I have the opportunity to mark all my binaries like that? Is it actually posible?

I develop with ARMClang

Greets

Parents
  • a binary-file (.hex or .bin)

    A Hex file is not binary!

    A hex file is a text file - which represents binary data.

    mark all my binarys, so that i can recognize? E. g. with a unique string

    Sure you could; eg,

    static uint8_t my_magic_marker[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };

    Perhaps more useful would be some thing like

    static char date_string[] = __DATE__;
    static char time_string[] = __TIME__;

    Which you could then send to some output device - to verity that you're running the right version; eg,

    printf( "Built on %s at %s.\n",  date_string[],  time_string[] );

    i could grep or ?

    grep is usually for text files - so probably not the best tool here?

Reply
  • a binary-file (.hex or .bin)

    A Hex file is not binary!

    A hex file is a text file - which represents binary data.

    mark all my binarys, so that i can recognize? E. g. with a unique string

    Sure you could; eg,

    static uint8_t my_magic_marker[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };

    Perhaps more useful would be some thing like

    static char date_string[] = __DATE__;
    static char time_string[] = __TIME__;

    Which you could then send to some output device - to verity that you're running the right version; eg,

    printf( "Built on %s at %s.\n",  date_string[],  time_string[] );

    i could grep or ?

    grep is usually for text files - so probably not the best tool here?

Children