-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathelfcat.1
73 lines (73 loc) · 1.74 KB
/
elfcat.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.\" Copyright (C) 2016 Gabriel Corona. MIT License.
.Dd January 16, 2016
.Dt ELFCAT 1
.Os
.Sh NAME
.Nm elfcat
.Nd dump sections, segments of an ELF file
.Sh SYNOPSIS
.Nm
.Op Fl -help
.Op Fl -version
.Op Fl -section-name Ar name
.Op Fl -section-index Ar index
.Op Fl -program-index Ar
.Op Ar elf-names
.Sh DESCRIPTION
.Nm
dumps requested parts (sections and segments) of an ELF file
(executable, shared object, \.o file) to stdout.
.Pp
Dumping sections can be achieved with
.Qq objcopy --dump-section
but this tools relies on BFD which abstracts
all executable files and is not able to see some ELF sections.
Moreover, it cannot handle program header table entries.
.Pp
Supported options are:
.Bl -tag -width "--section-index index" -compact
.It Fl -help
Help
.It Fl -version
Version information
.It Fl -section-name Ar name
Dump a section with a given
.Ar name .
.It Fl -section-index Ar index
Dump a section found by its
.Ar index
in the section table.
.It Fl -program-index
Dump a part of the ELF file described by a program header found by its
index.
.El
.Sh EXIT STATUS
If everything goes well,
.Nm
exits with 0.
If anything bad happens, it exits with a nonzero value.
.Sh EXAMPLES
.Bd -literal -offset indent
elfcat --section-name .dynstr /bin/sh | tr '\\000' '\\n'
.Ed
.Pp
Print the content of the dynamic string table. Each entry is
terminated by a
.Va NUL
byte in the
.Vt FILE
so we use
.Qq tr
in order to display it in a more human-friendly form.
.Sh SEE ALSO
.Lk https://github.com/randomstuff/elfcat/ "Git repo"
.Sh STANDARDS
.Lk http://www.sco.com/developers/devspecs/gabi41.pdf "System V Application Binary Interface, Edition 4.1"
.Sh AUTHORS
Written by
.An -nosplit
.An Gabriel Corona
and
.An Kamil Rytarowski .
.Pp
Copyright (C) 2016 Gabriel Corona. MIT License.