Questions tagged [pyelftools]

pyelftools is a Python library for parsing ELF binaries and DWARF debugging information.

pyelftools is a pure-Python library for parsing and analyzing ELF files and DWARF debugging information. See the User's guide for more details.

13 questions
6
votes
3 answers

what the structure of dsym file?

What's structure of a dsym file generated when build the app. I know it contain DWARF debug info, but what's a dsym file. I want to read the DWARF info in it. Is it just a Mach-O binary file that contain only debug sections? How do I pass it to a…
leavez
  • 2,119
  • 2
  • 27
  • 36
2
votes
1 answer

Getting the memory layout out of an (avr)elf file by useing python + pyElftools

I am creating my own bootloader for an ATXmega128A4U. To use the bootloader I want to transform the ELF-file of the firmware into a memory map used in the the ATXmega. For that I use python and the modul "pyelftools". The documentation of it is…
Stefan Jaritz
  • 1,999
  • 7
  • 36
  • 60
1
vote
0 answers

How to find structure member memory address from dwarf debug information?

I'm trying to find structure member memory address(Non Virtual Memory, embedded) from dwarf. And there's two things i don't understand. First, In below dwarf Info1 DW_AT_location value = [3, 192, 63, 2, 128]. According to dwarf standards, [192, 63,…
SangYoon
  • 11
  • 2
1
vote
1 answer

Get address of member of struct using pyelftools

I am using the pyelftools to read an elf file. How can I get an offset value or address of a member in a struct? For example, say I have the following struct in C. typedef struct { int valA; } TsA; typedef struct { int valB; }…
Megool
  • 963
  • 2
  • 8
  • 29
1
vote
1 answer

How do I find a line of code with pyelftools/libdwarf

I have a function name and an offset from the top of that function. I know I can find the line of code from looking at the assembly listing file and compute the offset for the line of code and get the line number that way. What I'm trying to do is…
TreeWater
  • 761
  • 6
  • 13
1
vote
1 answer

How to MODIFY an ELF file with Python

I am trying to modify an ELF file's .text segment using python. I successfully acquired the .text field so then I can simply change the bit that I want. The thing is that pyelftools does not provide any way to generate an ELF file from the ELF…
ex1led
  • 427
  • 5
  • 21
1
vote
0 answers

Python: Listing members of a structure using pyelftools

I have a structure in C with several members and an ELF file. For instance I have the following typedef struct my_struct { int a; int c; char d; } MYSTRUCT_T; MYSTRUCT_T hello; How am I able to print out the members of hello? Or obtain…
Har
  • 3,727
  • 10
  • 41
  • 75
1
vote
1 answer

ELF Parsing : Accessing a DIE Directly using pyelftools

I need a method for accessing DIE's directly using their offset. So far, I have found that there is a method for the Computation Unit (CU) object in which you can access a DIE from its offset. I.e. :…
ncrosty
  • 11
  • 4
0
votes
1 answer

pyelftool get symbol absolute address

My Goal: use pyelftool to retrieve variables absolute placement and functions absolute address from an elf file to automatize breakpoint placement for whitebox testing. my code: import elftools from elftools.elf.elffile import…
Catosh
  • 163
  • 1
  • 2
  • 14
0
votes
1 answer

Efficient way to parse DWARF

I try to build a debugger which allows me to set breakpoints at functions or codelines. The needed debug information should be extracted from the DWARF section from an elf file. I am able to extract these data. The project I want to debug has 50-100…
Feanor
  • 3
  • 3
0
votes
1 answer

Grabbing program header information with pyelftools

I am simply trying to grab the program header information with pyelftools (the offset, virtual address, and physical address). This can be done from the terminal by running: readelf -l But I am having trouble getting the same information…
jipot
  • 304
  • 3
  • 13
  • 34
0
votes
0 answers

Processing the same file in multiple threads

I am trying to speed up how long it takes me to process a file in python. My idea is to split the task into n threads. For example, if I have a file that has 1300 items in it. I want each thread to process every nth item. Each item has no dependancy…
TreeWater
  • 761
  • 6
  • 13
-1
votes
1 answer

obtaining the instruction stream (byte or assembly) for function within a shared object file (ELF)

I am working on getting the instructions associated with a certain function within a shared object file (ELF). This shall be realized from a python script. I could do this certainly from the command line whereby the goal is not fire up cli commands…
Dennis1818
  • 53
  • 1
  • 7