给Ghidra装上ChatGPT

admin 2023年1月2日16:31:35评论39 views字数 1223阅读4分4秒阅读模式

    今天是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、选中一段函数代码:

给Ghidra装上ChatGPT

7、运行:

给Ghidra装上ChatGPT

8、给出答案:

给Ghidra装上ChatGPT

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!


原文始发于微信公众号(MicroPest):给Ghidra装上ChatGPT

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年1月2日16:31:35
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   给Ghidra装上ChatGPThttps://cn-sec.com/archives/1494437.html

发表评论

匿名网友 填写信息