给Ghidra装上ChatGPT
2023-1-1 22:55:3 Author: MicroPest(查看原文) 阅读量:13 收藏

    今天是2023年1月1日,新年第一天,祝大家新年快乐,身体健康,幸福如意!

    这篇文章接上一篇《阳生记三:GhidraThon》,系它的姐妹篇,Ghidra的ChatGPT插件,这个网上的过程介绍基本没有,有一定的繁琐难度,我也是费了不少劲才搞定的,作为新年礼物奉献给大家

ChatGPT for Ghidra的插件来源于:https://github.com/evyatar9/GptHidra。官方给出的解释是:GptHidra is a Ghidra plugin that uses the OpenAI Chat GPT to explain functions. 我们的目标是在Ghidra引入OpenAI来识别函数。

做法:将这个插件Py放入到ghidra_scripts目录下。

这个py下载下来后,有些问题,我们要作如下修改:

1、将import urllib2修改成 import urllib.request

2、将所有urllib2全部替换成urllib.request

3、将urllib.request.Request(url, data, 替换成urllib.request.Request(url, data.encode('utf-8'),

4、加入api-key,就是你在chat.openai.com中注册后生成的一个key

=========================

5、启动上篇中的Ghidra

6、选中一段函数代码:

7、运行:

8、给出答案:

GptHidra.py> Running...

This is a library function written in the C programming language for allocating memory from the heap. It takes a parameter of type __uint64 (which typically represents an unsigned 8-byte integer) and then attempts to allocate that amount of memory from the heap. If the allocation is successful, the pointer to that memory is returned. If it fails, it calls the _callnewh internal function and checks the return value. If the _callnewh function fails, it calls either FUN_1400010e4 or FUN_14000edac depending on the value of the parameter, and then calls the swi function with an argument of 3 to determine what to do next.

GptHidra.py> Finished!


文章来源: http://mp.weixin.qq.com/s?__biz=MjM5NDcxMDQzNA==&mid=2247487502&idx=1&sn=93a9636ffef86e26db760fc41772aff4&chksm=a682c6c391f54fd523e0a7c9bb06e74ad34873c3d2b09bc87965a4516867f6a33ce9d55cb8a2#rd
如有侵权请联系:admin#unsafe.sh