12

Python 有没有能从 elf 文件中解析出函数调用关系的 lib?

 3 years ago
source link: https://www.v2ex.com/t/780697
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Python

Python 有没有能从 elf 文件中解析出函数调用关系的 lib?

  XIVN1987 · 1 小时 1 分钟前 · 102 次点击

我现在是用 fromelf 生成反汇编文件,然后再用正则表达式从反汇编文件中解析出函数调用关系(单片机程序,只有几十 K )

但是反汇编文件本身没有标准,每个编译器生成的反汇编文件格式都不一样,,而且还会随着时间变化,,不方便维护

我就想,fromelf 能从 elf 文件解析出函数调用关系,那说明 elf 文件中是存储了这种信息的,而 elf 格式本身是标准化的,,那直接从 elf 文件中解析函数调用关系岂不是更稳定、更全面

网上搜到的 elf 解析库主要是 pyelftools,,但是感觉它只能解析 elf 文件的各种 header 和符号表,,似乎没有解析函数调用关系的能力

请问各位大佬,,python 有 lib 能实现这种功能吗?


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK