Elf
*
是什麼意思使用 hexdump -C?
我一直在做練習,試圖了解程序背後發生的一些事情。我編寫了一個小 C 程序,並在 i386 Linux (Ubuntu 12.04) 上使用
gcc
. 然後我hexdump -C
對文本文件的輸出做了一個。我注意到偏移量上有一些差距*
:00000670 00 3f 1a 3b 2a 32 24 22 1c 00 00 00 40 00 00 00 |.?.;*2$"....@...| 00000680 94 fd ff ff 05 01 00 00 00 41 0e 08 85 02 42 0d |.........A....B.| 00000690 05 03 01 01 c5 0c 04 04 38 00 00 00 60 00 00 00 |........8...`...| 000006a0 80 fe ff ff 61 00 00 00 00 41 0e 08 85 02 41 0e |....a....A....A.| 000006b0 0c 87 03 41 0e 10 86 04 41 0e 14 83 05 4e 0e 30 |...A....A....N.0| 000006c0 02 4a 0e 14 41 0e 10 c3 41 0e 0c c6 41 0e 08 c7 |.J..A...A...A...| 000006d0 41 0e 04 c5 10 00 00 00 9c 00 00 00 b4 fe ff ff |A...............| 000006e0 02 00 00 00 00 00 00 00 10 00 00 00 b0 00 00 00 |................| 000006f0 a2 fe ff ff 04 00 00 00 00 00 00 00 00 00 00 00 |................| 00000700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000f10 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff |................| 00000f20 00 00 00 00 00 00 00 00 01 00 00 00 10 00 00 00 |................| 00000f30 0c 00 00 00 d4 82 04 08 0d 00 00 00 cc 85 04 08 |................| 00000f40 f5 fe ff 6f ac 81 04 08 05 00 00 00 2c 82 04 08 |...o........,...| 00000f50 06 00 00 00 cc 81 04 08 0a 00 00 00 54 00 00 00 |............T...| 00000f60 0b 00 00 00 10 00 00 00 15 00 00 00 00 00 00 00 |................| 00000f70 03 00 00 00 f4 9f 04 08 02 00 00 00 20 00 00 00 |............ ...| 00000f80 14 00 00 00 11 00 00 00 17 00 00 00 b4 82 04 08 |................| 00000f90 11 00 00 00 ac 82 04 08 12 00 00 00 08 00 00 00 |................| 00000fa0 13 00 00 00 08 00 00 00 fe ff ff 6f 8c 82 04 08 |...........o....| 00000fb0 ff ff ff 6f 01 00 00 00 f0 ff ff 6f 80 82 04 08 |...o.......o....| 00000fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000ff0 00 00 00 00 28 9f 04 08 00 00 00 00 00 00 00 00 |....(...........| 00001000 26 83 04 08 36 83 04 08 46 83 04 08 56 83 04 08 |&...6...F...V...| 00001010 00 00 00 00 00 00 00 00 47 43 43 3a 20 28 55 62 |........GCC: (Ub| 00001020 75 6e 74 75 2f 4c 69 6e 61 72 6f 20 34 2e 36 2e |untu/Linaro 4.6.| 00001030 33 2d 31 75 62 75 6e 74 75 35 29 20 34 2e 36 2e |3-1ubuntu5) 4.6.| 00001040 33 00 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74 |3...symtab..strt| 00001050 61 62 00 2e 73 68 73 74 72 74 61 62 00 2e 69 6e |ab..shstrtab..in| 00001060 74 65 72 70 00 2e 6e 6f 74 65 2e 41 42 49 2d 74 |terp..note.ABI-t| 00001070 61 67 00 2e 6e 6f 74 65 2e 67 6e 75 2e 62 75 69 |ag..note.gnu.bui| 00001080 6c 64 2d 69 64 00 2e 67 6e 75 2e 68 61 73 68 00 |ld-id..gnu.hash.| 00001090 2e 64 79 6e 73 79 6d 00 2e 64 79 6e 73 74 72 00 |.dynsym..dynstr.|
我的問題是,我應該如何解釋
*
?我認為這意味著文件中存在間隙,但是問題轉向為什麼存在間隙?這是 ELF 文件的標準格式的一部分嗎?
與標準
od
命令 or一樣hd
,這意味著所有省略的行都與前一行相同。無論如何,您都可以通過-v
使其顯示這些行。來自hexdump(1)
:-v 選項使 hexdump 顯示所有輸入數據。如果沒有 -v 選項,任何數量的輸出行組,與前一組輸出行(輸入偏移除外)相同,都將替換為由單個星號組成的行。