How to edit binary on unix systems

There are many third-party editors available on a Windows computer for editing a binary file. I believe that * nix systems should also have something similar. any idea how can i edit the binary in unix?

+55
linux unix binaryfiles hex-editors
May 08 '09 at 10:33
source share
12 answers

You can also try the ghex2 GNOME utilities. This gives you automatic hexadecimal on the ASCII side, as well as various character / integer decodes at the bottom. ghex2 http://kmbrandt.googlepages.com/hexeditor.jpg

+37
May 09 '09 at 4:34 a.m.
source share

In vim you can enter :%! xxd to turn it into a hexeditor. :%! xxd -r to return to normal mode. xxd comes with a vim installation.

See here for some notes on editing binary files using vim (it comes down to : set binary to avoid problems, use only the "R" or "r" command to change the text, do not delete characters).

If you are a fan of Emacs, see here for a guide to editing a binary using Emacs.

+95
May 08 '09 at 12:24
source share

On Linux / Unix, there are many more hex detectors ....

I am using hexedit on Ubuntu

sudo apt-get install hexedit 
+14
May 09 '09 at 3:35 pm
source share

you can check wikipedia .

I prefer BIEW .

+8
May 8 '09 at 10:38
source share

Bless is a high-quality, full-featured hexadecimal text editor.

It is written in mono / Gtk #, and its main platform is GNU / Linux. However, it should be able to run seamlessly on every platform run by mono and Gtk #. Key Features Bless currently provides the following features:

  • Effective editing of large data files and blocks.
  • Multilevel undo - redo operations.
  • Custom data types.
  • Fast data processing on the screen.
  • Several tabs.
  • Quick search and replace operation.
  • Data conversion table.
  • Advanced copy / paste capabilities.
  • The selection template selection matches the file.
  • Plugin based architecture.
  • Export data to text and html (others with plugins).
  • Bitwise operations with data.
  • Complete user guide.

copied from http://home.gna.org/bless/

+7
May 08 '09 at 13:15
source share

I used bvi .

I am developing hexvi to overcome the limitations :%!xxd bvi and bvi .

hexvi

Functions

  • vim-like keybindings and commands
  • transition to certain offsets
  • insert, replace, delete
  • material search (PCRE regular expressions)
  • everything is a team and can be displayed in hexvirc
  • color schemes
  • large file support
  • support for multiple files (through tabs)
  • Python, so the entry level for hacking should be below C
  • CLI through

against

  • as of March 2016, this alpha function is missing, but I'm working on it:
    • saving files
    • Undo / redo
    • team history
    • visual choice
    • man page
  • no autocomplete

Bvi

Functions

  • vim-like keybindings and commands
  • transition to certain offsets
  • insert, delete, replace
  • material search (text and hexadecimal)
  • Undo / redo
  • CLI through

against

  • regarding its capabilities vim - unfortunately, he understands only the most basic things and definitely needs more love in this regard (example: do not understand :wq , but understands :w and :q )
  • lack of visual highlight support
  • tab / split screen support
  • often crashes
  • large file support
  • no team history
  • no autocomplete
+4
Aug 16 '15 at 11:07
source share

I like KHexEdit , which is part of KDE

Its Windows Style user interface probably learns pretty fast for most people (anyway compared to Vim or Emacs :)

+3
May 08 '09 at 16:03
source share

There's a lightweight binary editor, check hexedit. http://www.linux.org/apps/AppId_6968.html . I tried using it to edit ELF files in Linux at least.

+2
May 08 '09 at 10:46
source share

I created wxHexEditor, it opens, written using C ++ / wxWidgets GUI libs and can even open your exabyte-sized disk!

http://wxhexeditor.sf.net

Just try it.

+2
Mar 19 2018-11-11T00:
source share

Alternatively, you can use radare2 :

 > r2 -w /usr/bin/ls [0x004049d0]>V [0x004049d0 14% 1104 (0x0:-1=1)]> x @ entry0 - offset - | 0 1 2 3 4 5 6 7 8 9 ABCDEF| 0123456789ABCDEF 0x004049d0 |31ed 4989 d15e 4889 e248 83e4 f050 5449| 1.I..^H..H...PTI 0x004049e0 |c7c0 103a 4100 48c7 c1a0 3941 0048 c7c7| ...:AH..9A.H.. 0x004049f0 |202a 4000 e877 dcff fff4 660f 1f44 0000| *@..w....f..D.. 0x00404a00 |b807 e661 0055 482d 00e6 6100 4883 f80e| ...a.UH-..aH.. 0x00404a10 |4889 e576 1bb8 0000 0000 4885 c074 115d| H..v......H..t.] 0x00404a20 |bf00 e661 00ff e066 0f1f 8400 0000 0000| ...a...f........ 0x00404a30 |5dc3 0f1f 4000 662e 0f1f 8400 0000 0000| ]...@.f......... 0x00404a40 |be00 e661 0055 4881 ee00 e661 0048 c1fe| ...a.UH....aH. 0x00404a50 |0348 89e5 4889 f048 c1e8 3f48 01c6 48d1| .H..H..H..?H..H. 0x00404a60 |fe74 15b8 0000 0000 4885 c074 0b5d bf00| .t......H..t.].. 0x00404a70 |e661 00ff e00f 1f00 5dc3 660f 1f44 0000| .a......].f..D.. 0x00404a80 |803d c19b 2100 0075 1155 4889 e5e8 6eff| .=..!..u.UH...n. 0x00404a90 |ffff 5dc6 05ae 9b21 0001 f3c3 0f1f 4000| ..]....!......@. 0x00404aa0 |bf10 de61 0048 833f 0075 05eb 930f 1f00| ...aH?.u...... 0x00404ab0 |b800 0000 0048 85c0 74f1 5548 89e5 ffd0| .....H..t.UH.... 0x00404ac0 |5de9 7aff ffff 662e 0f1f 8400 0000 0000| ].z...f......... 0x00404ad0 |488b 0731 d248 f7f6 4889 d0c3 0f1f 4000| H..1.H..H.....@. 

You can read more about working in visual mode here.

+2
Mar 29 '16 at 13:50
source share

For minor changes, I used hexedit:

http://rigaux.org/hexedit.html

Simple but fast and useful.

+1
May 08 '09 at 15:49
source share

I had good experience with wxHexEditor ... just make sure that you are working with hex editing the disc that you do through the menu

 Devices -> Open Disk Device -> SCSI Disk Drive Partition #_N_ 
+1
Jan 31 '12 at 20:25
source share



All Articles