Hexeditor, or to be accurate, a .hex editor

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who would have thought it was so difficult to find a hex editor? Not me.

 

I'm trying to find a hex editor, that is to say an editor that will open, and save to, .hex files.

 

It seems everyone else thinks a hex editor is one that will open any file given it as a binary file and allow you to edit it. Lots of people trying to find one on StackExchange and being told to convert the file first of all to binary, then edit it, then convert it back. Helpful? Not really but then that is StackExchange for you.

 

So, my question is, does anyone have a recommendation for an editor that knows about .hex files, will open it, and allow you to make changes, and save it back out as a .hex file.

 

Heck, I'll even pay money for one if it's any good.

"This forum helps those that help themselves."

"How have you proved that your chip is running at xxMHz?" - Me

"If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not exactly purpose-built for your goals, but IME good enough the times I needed to use it:  CodeVisionAVR IDE.

 

-- Load .HEX (or several other formats such as .BIN) as the Flash image

-- Edit Flash

-- Save in desired format

 

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Sat. Jan 13, 2018 - 01:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use a proprietary, in-house tool but Google says...

 

https://sourceforge.net/projects...

 

And I think this one is fairly famous...

 

https://mh-nexus.de/en/hxd/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LOL -- I see that it is AVR word addresses.  Guess you need to load as the EEPROM buffer.  (but will that load/edit/save more bytes than the chosen device in the programmer dialog has for EEPROM space?  No--limited to device size...)

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:

Not exactly purpose-built for your goals, but IME good enough the times I needed to use it:  CodeVisionAVR IDE.

 

Thanks, I have been using that but finding text strings was being complicated by it being 'word aware'.

 

 

clawson wrote:

I use a proprietary, in-house tool but Google says...

https://sourceforge.net/projects...

 

That seems to work, took me a while to find that you need to change the display font if you want it to display anything other than weird symbols.

 

Thanks.

 

 

 

Although it will save as various hex formats it will only open as binary.

"This forum helps those that help themselves."

"How have you proved that your chip is running at xxMHz?" - Me

"If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting, I'd always though Hxd was "ubiquitous" and would work in both directions, learn something new every day!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

???

Do you mean files in the intel hex format?

 

https://duckduckgo.com/html?q=%2...

https://electronics.stackexchang...

 

If your favourite editor supports macro's you can write some to do the conversion for you.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The issue is the Intel HEX format is not a common file format in the broader PC programming world, found mostly in the much smaller embedded community.  So finding a good editor that reads those files natively is going to be difficult.  But raw binary files and editors that read them are very common.  So it seems you are ignoring sound advice.  Use a utility to convert the Intel HEX file to raw binary, edit the raw binary with your favorite binary file editor (Frhed comes to mind), then convert back to Intel HEX format.

 

For the conversion itself take a look at SRecord 1.64 (http://srecord.sourceforge.net/)  It is a very powerful command line utility program to convert between many common embedded file formats (Motorola SRecords, Intel Hex, raw binary, plus about two dozen other formats).  I'm using it to embed a CRC into an ELF file format in a post compile macro, then generating the Intel HEX files from the .ELF all within Atmel Studio's build scripts.

 

<rant> Atmel/Microchip - pay attention and add this feature to Atmel Studio 7 with a simple checkbox.  IAR has been able to embed a CRC into the flash file during a normal compile sequence for many years now</rant>

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure how it works or if it will do what you want (ie I have never used it) but Notepad++ has an Intel hex "language" setting.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Software accompanying device programmers usually "know" all possible formats and usually have some editing/viewing facilities.

 

As a patriot, I recommend Elnec (AFAIK the program itself is not bound to hardware).

 

JW

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That menu is usually just about syntax highlighting so I guess the "Intel Hex" option is just about highlighting address, length, type and so on.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dunno if this helps any, but some years ago I wrote a spreadsheet that allowed you to at least calculate a valid checksum in a .hex file, line by line.  You had to type in the whole line (address and all, byte by byte) and it calculated the checksum for you.  Then you could put the same edits into any .hex file opened in any text editor.

 

Saw it the other day while cleaning out the hard drive and decided to keep it around for now.  Clumsy bugger, but it worked okay for VERY simple editing.  PM if anyone wants a copy (it's .xls, but I could save it out as .ods if you wanted me to). 

 

S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi !

 

Maybe you can try this editor: https://hexed.it

It executes inside the browser, and as far as I can see it can open and save .hex files

 

Best regards

Have a nice day,
Kraal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been following this thread hoping it would provide a "great" solution...

I have been using the previously mentioned hexplorer which can import/export Intel hex files and on export will generate the correct checksum byte for each changed line.

 

The only qualm I have about the program is that it outputs 32 bytes per line rather than the typical 16.

I have not found a way to change that setting.

However, it has worked for the few cases where a quick change was needed when re-compiling the source was not an option...

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

being told to convert the file first of all to binary, then edit it, then convert it back. Helpful? Not really

Honestly, I don't see the problem with that suggestion.  A simple script would do the trick.

 

#!/bin/bash

tmpfile=`tempfile`

function finish {
  rm -f "${tmpfile}"
}

trap finish EXIT 

if [ -e "${1}" ] ; then
  objcopy -I ihex -O binary "${1}" "${tmpfile}"
  if hexedit -s "${tmpfile}" ; then
    objcopy -I binary -O ihex "${tmpfile}" "${1}"
  fi
else
  echo NO SUCH FILE 1>&2
fi

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]