分析MIPS二进制文件:是否有用于解析二进制数据的Python库? [英] Analizing MIPS binaries: is there a Python library for parsing binary data?

查看:142
本文介绍了分析MIPS二进制文件:是否有用于解析二进制数据的Python库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个实用程序,该实用程序需要将十六进制地址解析为二进制内的符号函数名称和源代码行号.该实用程序将在x86的Linux上运行,尽管它分析的二进制文件将用于基于MIPS的嵌入式系统. MIPS二进制文件采用ELF格式,并使用DWARF作为符号调试信息.

I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF format, using DWARF for the symbolic debugging information.

我目前正计划分叉objdump,传入十六进制地址列表并解析输出以获取函数名称和源代码行号.我已经编译了一个支持MIPS二进制文件的objdump,并且可以正常工作.

I'm currently planning to fork objdump, passing in a list of hex addresses and parsing the output to get function names and source line numbers. I have compiled an objdump with support for MIPS binaries, and it is working.

我更希望有一个软件包,该软件包可以让我从Python代码中本机查找内容,而无需进行其他处理.在python.org上找不到libdwarf,libelf或libbfd,在dwarfstd.org上也没有提及python.

I'd prefer to have a package allowing me to look things up natively from the Python code without forking another process. I can find no mention of libdwarf, libelf, or libbfd on python.org, nor any mention of python on dwarfstd.org.

某处有合适的模块吗?

推荐答案

请检查 pyelftools -一个新纯Python库就是要做到这一点.

Please check pyelftools - a new pure Python library meant to do this.

这篇关于分析MIPS二进制文件:是否有用于解析二进制数据的Python库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆