Two artifacts-Vim vs winhex

Source: Internet
Author: User

Wcdj

 

Winhex is a small tool dedicated to dealing with various daily emergencies. It can be used to check and repair various files, restore and delete files, and data loss caused by hard disk damage. It also allows you to see the files and data hidden by other programs. In general, it is a very good hexadecimal editor. Zdnet software library (to the top Network) has the highest rating and has a powerful system utility.

More about winhex: http://www.hudong.com/wiki/winhex

This article mainly introduces how to use Vim in Windows to View File Content in hexadecimal format

Step 1:
First install gvim and add its executable file directory to the path environment variable of the system, for example, D:/program files/Vim/vim72, in this way, you can directly call Vim in cmd and add execution parameters.

Step 2:
Use Vim to open the file to be edited or viewed in binary format. If you do not use the-B parameter, conversion errors may sometimes occur (I have not encountered such an error)

Vim-B file-to-open.dat

Then, use xxd to convert the file to the hexadecimal format (below, % refers to the full text ,! Followed by external commands)

: %! Xxd

The conversion result is shown as follows:

0000000: 5036 0a35 3932 2033 3230 0a32 3535 0a20 p6.592 320.255.
0000010: 0000e 2019 0e20 0000e 2019 0e20 0000e 2019 ...........
0000020: 0e20 127e 2019 0e1f 180c 1f18 0c1f 180c ..............
0000030: 1f18 0c1f 180c 1f18 0c1f 180c 1f18 0c27 ...............'
0000040: 1b0d 261a 0c24 1b0e 2319 0d22 180e 2017 ...... $ ..#.."...
0000050: 0c1f 180c 1e16 0b25 1d16 251d 1620 1a13 ...... % ....

Note::
(1) do not save the modification, but use: %! Xxd-r switch to text status format and then: W
(2) You can add the parameter-C to set the number of bytes displayed in each line. For example, use: %! Xxd-C 16 is displayed as a 16-byte row.
(3) If: %! Od command to hide the text column on the right
(4) Changing text columns does not change the data in hexadecimal notation. You can only manually modify the data in hexadecimal notation. Modifications in a text column do not take effect.

Summary:

1, GA

Displays the ASCII values of Characters Under the cursor.
For example, if the character at the current cursor position is 2, GA will display the following content at the lower end:
<2> 50, hexadecimal 32, octal 062

2, G + ctrl-G

Displays the position of the character under the cursor in the byte of the current file.
The last two digits are the current location of the bytes in the file and the total number of bytes in the file.

3, 5go

Specify to move the cursor to 5th bytes in the file.

4,: %! Xxd

Display and edit files in hexadecimal format.
For example:
: %! Xxd the entire file is displayed in hexadecimal format
: 3! In the xxd file, row 3rd is displayed in hexadecimal format.
Note: After editing, use the command! Xxd-r converts the modified hexadecimal content back. Otherwise, the modified hexadecimal content will be treated as normal text.

5,: %! Od

Hide the content of the text column on the right.

Reference:
Vim open and edit files in hexadecimal notation

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.