#-------------------------------------------------------------------------------# elftools## Eli Bendersky (eliben@gmail.com)# This code is in the public domain#-------------------------------------------------------------------------------# Just a script for playing around with pyelftools during testing# please ignore it!#from __future__ import print_functionimport sys, pprintfrom elftools.elf.structs import ELFStructsfrom elftools.elf.elffile import ELFFilefrom elftools.elf.sections import *from elftools.elf.relocation import *stream = open('test/testfiles/exe_simple64.elf', 'rb')efile = ELFFile(stream)print('elfclass', efile.elfclass)print('===> %s sections!' % efile.num_sections())print(efile.header)dinfo = efile.get_dwarf_info()from elftools.dwarf.locationlists import LocationListsfrom elftools.dwarf.descriptions import describe_DWARF_exprllists = LocationLists(dinfo.debug_loc_sec.stream, dinfo.structs)for loclist in llists.iter_location_lists():print('----> loclist!')for li in loclist:print(li)print(describe_DWARF_expr(li.loc_expr, dinfo.structs))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。