Skip to content

Commit 549044a

Browse files
committed
better dev support, linux binaries
1 parent dd23bb4 commit 549044a

File tree

2 files changed

+36
-17
lines changed

2 files changed

+36
-17
lines changed

__init__.py

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,57 @@
3232

3333
# File names in release section on github along with Binary Ninja versions for which they were compiled (leave whole variable blank if platform not supported)
3434
# Both version variables are inclusive meaning any Binary Ninja version in between is supported, DO NOT include '-dev' suffix so instead of '3.4.4189-dev', use just '3.4.4189')
35+
# You can also support all dev version by replacing both versions with 'DEV' (example below), this is useful because new dev versions roll out almost on daily basis
36+
# but the problem is when dev version becomes stable, the loader must be updated accordingly
3537
# Example:
3638
# win_files = [
37-
# ('3.1.3469', '3.3.3996', 'sigscan.dll'),
38-
# ('3.4.4169', '3.4.4189', 'sigscan_dev.dll')
39+
# ('3.1.3469', '3.3.3996', 'sigscan.dll'), # anything in between 3.1.3469 and 3.3.3996 (inclusive) - specific stable versions
40+
# ('3.4.4169', '3.4.4189', 'sigscan_dev.dll'), # anything in between 3.4.4169 and 3.4.4189 (inclusive) - specific dev versions
41+
# ('DEV', 'DEV', 'sigscan_dev2.dll'), # anything in between 3.4.4169 and 3.4.4189 (inclusive) - all dev versions
3942
# ]
4043
win_files = [
41-
('3.1.3469', '3.1.3469', 'sigscan_3469.dll'),
42-
('3.2.3814', '3.2.3814', 'sigscan_3814.dll'),
43-
('3.3.3996', '3.3.3996', 'sigscan.dll'),
44-
('3.4.4169', '3.4.4189', 'sigscan_dev.dll')
44+
('3.1.3469', '3.1.3469', '3469sigscan.dll'),
45+
('3.2.3814', '3.2.3814', '3814sigscan.dll'),
46+
('3.3.3996', '3.3.3996', '3996sigscan.dll'),
47+
('DEV', 'DEV', '4203sigscan.dll')
48+
]
49+
linux_files = [
50+
('3.1.3469', '3.1.3469', '3469libsigscan.so'),
51+
('3.2.3814', '3.2.3814', '3814libsigscan.so'),
52+
('3.3.3996', '3.3.3996', '3996libsigscan.so'),
53+
('DEV', 'DEV', '4203libsigscan.so')
4554
]
46-
linux_files = []
4755
darwin_files = []
4856

4957
# Function that determines whether Binary Ninja version is supported (returns None if not, according file name if yes)
5058
def is_version_supported(files):
5159
# Get current Binary Ninja version
5260
version_numbers = binaryninja.core_version().split()[0].split('-')[0].split('.')
5361
major, minor, build = map(int, version_numbers)
62+
dev_file = None
5463

5564
# Loop through files for current platform and see if our version is supported by any
5665
for entry in files:
5766
min_ver, max_ver, file = entry
5867

59-
min_parts = min_ver.split('.')
60-
max_parts = max_ver.split('.')
68+
# first check all non dev versions (there might be specific binary for specific dev versions so use that and if none found then we can use binary for all dev versions)
69+
if (min_ver != 'DEV' and max_ver != 'DEV'):
70+
min_parts = min_ver.split('.')
71+
max_parts = max_ver.split('.')
6172

62-
major_match = (major >= int(min_parts[0]) and major <= int(max_parts[0]))
63-
minor_match = (minor >= int(min_parts[1]) and minor <= int(max_parts[1]))
64-
build_match = (build >= int(min_parts[2]) and build <= int(max_parts[2]))
73+
major_match = (major >= int(min_parts[0]) and major <= int(max_parts[0]))
74+
minor_match = (minor >= int(min_parts[1]) and minor <= int(max_parts[1]))
75+
build_match = (build >= int(min_parts[2]) and build <= int(max_parts[2]))
6576

66-
if major_match and minor_match and build_match:
67-
return file
77+
if major_match and minor_match and build_match:
78+
return file
79+
else:
80+
dev_file = file
6881

82+
# If we are on dev, check if there is a file for all dev versions
83+
if ('-dev' in binaryninja.core_version() and dev_file != None and len(dev_file) > 0):
84+
return dev_file
85+
6986
return None
7087

7188
# Function that determines whether system is supported

plugin.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@
1515
"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."
1616
},
1717
"platforms":[
18-
"Windows"
18+
"Windows",
19+
"Linux"
1920
],
2021
"installinstructions":{
21-
"Windows":""
22+
"Windows":"",
23+
"Linux":""
2224
},
2325
"dependencies":{
2426
"pip":[
2527
"requests",
2628
"bs4"
2729
]
2830
},
29-
"version":"1.0.3",
31+
"version":"1.0.4",
3032
"author":"rikodot",
3133
"minimumbinaryninjaversion":0
3234
}

0 commit comments

Comments
 (0)