Edit Hex In The Browser

If you can’t stand the thought of using an application in your browser, you might as well jump ahead to the comments and start flaming.

Still with us? Imagine this scenario. You are at the office, at a client’s site, at a school, or visiting your mom. Suddenly, for some strange reason, you need to edit a hex file. We don’t know why, but if you are reading Hackaday, it isn’t that big of a stretch to imagine it. What do you do? Download and install a hex editor? Maybe you can’t. Or, if it is mom’s computer, maybe you just don’t want to. Your next option is to navigate to HexEd.it.

The application, by [Jens Duttke], uses HTML5 and JavaScript and is actually a nicely capable editor. It shows the data in hex and ASCII as you’d expect. It also shows the current cursor location in a number of formats like 8-bit integer, 32-bit integer, date and time, and more. It even shows all the representations as big endian and little endian.

The tool can scan the file to match it with almost 7,000 file types for automatic identification, and there is a very nice search feature, as well. You can hide some of the inspector formats if you like and you can export your changes to your local hard drive.

According to the site, they don’t send any of your data to their web server and they don’t use memory to store the entire file, so large file editing is possible. About the only feature we didn’t see was the ability to read and write common formats like Intel hex or Motorola S-record files. You could use a tool like srec_cat to convert those files to binary (and back), but if you could do that you could probably load a regular hex editor, too.

The design and usability of HexEd.it is good. If you are into editing binary files in your browser, you might also want to disassemble code there, too. If you are wondering what you would do with a hex editor, you probably missed this post.

28 thoughts on “Edit Hex In The Browser

  1. If it works in the Links CLI web browser and can edit local files… Then this would be very handy for those who messed up their X config or that other emergency…

    Then again… A web page that edits local files arbitrarily and outside of the knowledge of the victim could make a lethal virus.

    Still interesting seeing the evolution of such advanced webpage API’s….
    Esp virtual machines in a web page.

      1. Had a mini distro without any editor at all… or I didn’t know if it had one as there was no doc.

        Had almost a similar issue with manjaro… found out nano exists.
        There should be an easy way to Google and actually get useful info for, “CLI text editor” or, “list of console text editors for linux”… Heck, “Emergency editor for (insert distro)” didn’t produce results.

  2. Like most assembly writers, I’m lazy. So, rather than go try it out myself, you tell me…
    “…we didn’t see was the ability to read and write common formats like Intel hex…files.” Like generated by MASM, or DOS’s dbug?

    1. I am not sure I understand your question. Intel hex is a format commonly used for EPROM or microcontroller loads. Also Motorola S records depending on what you use.

    1. Troll-baiting, or flame-baiting…. but done correctly as usual.

      The idea is to gather constructive and collective comments to feed off the inspiration and help with ones’ inner-mind’s view and construction of the world.

      Brian Benchoff uses a blown out of proportion variant of this technique (Likely intending to shoo us remaining readers away).
      To such an extent, he wrote an article about how plagiarism gets people places… i.e. into the hackaday prize in a newsworthy manner. In this case, if he wrote about evicting said plagiarist from the prize for blatant plagiarism… Then no harm done and we can all discuss constructively: Without trolling.

  3. Cool find :) I was actually wanting one the other day but for game cheats (nothing hardcore useful haha) so this will be fun to give a shot. Keep it up HaD-some good links recently. Much appreciated :)

  4. > scan the file to match it with almost 7,000 file types for automatic identification

    pretty basic, very primitive binary matching, couldnt recognize DLL.

    >According to the site, they don’t send any of your data to their web server

    nice, means it should work offline = I can just grab all the js and save it locally for later

    1. I’m literally amazed at the number of people who, trying to make a point in a clever fashion, say something without ever considering that what they just said can also be used against them.

      “Unfortunately for most of you, the browser is the new OS. (sent from a ChromeOS Pixel 2.)”

      No, unfortunate for you. That’s all you’ve got, A NON-COMPUTER. You’ve got only a terminal –with a browser– which can’t even print properly, and must be continually attached to the internet or you don’t “work”…oh, and a massive inferiority complex.

      “To a person whose only tool is a hammer, every problem is a nail.”–anon

      “I won’t insult your intelligence by suggesting that you believe what you just said.”–Wm. F. Buckley

  5. This is not a hex editor. It’s a binary editor. It can’t handle Intel-Hex files, Motorola S, etc. Also it can’t handle gaps. Don’t call a program hex editor if it does not have such features. I have not seen a usable Hex-Editor which can handle gaps so far.

    1. How silly. It displays and accepts input in hex. Hex represents binary. It is not a binary editor. By your logic Microsoft Word isn’t a document editor because documents use LaTex and Word can’t open them.

      If you have a hex file (or srecord file) with (or without) gaps, use srec_cat to build a file with no gaps (or convert to binary with no gaps). Then after editing with anything (including this editor) use srec_cat to put it back. Ideal? No, but I use the same trick to make the open source TL886 EPROM programmer read hex files (and contributed it back to the project).

      1. I used srec_cat a lot back in the days. How do you preserve the gaps when converting back? Doing this manually is pain in the ass and if you have automated processes you can’t tell anymore which data was filled, and which was entered but has the same value. How do you handle files which have huge memory gaps, like 4 GB or greater? There are microcontroller which use 64-bit address space these days. Very much fun converting this to binary. It’s a pitty that there’s not a single editor on the market which actually handles that gap shit. That’s why my company had to design its own editor besides a memory efficient file format, because – guess it – Intel-Hex, MotS is not even near memory efficient.

  6. Hello,

    I’m the author of HexEd.it and just came across this article.
    After reading it and the comments, I’ve realized that it would be a cool feature to be able to import Motorola S-record and Intel-Hex files.
    So I’ve just implemented import and export support for the Motorola S-record format – Intel-Hex will follow next.

    Import: “Open file” with one of these file extensions: s19, s28, s37, s, s1, s2, s3, sx, srec, mot, mxt
    Export: First, select the ranges you want to export, then right-click -> “Export selected bytes to Motorola S-record file…”

    That format is absolutely new to me, so I don’t know how you guys are using it.
    Right now, the editor always opens a new file and fills the gaps which are not part of the file with null-bytes.
    Beside that, it directly selects the bytes which are part of the S-record file, so that you can easily export the same bytes.

    Additionally I’ve found this nice graphic:
    https://upload.wikimedia.org/wikipedia/commons/f/f1/Motorola_SREC_Chart.png
    It indicates that the structure of the “Header Record” contains a Module Name, Version, Revision and Text Comment.
    The specification (https://www.nxp.com/docs/en/reference-manual/M68000PRM.pdf) indicates that in textual form as well, but does not describe any specific format. All sample files, which I found so for, only contained text (mostly the file name).
    So, I wonder, if you guys are using a tool which exports such a “Data Field Structure” in the header record, or is that an unused feature?

    Feature requests and improvement ideas are always welcome. It took me two years to find this article – so, if you need a feature faster, simply contact me directly. ;-)

    Many regards,
    Jens Duttke

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.