Hexy: Binary to Hex Array Converter.

Just after the second hack night,  Tim was temporarily staying at my house for a while, and one evening just happened to be working on some embedded PIC stuff.

He was writing a system to serve an image over a simple web server that was running on the chip itself. Now, I’m not too familiar with embedded C, but my skills as an application developer were still useful that evening!

In order to work with an image on a system with no filesystem, or indeed kernel, the binary data of the image file (in this case it was a jpeg) needed to be entered into an array of bytes within the C source code, a bit like the example shown here:

  unsigned byte data[] = {0x3C,0x3F,0x78,0x6D...};

Tim approached me to create a Windows tool that could automate this, and so I opened up Lazarus and got coding! In a few minutes I had a solution (at the time we named it TimHex). After a few more minutes of optimisation, the finished utility worked pretty well, and we were able to serve images up from the PIC.

Hexy for Windows

So why this blog post? Well, in the last week or so I resurrected TimHex, renamed it, tidied it up, made it cross-platform and open sourced it.  The result of all this hard work is Hexy, which can be found on my GitHub page.

Feel free to have a look and post comments.

I already have some plans for future changes to it, including a command-line only interface and configurable outputs. I hope to be able to continue working on it in my spare time.

About Tris

Tris is a software engineer with a PhD in image analysis. He likes real beer, photography, electric guitar based music and Unix operating systems.
This entry was posted in Hardware, Programming. Bookmark the permalink.

One Response to Hexy: Binary to Hex Array Converter.

  1. Shantanu says:

    Thanks mate, helped me a lot. It would be a big pain having to do something similar with converting a 512kb binary to a hex array..

    Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>