Skip to content

Commit 80f0eac

Browse files
authored
Merge pull request #10 from WhatTheFuzz/fix/plugin
Validate plugin with Binary Ninja's validation tool.
2 parents 86befe1 + 7b4b6aa commit 80f0eac

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@
22

33
# BinaryNinja-OpenAI
44

5-
Integrates OpenAI with BinaryNinja via a plugin.
5+
Integrates OpenAI's GPT3 with BinaryNinja via a plugin. Creates a query asking
6+
"What does this function do?" followed by the instructions in the High Level IL
7+
function. Returns the response to the user in Binary Ninja's console.
68

79
## Installation
810

911
If you're installing this as a standalone plugin, you can place (or sym-link)
1012
this in BinaryNinja's plugin path. Default paths are detailed on
1113
[Vector 35's documentation][default-plugin-dir].
1214

15+
This plugin has been tested on macOS and Linux. It probably works on Windows;
16+
please submit a pull request if you've test it.
17+
18+
### Dependencies
19+
20+
- Python 3.10+
21+
- `openai` installed with `pip3 install --user openai`
22+
1323
## API Key
1424

1525
This requires an [API token from OpenAI][token]. The plugin checks for the API
@@ -76,7 +86,7 @@ This project is licensed under the [MIT license][license].
7686

7787
[default-plugin-dir]:https://docs.binary.ninja/guide/plugins.html
7888
[token]:https://beta.openai.com/account/api-keys
79-
[entry]:./entry.py
89+
[entry]:./src/entry.py
8090
[asyncio]:https://docs.python.org/3/library/asyncio.html
8191
[issue-8]:https://github.com/WhatTheFuzz/binaryninja-openai/issues/8
8292
[license]:./LICENSE

plugin.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
{
2-
"pluginmetadataversion": 1,
3-
"name": "OpenAI",
4-
"type": [
2+
"pluginmetadataversion": 2,
3+
"name": "OpenAI GPT3",
4+
"author": "Sean Deaton (@WhatTheFuzz)",
5+
"type": [
56
"helper"
6-
],
7-
"api": [
7+
],
8+
"api": [
89
"python3"
9-
],
10-
"description": "Queries OpenAI to see what a function does in a given IL or pseudo-C.",
11-
"longdescription": "",
12-
"license": {
10+
],
11+
"description": "Queries OpenAI's GPT3 to determine what a given function does.",
12+
"longdescription": "Generates a query that asks 'What does this function do?' followed by a list of the instructions in the function. Returns the result from GPT3 and displays it to the user in the Binary Ninja console. Requires an OpenAI API key.",
13+
"license": {
1314
"name": "MIT",
14-
"text": "Copyright (c) 2022 Sean Deaton (@WhatTheFuzz)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
15-
},
16-
"platforms": [
15+
"text": "Copyright 2022 Sean Deaton (@WhatTheFuzz)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
16+
},
17+
"platforms": [
1718
"Darwin",
18-
"Linux",
19-
"Windows"
20-
],
21-
"installinstructions": {
22-
"Darwin": "pip3 install --user openai\nUnder your OpenAI account, create an API key and set it to the environment variable OPENAI_API_KEY; ie export OPENAI_API_KEY=<KEY_HERE>",
23-
"Linux": "pip3 install --user openai\nUnder your OpenAI account, create an API key and set it to the environment variable OPENAI_API_KEY; ie export OPENAI_API_KEY=<KEY_HERE>",
24-
"Windows": "You're on your own."
25-
},
26-
"dependencies": {
19+
"Linux"
20+
],
21+
"installinstructions": {
22+
"Darwin": "pip3 install --user openai. Under your OpenAI account, create an API key and set it to the environment variable OPENAI_API_KEY inside Binary Ninja's Python console.",
23+
"Linux": "pip3 install --user openai. Under your OpenAI account, create an API key and set it to the environment variable OPENAI_API_KEY inside Binary Ninja's Python console."
24+
},
25+
"dependencies": {
2726
"pip": [
28-
"openai"
29-
],
30-
},
31-
"version": "1.0.0",
32-
"author": "Sean Deaton (@WhatTheFuzz)",
33-
"minimumbinaryninjaversion": 3164
34-
}
27+
"openai"
28+
]
29+
},
30+
"version": "1.0.0",
31+
"minimumbinaryninjaversion": 3200
32+
}

0 commit comments

Comments
 (0)