Elf
Elf
Bases: object
Minimal wrapper around pyelftools
to easily inspect ELF files.
Source code in util/sim/Elf.py
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 75 76 77 78 79 80 81 82 83 |
|
__init__(elf_path)
Default constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elf_path |
Path to an ELF binary. |
required |
Source code in util/sim/Elf.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
from_symbol(uid, ctype)
Returns an array with the contents of a global symbol.
The array is formatted from the raw byte contents returned by
get_raw_symbol_contents()
using the from_buffer()
function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
A global symbol. |
required | |
ctype |
C type identifier passed on to the
|
required |
Source code in util/sim/Elf.py
71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
get_raw_symbol_contents(uid)
Returns a bytearray with the contents of a global symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
A global symbol. |
required |
Source code in util/sim/Elf.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
get_symbol_address(uid)
Returns the address of a global symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
A global symbol. |
required |
Source code in util/sim/Elf.py
32 33 34 35 36 37 38 39 |
|
get_symbol_size(uid)
Returns the size of a global symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
A global symbol. |
required |
Source code in util/sim/Elf.py
41 42 43 44 45 46 47 48 |
|