You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# if !plugin_found -> download plugin && create (or overwrite) current_native_plugin_data file containing latest ver and latest hash
11
+
# if plugin_found && ver != latest_ver && ver != none && hash == downloaded plugin hash -> alert user he is using outdated plugin (with link to latest release)
12
+
# if plugin_found && ver != latest_ver && ver != none && hash != downloaded plugin hash -> delete current_native_plugin_data file &&
13
+
# download latest plugin to temp, calculate its hash &&
14
+
# if latest_hash == downloaded plugin hash -> save latest_hash and latest_ver to current_native_plugin_data file &&
15
+
# delete file in temp
16
+
# if plugin_found && ver == latest_ver && hash != downloaded plugin hash -> delete current_native_plugin_data file && download latest plugin to temp, calculate its hash &&
17
+
# if latest_hash == downloaded plugin hash -> save latest_hash and latest_ver to current_native_plugin_data file &&
18
+
# delete file in temp
19
+
# if latest_hash != downloaded plugin hash -> alert to update (with link to latest release)
20
+
# if plugin_found && ver == none && hash == none -> download latest plugin to temp, calculate its hash &&
21
+
# if latest_hash == downloaded plugin hash -> save latest_hash and latest_ver to current_native_plugin_data file &&
22
+
# delete file in temp
23
+
# if latest_hash != downloaded plugin hash -> alert to update (with link to latest release)
24
+
25
+
# Function that determines whether system is supported
26
+
defis_system_supported(file_name):
27
+
returnfile_name!=Noneandlen(file_name) >0
28
+
29
+
# Function that determines whether native_plugins_data folder exists
alert_user(plugin_name, 'You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
197
+
# Plugin installed, but data shows it's outdated
198
+
elif (data_version!=latest_version):
199
+
# Make sure the version in the data directory is actually the version we have installed (we compare hashes - hash now and hash when we downloaded the plugin)
200
+
if (data_hash==calculate_hash(os.path.join(binaryninja.user_plugin_path(), file))):
201
+
# Yep, version noted in data corresponds to the hash of currently installed plugin
202
+
alert_user(plugin_name, 'You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
203
+
else:
204
+
# Nope, version noted in data doesn't correspond to the hash of currently installed plugin (user probably replaced the plugin)
205
+
delete_data_file(plugin_name)
206
+
# Download latest version of the plugin and check if we have that version
207
+
download_file_to_temp(file_url, file)
208
+
if (calculate_hash(os.path.join(binaryninja.user_plugin_path(), file)) ==calculate_hash(os.path.join(binaryninja.user_plugin_path(), 'temp', file))):
209
+
# We have the latest version, register it in data directory so user is not prompted to update as he probably already did
alert_user(plugin_name, 'You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
215
+
# Plugin installed, data shows it's up to date, but let's make sure
216
+
elif (data_version==latest_version):
217
+
# Make sure the version in the data directory is actually the version we have installed (we compare hashes - hash now and hash when we downloaded the plugin)
218
+
if (data_hash!=calculate_hash(os.path.join(binaryninja.user_plugin_path(), file))):
219
+
# Nope, hash noted in data doesn't correspond to the hash of currently installed plugin (user probably replaced the plugin with different version)
220
+
delete_data_file(plugin_name)
221
+
# Let's check if our plugin matches the hash in the latest github release (developer could have replaced file in the github release and user updated to it)
222
+
download_file_to_temp(file_url, file)
223
+
if (calculate_hash(os.path.join(binaryninja.user_plugin_path(), file)) ==calculate_hash(os.path.join(binaryninja.user_plugin_path(), 'temp', file))):
224
+
# Yep, hash of the plugin in the github release corresponds to the hash of currently installed plugin so we have the latest one
# Not the latest one (according to the hash in the github release), but user might be intending to test different version of the plugin, add ignore option
229
+
alert_user(plugin_name, 'You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
230
+
else:
231
+
alert_user(plugin_name, 'This plugin is not supported on current platform or plugin not found or its github releases not found')
"longdescription": "This plugin allows to scan analyzed binaries for signatures or create them. Supports both normal signatures (e.g. 49 28 15 ? ? 30) and commonly used code signatures (e.g. \"\\x49\\x28\\x15\\x00\\x00\\x30\", \"xxx??x\").\n\nAs title suggests, it is coded in C++ and utilizes Binary Ninja's native API. For this reason this plugin serves just as a loader for the [actual plugin](https://github.com/rikodot/binja_native_sigscan).\n\nCurrently works on Windows only!",
13
-
"license": {
14
-
"name": "MIT",
15
-
"text": "MIT License\n\nCopyright (c) 2023 rikodot\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": [
18
-
"Windows"
19
-
],
20
-
"installinstructions": {
21
-
"Windows": ""
22
-
},
23
-
"dependencies": {
24
-
"pip": ["requests"]
25
-
},
26
-
"version": "1.0.0",
27
-
"author": "rikodot",
28
-
"minimumbinaryninjaversion": 0
29
-
}
2
+
"pluginmetadataversion":2,
3
+
"name":"Native SigScan",
4
+
"type":[
5
+
"helper"
6
+
],
7
+
"api":[
8
+
"python2",
9
+
"python3"
10
+
],
11
+
"description":"Find and create signatures",
12
+
"longdescription":"This plugin allows to scan analyzed binaries for signatures or create them. Supports both normal signatures (e.g. 49 28 15 ? ? 30) and commonly used code signatures (e.g. \"\\x49\\x28\\x15\\x00\\x00\\x30\", \"xxx??x\").\n\nAs title suggests, it is coded in C++ and utilizes Binary Ninja's native API. For this reason this plugin serves just as a loader for the [actual plugin](https://github.com/rikodot/binja_native_sigscan).\n\nCurrently works on Windows only!",
13
+
"license":{
14
+
"name":"MIT",
15
+
"text":"MIT License\n\nCopyright (c) 2023 rikodot\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."
0 commit comments