Skip to content

Commit

Permalink
Update README.md sample output
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshKapadia2 committed Sep 13, 2024
1 parent 7cf18e0 commit 43d1385
Showing 1 changed file with 39 additions and 37 deletions.
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ This utility is a part of [my talk on ELFs](https://talks.harshkapadia.me/elf).
$ make
gcc -Wall -pedantic -I include src/pelf.c -o pelf
chmod +x pelf

$ ./pelf "/usr/bin/vim"
64-bit ELF File Parser

Expand Down Expand Up @@ -81,7 +82,8 @@ ELF File 'File Header':
-> No. of program (segment) headers: 13
-> Section header size: 64 B
-> No. of section headers: 30
-> Section headers' string table's index: Index '29' in section headers
-> Index of the 'section name string table' section header in the section header
table: 29


ELF File Section Headers:
Expand All @@ -91,35 +93,35 @@ ELF File Section Headers:
Size EntSize Flags Link Info Align
---------------------------------------------------------------------
[0]
0 0 0
NULL 0 0
0 0 0 0 0 0
---------------------------------------------------------------------
[1] .interp
0x1 0x318 792
PROGBITS 0x318 792
28 0 0x2 0 0 1
---------------------------------------------------------------------
[2] .note.gnu.property
0x7 0x338 824
NOTE 0x338 824
48 0 0x2 0 0 8
---------------------------------------------------------------------
[3] .note.gnu.build-id
0x7 0x368 872
NOTE 0x368 872
36 0 0x2 0 0 4
---------------------------------------------------------------------
[4] .note.ABI-tag
0x7 0x38c 908
NOTE 0x38c 908
32 0 0x2 0 0 4
---------------------------------------------------------------------
[5] .gnu.hash
0x6ffffff6 0x3b0 944
240 0 0x2 6 0 8
---------------------------------------------------------------------
[6] .dynsym
0xb 0x4a0 1184
DYNSYM 0x4a0 1184
8568 24 0x2 7 1 8
---------------------------------------------------------------------
[7] .dynstr
0x3 0x2618 9752
STRTAB 0x2618 9752
4267 0 0x2 0 0 1
---------------------------------------------------------------------
[8] .gnu.version
Expand All @@ -131,83 +133,83 @@ ELF File Section Headers:
320 0 0x2 7 5 8
---------------------------------------------------------------------
[10] .rela.dyn
0x4 0x3ad0 15056
RELA 0x3ad0 15056
202464 24 0x2 6 0 8
---------------------------------------------------------------------
[11] .rela.plt
0x4 0x351b0 217520
RELA 0x351b0 217520
7704 24 0x42 6 25 8
---------------------------------------------------------------------
[12] .init
0x1 0x37000 225280
PROGBITS 0x37000 225280
27 0 0x6 0 0 4
---------------------------------------------------------------------
[13] .plt
0x1 0x37020 225312
PROGBITS 0x37020 225312
5152 16 0x6 0 0 16
---------------------------------------------------------------------
[14] .plt.got
0x1 0x38440 230464
PROGBITS 0x38440 230464
48 16 0x6 0 0 16
---------------------------------------------------------------------
[15] .plt.sec
0x1 0x38470 230512
PROGBITS 0x38470 230512
5136 16 0x6 0 0 16
---------------------------------------------------------------------
[16] .text
0x1 0x39880 235648
PROGBITS 0x39880 235648
2845383 0 0x6 0 0 16
---------------------------------------------------------------------
[17] .fini
0x1 0x2f0348 3081032
PROGBITS 0x2f0348 3081032
13 0 0x6 0 0 4
---------------------------------------------------------------------
[18] .rodata
0x1 0x2f1000 3084288
PROGBITS 0x2f1000 3084288
166822 0 0x2 0 0 32
---------------------------------------------------------------------
[19] .eh_frame_hdr
0x1 0x319ba8 3251112
PROGBITS 0x319ba8 3251112
37684 0 0x2 0 0 4
---------------------------------------------------------------------
[20] .eh_frame
0x1 0x322ee0 3288800
PROGBITS 0x322ee0 3288800
265108 0 0x2 0 0 8
---------------------------------------------------------------------
[21] .init_array
0xe 0x365230 3555888
INIT_ARRAY 0x365230 3555888
8 8 0x3 0 0 8
---------------------------------------------------------------------
[22] .fini_array
0xf 0x365238 3555896
FINI_ARRAY 0x365238 3555896
8 8 0x3 0 0 8
---------------------------------------------------------------------
[23] .data.rel.ro
0x1 0x365240 3555904
PROGBITS 0x365240 3555904
65792 0 0x3 0 0 32
---------------------------------------------------------------------
[24] .dynamic
0x6 0x375340 3621696
DYNAMIC 0x375340 3621696
608 16 0x3 7 0 8
---------------------------------------------------------------------
[25] .got
0x1 0x3755a0 3622304
PROGBITS 0x3755a0 3622304
2648 8 0x3 0 0 8
---------------------------------------------------------------------
[26] .data
0x1 0x376000 3624960
PROGBITS 0x376000 3624960
160601 0 0x3 0 0 32
---------------------------------------------------------------------
[27] .bss
0x8 0x39d360 3785561
NOBITS 0x39d360 3785561
58176 0 0x3 0 0 32
---------------------------------------------------------------------
[28] .gnu_debuglink
0x1 0 3785564
PROGBITS 0 3785564
52 0 0 0 0 4
---------------------------------------------------------------------
[29] .shstrtab
0x3 0 3785616
STRTAB 0 3785616
285 0 0 0 0 1
---------------------------------------------------------------------

Expand All @@ -217,31 +219,31 @@ ELF File Segment (Program) Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
---------------------------------------------------------------------
0x6 0x40 0x40 0x40
PHDR 0x40 0x40 0x40
0x2d8 0x2d8 0x4 0x8
---------------------------------------------------------------------
0x3 0x318 0x318 0x318
INTERP 0x318 0x318 0x318
0x1c 0x1c 0x4 0x1
---------------------------------------------------------------------
0x1 0 0 0
LOAD 0 0 0
0x36fc8 0x36fc8 0x4 0x1000
---------------------------------------------------------------------
0x1 0x37000 0x37000 0x37000
LOAD 0x37000 0x37000 0x37000
0x2b9355 0x2b9355 0x5 0x1000
---------------------------------------------------------------------
0x1 0x2f1000 0x2f1000 0x2f1000
LOAD 0x2f1000 0x2f1000 0x2f1000
0x72a74 0x72a74 0x4 0x1000
---------------------------------------------------------------------
0x1 0x364230 0x365230 0x365230
LOAD 0x364230 0x365230 0x365230
0x38129 0x46470 0x6 0x1000
---------------------------------------------------------------------
0x2 0x374340 0x375340 0x375340
DYNAMIC 0x374340 0x375340 0x375340
0x260 0x260 0x6 0x8
---------------------------------------------------------------------
0x4 0x338 0x338 0x338
NOTE 0x338 0x338 0x338
0x30 0x30 0x4 0x8
---------------------------------------------------------------------
0x4 0x368 0x368 0x368
NOTE 0x368 0x368 0x368
0x44 0x44 0x4 0x4
---------------------------------------------------------------------
0x6474e553 0x338 0x338 0x338
Expand Down

0 comments on commit 43d1385

Please sign in to comment.