What's a good hex editor/viewer for the Mac? I've used xxd for viewing hexdumps, and I think it can be used in reverse to make edits. But what I really want is a real hex editor.
What's a good hex editor/viewer for the Mac? [closed]
Asked Answered
To view the file, run:
xxd filename | less
To use Vim as a hex editor:
- Open the file in Vim.
- Run
:%!xxd
(transform buffer to hex) - Edit.
- Run
:%!xxd -r
(reverse transformation) - Save.
There also vinarise.vim plugin which makes hex editing workflow nicer. –
Spirograph
This is exactly why I ask candidates "teach me something I don't know about vim" in every interview. After 15 years I'm still find GOLD. –
Ensample
If you understand what
:% !
does, then you will realize this is equivalent to doing cat filename.bin | xxd
. So really this is more of a "did you know that you have an xxd
command?" answer. Now that I look into it, I find that xxd also accepts a filename. So, if you only need to see the content of the binary/hex file, you can just use xxd filename.bin
. Good stuff! –
Ensample The problem with using xxd (and with using vim as described in this answer) is that there's no highlighting of the char and binary value. You'll need to count more characters and remember more positions to use this "dumb" binary dump effectively. Also, there's no intelligent analysis of endianness or interpretation of byte ranges as different types. –
Annoy
@BrunoBronosky Or
xxd filename.bin | less
when it doesn't fit in one screen height. –
Pattypatulous @Derek朕會功夫 and
reset
when you forget to pipe to less
and your terminal is hosed from the control characters. ;-) –
Ensample when i did this vim added a trailing newline, i did
set :binary
and :set noeol
–
Burp I found that in the situation the file is with all "0x00", xxd is not working: % xxd file1 xxd: Operation timed out % xxd --version xxd 2022-01-14 by Juergen Weigert et al. % echo $SHELL /bin/zsh It's MacOS Monterey 12.4. The problem is you don't know that (all "0x00" situation) if xxd doesn't work. –
Falkner
- Open file with Xcode and press Command + Shift + J
- Right click file name in left pane
- Open as -> Hex
@ahcox this totally still works with Xcode 9 –
Bantam
@ahcox perhaps you tried to open a folder, because then you will get that error. –
Pashm
Is there a command line option to open a file in Xcode directly into Hex mode? –
Vi
works in Xcode 12.4. The editor's behavior might be a bit surprising, but just keep typing... –
Breazeale
One recommendation I've gotten is Hex Fiend.
Yea, and you can read the developer talking about fun implementing stuff on it here ridiculousfish.com/blog –
Collard
Also like Hex Fiend. The project moved to GitHub - so download the latest version on the releases tab instead of their previous website - github.com/ridiculousfish/HexFiend/releases –
Cain
It's also available on Homebrew:
brew cask install hex-fiend
–
Rozellarozelle I have recently started using 0xED, and like it a lot.
@JarretHardie HexFriend does not support dragging I suppose? –
Briquette
0xED seems to be the most simple and user-friendly of the free options out there. Just download and run, and get a side-by-side hex/ASCII view. Text editors work too, but often don't have very good binary-level editing/display options. Plus 0xED is incredibly fast; you can browse in realtime through a 1 GB file. –
Pleinair
0xED doesn't work at all for me (it doesn't even show a UI). macOS Mojave. I also find it fishy that there's no checksum posted on the site for the latest version. –
Electron
According to the official site, 0xED is no longer under active development –
Emaciation
At some point in the last year the official website went offline (domain renewed in May 21). You can still find the last release in archive.org's wayback machine. However this project isn't open source and as the developer/site is gone...so you are probably better off adopting a different tool (
xxd
, hexfiend, xcode, etc). –
Residue There are probably better options, but I use and kind of like TextWrangler for basic hex editing. File -> hex Dump File
TextWrangler has been sunsetted/discontinued as of macOS 10.13 (High Sierra). –
Sabadell
BBEdit is the "replacement" for TextWrangler, looks and feels the same and offers the same features as TextWrangler, and still free. You only pay to support the developer and/or unlock more advanced features. barebones.com/products/textwrangler –
Threecolor
This is exactly the same for the latest version of BBedit –
Hurff
Unfortunately, while BBEdit's free version is essentially the same, it has some notable differences from TW, especially the addition of nag stuff (menu items labeled "Pro" or whatever). TextWrangler still works well if you can grab a download. –
Pleinair
Can you edit hex in TextWrangler/BBEdit? I have only find a way to hexdump and read, not edit and save back to file. –
Milburr
The one that I like is HexEdit Quick and easy to use
How do you compile it? Its Makefile seems corrupted, and even trying to fix it manually didn't seem to work. Can you post a correct Makefile for it? –
Heterochromous
Even if this source binary was ok, I trust nothing on Sourceforge. –
Entanglement
© 2022 - 2024 — McMap. All rights reserved.