iT邦幫忙

第 12 屆 iThome 鐵人賽

0
自我挑戰組

30天菜鳥學 Linux 系列 第 39

第39天-學習 od 指令

進度 : 鳥哥的 Linux 私房菜 -- 第六章、Linux 檔案與目錄管理

快速查詢對應 ASCII 的方式

test@test:~$ echo 0123456789abcdefghijklmnopqrstuvwxyz | od -t oCc
0000000 060 061 062 063 064 065 066 067 070 071 141 142 143 144 145 146
          0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f
0000020 147 150 151 152 153 154 155 156 157 160 161 162 163 164 165 166
          g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v
0000040 167 170 171 172 012
          w   x   y   z  \n
0000045

查詢 binary 文件對應的字

test@test:~$ cat /etc/issue
Ubuntu 20.04.1 LTS \n \l

test@test:~$ od -t oCc /etc/issue
0000000 125 142 165 156 164 165 040 062 060 056 060 064 056 061 040 114
          U   b   u   n   t   u       2   0   .   0   4   .   1       L
0000020 124 123 040 134 156 040 134 154 012 012
          T   S       \   n       \   l  \n  \n
0000032

查詢 passwd 會出現亂碼

test@test:~$ cat /usr/bin/passwd                     
܂o,*ǃ?g6ф)ȁr¸3[&¿‒¢΃¢'鿒G´S4 HY?V|{/A{e??ւ?nՃЁ3C끒¢i瀒;$/L³¬9°%у hbڄkPv?,

可以使用 od 來大略略讀

test@test:~$ od -t oCc /usr/bin/passwd  
0152440 030 104 016 020 102 016 010 000 114 000 000 000 044 013 000 000
        030   D 016 020   B 016  \b  \0   L  \0  \0  \0   $  \v  \0  \0
0152460 260 250 377 377 152 001 000 000 000 106 016 020 217 002 105 016
        260 250 377 377   j 001  \0  \0  \0   F 016 020 217 002   E 016
0152500 030 216 003 105 016 040 215 004 105 016 050 214 005 101 016 060
        030 216 003   E 016     215 004   E 016   ( 214 005   A 016   0

上一篇
38天-研究du用法
下一篇
第40天- 學習 DNS Server
系列文
30天菜鳥學 Linux 59

1 則留言

1
icekimo
iT邦新手 3 級 ‧ 2020-10-12 14:03:32

我覺的這個也很好玩,hexedit

thanks,it's so cool!

test@test:~$ hexedit /usr/bin/passwd

00000000   7F 45 4C 46  02 01 01 00  00 00 00 00  00 00 00 00  03 00 3E 00  01 00 00 00  40 4F 00 00  00 00 00 00  .ELF..............>.....@O......
00000020   40 00 00 00  00 00 00 00  F0 02 01 00  00 00 00 00  00 00 00 00  40 00 38 00  0D 00 40 00  1E 00 1D 00  @...................@.8...@.....
00000040   06 00 00 00  04 00 00 00  40 00 00 00  00 00 00 00  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  08 00 00 00  00 00 00 00  03 00 00 00  04 00 00 00  ................................
00000080   18 03 00 00  00 00 00 00  18 03 00 00  00 00 00 00  18 03 00 00  00 00 00 00  1C 00 00 00  00 00 00 00  ................................
000000A0   1C 00 00 00  00 00 00 00  01 00 00 00  00 00 00 00  01 00 00 00  04 00 00 00  00 00 00 00  00 00 00 00  ................................
000000C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  F0 2F 00 00  00 00 00 00  F0 2F 00 00  00 00 00 00  ................./......./......
000000E0   00 10 00 00  00 00 00 00  01 00 00 00  05 00 00 00  00 30 00 00  00 00 00 00  00 30 00 00  00 00 00 00  .................0.......0......
00000100   00 30 00 00  00 00 00 00  85 7B 00 00  00 00 00 00  85 7B 00 00  00 00 00 00  00 10 00 00  00 00 00 00  .0.......{.......{..............
00000120   01 00 00 00  04 00 00 00  00 B0 00 00  00 00 00 00  00 B0 00 00  00 00 00 00  00 B0 00 00  00 00 00 00  ................................
00000140   48 2E 00 00  00 00 00 00  48 2E 00 00  00 00 00 00  00 10 00 00  00 00 00 00  01 00 00 00  06 00 00 00  H.......H.......................
00000160   C0 E9 00 00  00 00 00 00  C0 F9 00 00  00 00 00 00  C0 F9 00 00  00 00 00 00  90 17 00 00  00 00 00 00  ................................
00000180   18 1D 00 00  00 00 00 00  00 10 00 00  00 00 00 00  02 00 00 00  06 00 00 00  D0 E9 00 00  00 00 00 00  ................................
000001A0   D0 F9 00 00  00 00 00 00  D0 F9 00 00  00 00 00 00  30 02 00 00  00 00 00 00  30 02 00 00  00 00 00 00  ................0.......0.......
000001C0   08 00 00 00  00 00 00 00  04 00 00 00  04 00 00 00  38 03 00 00  00 00 00 00  38 03 00 00  00 00 00 00  ................8.......8.......
000001E0   38 03 00 00  00 00 00 00  20 00 00 00  00 00 00 00  20 00 00 00  00 00 00 00  08 00 00 00  00 00 00 00  8....... ....... ...............
00000200   04 00 00 00  04 00 00 00  58 03 00 00  00 00 00 00  58 03 00 00  00 00 00 00  58 03 00 00  00 00 00 00  ........X.......X.......X.......
00000220   44 00 00 00  00 00 00 00  44 00 00 00  00 00 00 00  04 00 00 00  00 00 00 00  53 E5 74 64  04 00 00 00  D.......D...............S.td....
00000240   38 03 00 00  00 00 00 00  38 03 00 00  00 00 00 00  38 03 00 00  00 00 00 00  20 00 00 00  00 00 00 00  8.......8.......8....... .......
00000260   20 00 00 00  00 00 00 00  08 00 00 00  00 00 00 00  50 E5 74 64  04 00 00 00  38 C6 00 00  00 00 00 00   ...............P.td....8.......
00000280   38 C6 00 00  00 00 00 00  38 C6 00 00  00 00 00 00  CC 03 00 00  00 00 00 00  CC 03 00 00  00 00 00 00  8.......8.......................
000002A0   04 00 00 00  00 00 00 00  51 E5 74 64  06 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ........Q.td....................
000002C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  10 00 00 00  00 00 00 00  ................................
000002E0   52 E5 74 64  04 00 00 00  C0 E9 00 00  00 00 00 00  C0 F9 00 00  00 00 00 00  C0 F9 00 00  00 00 00 00  R.td............................
00000300   40 06 00 00  00 00 00 00  40 06 00 00  00 00 00 00  01 00 00 00  00 00 00 00  2F 6C 69 62  36 34 2F 6C  @.......@.............../lib64/l
00000320   64 2D 6C 69  6E 75 78 2D  78 38 36 2D  36 34 2E 73  6F 2E 32 00  00 00 00 00  04 00 00 00  10 00 00 00  d-linux-x86-64.so.2.............
00000340   05 00 00 00  47 4E 55 00  02 00 00 C0  04 00 00 00  03 00 00 00  00 00 00 00  04 00 00 00  14 00 00 00  ....GNU.........................
00000360   03 00 00 00  47 4E 55 00  FA 23 C6 B4  E1 45 D9 BB  54 87 C6 CB  7A DB 93 38  C5 EF 4F B9  04 00 00 00  ....GNU..#...E..T...z..8..O.....
00000380   10 00 00 00  01 00 00 00  47 4E 55 00  00 00 00 00  03 00 00 00  02 00 00 00  00 00 00 00  00 00 00 00  ........GNU.....................
000003A0   03 00 00 00  7C 00 00 00  01 00 00 00  06 00 00 00  30 05 A1 40  C0 41 5C 12  7C 00 00 00  82 00 00 00  ....|...........0..@.A\.|.......
000003C0   85 00 00 00  28 1D 8C 1C  16 2F 74 0F  C4 89 05 90  9E FB 6E 0F  A6 DD A3 6B  D1 65 CE 6D  66 55 61 10  ....(..../t.......n....k.e.mfUa.
000003E0   C4 B9 9C 40  39 F2 8B 1C  32 C4 F7 12  B3 A2 F7 12  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ...@9...2.......................
00000400   00 00 00 00  00 00 00 00  3D 04 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ........=.......................
00000420   B1 03 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  E5 04 00 00  12 00 00 00  ................................
00000440   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  DE 00 00 00  12 00 00 00  00 00 00 00  00 00 00 00  ................................
00000460   00 00 00 00  00 00 00 00  4E 03 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ........N.......................
00000480   CA 04 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  5D 00 00 00  12 00 00 00  ........................].......
000004A0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  C7 02 00 00  12 00 00 00  00 00 00 00  00 00 00 00  ................................
000004C0   00 00 00 00  00 00 00 00  23 02 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ........#.......................
000004E0   F3 01 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  B2 01 00 00  12 00 00 00  ................................
00000500   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  0D 00 00 00  20 00 00 00  00 00 00 00  00 00 00 00  .................... ...........
00000520   00 00 00 00  00 00 00 00  82 01 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................................
00000540   6F 01 00 00  12 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  2C 04 00 00  12 00 00 00  o.......................,.......
00000560   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  2A 02 00 00  12 00 00 00  00 00 00 00  00 00 00 00  ................*...............

我要留言

立即登入留言