Thursday, February 17, 2011

Print the sections of a binary (offset, length, name) in a nice and compact way

Source: https://gist.github.com/832028

Example:

$ sections /usr/bin/top
OFFSET     LENGTH     SECTION
0x00000200 0x0000001c .interp
0x0000021c 0x00000020 .note.ABI-tag
0x0000023c 0x00000024 .note.gnu.build-id
0x00000260 0x0000031c .hash
0x00000580 0x000000b4 .gnu.hash
0x00000638 0x00000960 .dynsym
0x00000f98 0x000003c7 .dynstr
0x00001360 0x000000c8 .gnu.version
0x00001428 0x00000050 .gnu.version_r
0x00001478 0x00000180 .rela.dyn
0x000015f8 0x00000738 .rela.plt
0x00001d30 0x00000018 .init
0x00001d48 0x000004e0 .plt
0x00002230 0x0000bbb8 .text
0x0000dde8 0x0000000e .fini
0x0000de00 0x00003184 .rodata
0x00010f84 0x000002cc .eh_frame_hdr
0x00011250 0x00000b1c .eh_frame
0x00012000 0x00000018 .ctors
0x00012018 0x00000010 .dtors
0x00012028 0x00000008 .jcr
0x00012030 0x000001c0 .dynamic
0x000121f0 0x00000008 .got
0x000121f8 0x00000280 .got.plt
0x00012480 0x00000788 .data
0x00012c08 0x00003240 .bss

No comments:

Post a Comment