Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hexdump reverse command

The hexdump command converts any file to hex values.

But what if I have hex values and I want to reverse the process, is this possible?

like image 605
Maysara Alhindi Avatar asked May 01 '17 18:05

Maysara Alhindi


1 Answers

There is a similar tool called xxd. If you run xxd with just a file name it dumps the data in a fairly standard hex dump format:

# xxd bdata
0000000: 0001 0203 0405
......

Now if you pipe the output back to xxd with the -r option and redirect that to a new file, you can convert the hex dump back to binary:

# xxd bdata | xxd -r >bdata2
# cmp bdata bdata2
# xxd bdata2
0000000: 0001 0203 0405
like image 79
Bert Avatar answered Sep 18 '22 12:09

Bert