Fork me on GitHub

一 概念:

hexdump是Linux下的一个二进制文件查看工具,它可以将二进制文件转换为ASCII、八进制、十进制、十六进制

格式进行 查看。

 

二 用法简介:

   该工具的用法十分简单,具体如下所示:

 

hexdump: 不适用的选项 -- -
usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]
               [-s skip] [file ...]
       hd      [-bcdovx]  [-e fmt] [-f fmt_file] [-n length]
               [-s skip] [file ...]

 

 

 

三 应用实例:

  该工具用法十分简单,下面以一个c代码例子来说明:

 

#include <stdio.h>

int main()
{
        printf("hello hexdump");
}
~            

 

   通过这个查看该bin文件的编译信息:

➜  hexdump git:(master) ✗ hexdump -C test 
00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
00000010  03 00 3e 00 01 00 00 00  60 10 00 00 00 00 00 00  |..>.....`.......|
00000020  40 00 00 00 00 00 00 00  78 39 00 00 00 00 00 00  |@.......x9......|
00000030  00 00 00 00 40 00 38 00  0d 00 40 00 1f 00 1e 00  |....@.8...@.....|
00000040  06 00 00 00 04 00 00 00  40 00 00 00 00 00 00 00  |........@.......|
00000050  40 00 00 00 00 00 00 00  40 00 00 00 00 00 00 00  |@.......@.......|
00000060  d8 02 00 00 00 00 00 00  d8 02 00 00 00 00 00 00  |................|
*
00003000  00 00 00 00 00 00 00 00  08 40 00 00 00 00 00 00  |.........@......|
00003010  47 43 43 3a 20 28 55 62  75 6e 74 75 20 39 2e 33  |GCC: (Ubuntu 9.3|
00003020  2e 30 2d 31 37 75 62 75  6e 74 75 31 7e 32 30 2e  |.0-17ubuntu1~20.|
00003030  30 34 29 20 39 2e 33 2e  30 00 00 00 00 00 00 00  |04) 9.3.0.......|
00003040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

 

posted on 2021-03-02 14:54  虚生  阅读(1873)  评论(0编辑  收藏  举报