|
32 | 32 |
|
33 | 33 | # 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)
|
34 | 34 | # 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 |
35 | 37 | # Example:
|
36 | 38 | # 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 |
39 | 42 | # ]
|
40 | 43 | 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') |
45 | 54 | ]
|
46 |
| -linux_files = [] |
47 | 55 | darwin_files = []
|
48 | 56 |
|
49 | 57 | # Function that determines whether Binary Ninja version is supported (returns None if not, according file name if yes)
|
50 | 58 | def is_version_supported(files):
|
51 | 59 | # Get current Binary Ninja version
|
52 | 60 | version_numbers = binaryninja.core_version().split()[0].split('-')[0].split('.')
|
53 | 61 | major, minor, build = map(int, version_numbers)
|
| 62 | + dev_file = None |
54 | 63 |
|
55 | 64 | # Loop through files for current platform and see if our version is supported by any
|
56 | 65 | for entry in files:
|
57 | 66 | min_ver, max_ver, file = entry
|
58 | 67 |
|
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('.') |
61 | 72 |
|
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])) |
65 | 76 |
|
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 |
68 | 81 |
|
| 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 | + |
69 | 86 | return None
|
70 | 87 |
|
71 | 88 | # Function that determines whether system is supported
|
|
0 commit comments