-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
74 lines (53 loc) · 2.13 KB
/
README
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
74
Python-ELF
==========
Python-ELF is a python library targeting ELF binary format manipulation.
It is OS and machine independant, or tends to be. It has nothing new nor
nothing better than existing libraries and currently is suffers from lacks
which makes it much more a draft than anything else. So for a real usage,
consider using something else.
Its goal it to make, anyway, static ELF binary manipulation easy. The Q&D
dumpelf.py is an example on how current ease of use level is.
Contributions are welcome!
Features
--------
It can read and interpret "allmost" any ELF-specific part in an ELF binary.
E.g.: it cannot intepret DWARF2 specific sections.
Limitations
-----------
- no writing capabilities... coming soon
- doet not yet interpret machine specific data, though necessary values interpreters
are already present.
- No version part interpretation.
- Only basic relocation interpretation
- Prone to error while binary owns anti-re tricks. (could be easily fixed, some case
are already handled)
Design
------
Everything in python-elf is thought and handled as a "chunk". An ELF file is a chunk
made of multiple other chunks.
Headers in ELF are chunks. Due to the fact that all section and program part possess a
header, there is a class representing a chunk with a header: the page.
Here is a quick overview on the basic design:
--> Chunk <--
| |
| |
Header - - - - Page
Section, Program and Note classes are sub-classes of Page so they embed their respective
headers. This simplify then the relationshid within this two chunk (e.g. a section and its
header).
Using python-elf
----------------
(through python interpreter)
>>> from elf.elf_binary import Elf
>>> bin = Elf("/some/path/some_file_name")
>>>
Some printer helper functions can be found in from elf.printers import printHeader
It prints out only headers of course, in a human readable way.
Important note
--------------
As any other ELF manipulation library, you MUST know how ELF format is made to use
python-elf.
Contact
-------
For any further information, help, ideas, contributions, critics: contact
the author: [email protected]