|
||
---|---|---|
dwex | ||
.gitignore | ||
LICENSE | ||
main.py | ||
README.md |
Elf-symbols
Extract and expand the symbols based on their type from the ELF files with debug DWARF information
Usability
The symbol table of ELF file only contains the names of the top global variables, which is only useful when the name of the top variable is known. This script provide a way to search for a variable based on its type and the members of the said type (eg. structure members).
In short, search from bottom to top, instead of from top to bottom.
Usage
Use --help
from more information
main.py [options] [elf_file]
Output
> python main.py ../Playground_C/build/playground_c
0x4030 my_stuff
0x4030 my_stuff.first
0x4030 my_stuff.first.number_1
0x4038 my_stuff.first.number_2
0x403c my_stuff.first.number_3
0x403e my_stuff.first.number_4
0x403f my_stuff.first.number_5
0x4040 my_stuff.second
0x4038 my_little_stuff
0x4038 my_little_stuff.one
0x4038 my_little_stuff.two
0x4040 my_small_stuff
0x4040 my_small_stuff.one
0x4040 my_small_stuff.one[0]
...
0x4057 my_small_stuff.one[23]
0x4040 my_small_stuff.structure
0x4040 my_small_stuff.structure.first
0x4040 my_small_stuff.structure.first.number_1
0x4048 my_small_stuff.structure.first.number_2
0x404c my_small_stuff.structure.first.number_3
0x404e my_small_stuff.structure.first.number_4
0x404f my_small_stuff.structure.first.number_5
0x4050 my_small_stuff.structure.second
0x4060 thing
0x4060 thing.first
0x4060 thing.first.number_1
0x4068 thing.first.number_2
0x406c thing.first.number_3
0x406e thing.first.number_4
0x406f thing.first.number_5
0x4070 thing.second
Similar programs
I am sure there are multiple programs which can do the same or similar thing to this script. I simply do not know about them.
Vector CANApe
Similar feature is available in Vector CANApe, which can extract symbols and its children (structure members) and add it to its database which can than be searched.
While this is nice, it has its own limitation, such as:
- Only ONE instance of CANApe can run at once
- Editing the database can be tricky and may take a long time
- Licensing is costly for home use
Elf wrapper
A script which returns the address of the global variable. This script parses the arrays and structs, but the user needs to know what he wants before executing the script.
Can be found in corporate lands.
Licensing
This script is based on dwex
DWarf EXplorer by "Seva Alekseyev". The
original source code of dwex
can be found on
GitHub
The code taken from dwex
is located in the "dwex" directory together
with a LICENSE file.
My code main.py
is licensed under GPLv3.