forked from Naetw/CTF-pwn-tips
-
Notifications
You must be signed in to change notification settings - Fork 1
Hex Editing
Rahul Sridhar edited this page Oct 18, 2017
·
1 revision
Oftentimes you'll want to figure out how to edit a binary file. The "right" way to do this is with a good hex editor. (We recommend the 010 hex editor for which you can get a free 30 day trial).
If you're in a constrained environment and just want something quick and fast, a good approach is to use xxd
, which is a command-line tool that outputs an easy-to-read hexdump. We can save the hexdump:
xxd binary_file > binary_file.xxd
and then edit it using whatever hex editor we prefer:
vim binary_file.xxd
and then recover our modified binary using the -r
option:
xxd -r binary_file.xxd > new_binary_file