-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some problems about Section.data() #450
Comments
Looking at the section table of
Also
I don't know what you mean by assembly info stream, but if you expect the dissassemly of the .text section, that is not possible because pyelftools is not a dissassembler. For that you should be using a separate tool like objdump. For example
Hope that helps. |
@Absoler is this still an issue? |
Hi, I'm trying to extract assembly info from an object file, so I used ELFFile.get_section_by_name('.text') and Section.data(), like:
import sys
sys.path.insert(0, '.')
from elftools.elf.elffile import ELFFile
with open("/root/linux-master/drivers/tty/serial/earlycon.o", "rb") as f:
elf = ELFFile(f, sys.stdout)
text = elf.get_section_by_name('.text')
textInfo = text.stream.read()
print(len(textInfo))
addr = text['sh_addr']
code = text.data()
print(code)
However, the output content is:
3219
b""
And I don't understand why text.data() can't return the assembly info stream. related file is uploaded.
earlycon.zip
The text was updated successfully, but these errors were encountered: