Yet Another Golang binary parser for IDAPro python3版本使用说明此版本是在macos上 ida7.4+, python3.8.5 版本测试通过,如果在其他平台上测试存在问题,欢迎提issue或者pr。 另外需要注意,macos上ida7.4是使用系统默认安装的python3,这样可能导致自己安装的第三方库无法加载,需要切换到brew安装的python,具体的切换方法请参考 这个脚本 核心功能:- 自动定位 firstmoduledata 的位置并解析;
- 根据 firstmoduledata 中的信息定位到 pclntab(PC Line Table),并从 pclntab 入手解析、恢复函数符号,抽取源码文件列表;
- 解析 strings 和 string pointers;
- 根据 firstmoduledata 中的信息,解析所有 types 并为 types 各种属性打上有意义的 comment 或 dref;
- 解析 itab(Interface Table)。
Go 语言二进制文件中对逆向分析有帮助的信息如下: 另外,go_parser 还有两个很有用的特性: - 以上功能对于 buildmode=pie 类型的 Go binary 文件依然有效;
- 对于文件头信息尤其是 Section Header 信息损坏的二进制文件依然有效。
DDGMiner v5029 (MD5: 95199e8f1ab987cd8179a60834644663) 样本中核心的配置文件 struct 解析结果示例如下: 样本源码文件列表: 文件列表:- go_parser.py :整套工具的入口文件,在 IDAPro 中 [Alt+F7] 组合键,执行此脚本;
- common.py: 通用变量和函数定义;
- pclntbl.py: 解析 pclntab(PC Line Table);
- strings.py: 解析 strings 和 string pointers;
- moduldata.py: 解析 firstmoduledata;
- types_builder.py: 解析所有 types ;
- itab.py: 解析 itab(Interface Table);
另外, str_ptr.py 可以通过手动指定字符串指针数据的起始、结束位置来解析字符串指针。 Note- 此版本在 IDA7.4+,python3.8.5 上测试过,其他的 IDA 版本未经测试;
- strings 解析模块从 golang_loader_assist 移植过来,我自己又增加了 string pointers 解析的功能,目前只支持 x86 架构。
Refer
https://github.com/0xjiayu/go_parser/releases/ |