Looking for a Hex Viewer [duplicate]
Possible Duplicate:
Searching a log file
Where I can either enter a binary file or the text file I have and search for a pattern of a multiple hex values.
What is viewed in my Text File:
0x000001A0: 36 5B 09 76 99 31 55 09 78 99 34 51 49 BF E0 03
0x000001B0: 28 0B 0A 03 0B E0 07 28 0B 0A 03 0B 49 58 09 35
For example: I want to be able to find the pattern '49 BF E0 03 28 0B 0A', Which goes across lines 1 and 2 above but I can't just search for it regularly because of the 0x000001B0: at the beginning of the line
Above is what is seen in the text file.
The issue is if it's in binary I'm not sure where I'm located in the file where as if I were in the开发者_如何学JAVA text file I know what location i'm in (which is necessary).
Needs to be free.
You don't need to use emacs because vim can do it for you (I say this because you tagged this vim, and not to start a flame war).
To do this in vim, open your binary in vim and type the following:
:%!xxd
This will filter the file and convert to hex mode. So something that looks like this when you open:
Êþº¾^@^@^@^B^@^@^@^R^@^@^@^@^@^@^P^@^@^@L0^@^@^@^L^@^@^@^G^@^@^@^C^@^@`^@^@^@
^@^@^L^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
will display as
0000000: cafe babe 0000 0002 0000 0012 0000 0000 ................
0000010: 0000 1000 0000 4c30 0000 000c 0000 0007 ......L0........
0000020: 0000 0003 0000 6000 0000 494c 0000 000c ......`...IL....
when you run that command. To convert back to binary form after you're done editing, type:
:%!xxd -r
I'd honestly recommend Emacs: you can open up the file and then go Meta-X hexl-mode and have a nice hex mode view.
精彩评论