分析MIPS二进制文件:是否有用于解析二进制数据的Python库?

编程入门 行业动态 更新时间:2024-10-24 14:21:15
本文介绍了分析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上找不到libdwarf,libelf或libbfd,在dwarfstd上也没有提及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, nor any mention of python on dwarfstd.

某处有合适的模块吗?

推荐答案

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

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

更多推荐

分析MIPS二进制文件:是否有用于解析二进制数据的Python库?

本文发布于:2023-10-09 18:11:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476420.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:二进制文件   二进制数   MIPS   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!