diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2021-03-26 16:03:51 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2021-03-26 16:03:51 -0400 |
| commit | 89fa6e3b285f2f83ff0e5d1c5b9907b1f4c33410 (patch) | |
| tree | 71945d3cf828c004b8b6b85878919448fd9df982 | |
| parent | 558ba0464a340514c7ba26b2f8ad458844ab92c3 (diff) | |
updating to latest sphinx-rtd theme and many doc formatting fixes
| -rw-r--r-- | api-docs/source/conf.py | 19 | ||||
| -rw-r--r-- | python/__init__.py | 2 | ||||
| -rw-r--r-- | python/architecture.py | 9 | ||||
| -rw-r--r-- | python/binaryview.py | 22 | ||||
| -rw-r--r-- | python/enum/__init__.py | 2 | ||||
| -rw-r--r-- | python/function.py | 23 | ||||
| -rw-r--r-- | python/interaction.py | 76 | ||||
| -rw-r--r-- | python/platform.py | 36 | ||||
| -rw-r--r-- | python/pluginmanager.py | 8 | ||||
| -rw-r--r-- | python/scriptingprovider.py | 10 | ||||
| m--------- | sphinx_rtd_theme | 0 |
11 files changed, 111 insertions, 96 deletions
diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index 1d0cc019..39d67f78 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -38,7 +38,7 @@ binaryninja._init_plugins() #force license check def modulelist(modulename): modules = inspect.getmembers(modulename, inspect.ismodule) - return sorted(set(x for x in modules if x[0] not in ("abc", "atexit", "binaryninja", "builtins", "ctypes", "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", "json", "numbers", "threading", "re", "requests", "os", "startup", "associateddatastore", "range", "pyNativeStr", "with_metaclass", "cstr", "fnsignature", "get_class_members", "datetime", "inspect"))) + return sorted(set(x for x in modules if x[0] not in ("abc", "atexit", "binaryninja", "builtins", "ctypes", "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", "json", "numbers", "threading", "re", "requests", "os", "startup", "associateddatastore", "range", "pyNativeStr", "with_metaclass", "cstr", "fnsignature", "get_class_members", "datetime", "inspect", "subprocess"))) def classlist(module): members = inspect.getmembers(module, inspect.isclass) @@ -62,27 +62,28 @@ def generaterst(): ''') for modulename, module in modulelist(binaryninja): - filename = 'binaryninja.{module}-module.rst'.format(module=modulename) - pythonrst.write(' {module} <{filename}>\n'.format(module=modulename, filename=filename)) + filename = f'binaryninja.{modulename}-module.rst' + pythonrst.write(f' {modulename} <{filename}>\n') modulefile = open(filename, "w") - modulefile.write('''{module} module -===================== + underline = "="*len(f'{modulename} module') + modulefile.write(f'''{modulename} module +{underline} .. autosummary:: :toctree: -'''.format(module=modulename)) +''') for (classname, classref) in classlist(module): - modulefile.write(" binaryninja.{module}.{classname}\n".format(module=modulename, classname=classname)) + modulefile.write(f" binaryninja.{modulename}.{classname}\n") modulefile.write('''\n.. toctree:: :maxdepth: 2\n''') - modulefile.write('''\n\n.. automodule:: binaryninja.{module} + modulefile.write(f'''\n\n.. automodule:: binaryninja.{modulename} :members: :undoc-members: - :show-inheritance:'''.format(module=modulename)) + :show-inheritance:''') modulefile.close() pythonrst.write('''.. automodule:: binaryninja diff --git a/python/__init__.py b/python/__init__.py index b7736f2f..cb8bc555 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -235,7 +235,7 @@ def open_view(*args, **kwargs): """ `open_view` opens a BinaryView object. - Note: If attempting to open a BNDB, the file MUST have the suffix .bndb, or else the file will not be loaded as a database. + .. note:: If attempting to open a BNDB, the file MUST have the suffix .bndb, or else the file will not be loaded as a database. :param str filename: path to filename or bndb to open :param bool update_analysis: whether or not to run :func:`update_analysis_and_wait` after opening a :py:class:`BinaryView`, defaults to ``True`` diff --git a/python/architecture.py b/python/architecture.py index 098293a8..19ef7831 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -1716,9 +1716,8 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)): :param LowLevelILOperation op: :param int size: :param str write_type: - :param operands: a list of either items that are either string register names or constant \ + :param operands: a list of either items that are either string register names or constant integer values :type operands: list(str) or list(int) - integer values :param LowLevelILFunction il: :rtype: LowLevelILExpr """ @@ -1729,9 +1728,8 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)): :param LowLevelILOperation op: :param int size: :param FlagRole role: - :param operands: a list of either items that are either string register names or constant \ + :param operands: a list of either items that are either string register names or constant integer values :type operands: list(str) or list(int) - integer values :param LowLevelILFunction il: :rtype: LowLevelILExpr index """ @@ -2401,9 +2399,8 @@ class CoreArchitecture(Architecture): :param LowLevelILOperation op: :param int size: :param str write_type: - :param operands: a list of either items that are either string register names or constant \ + :param operands: a list of either items that are either string register names or constant integer values :type operands: list(str) or list(int) - integer values :param LowLevelILFunction il: :rtype: LowLevelILExpr """ diff --git a/python/binaryview.py b/python/binaryview.py index 3a777156..85fcd353 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -2778,7 +2778,7 @@ class BinaryView(object): """ ``read`` returns the data reads at most ``length`` bytes from virtual address ``addr``. - ..note:: Python2 returns a str, but Python3 returns a bytes object. str(DataBufferObject) will \ + .. note:: Python2 returns a str, but Python3 returns a bytes object. str(DataBufferObject) will \ still get you a str in either case. :param int addr: virtual address to read from. @@ -4065,7 +4065,7 @@ class BinaryView(object): :param TagType type: The Tag Type for this Tag :param str data: Additional data for the Tag - :param bool user + :param bool user: Whether or not a user tag :return: The created Tag :rtype: Tag :Example: @@ -4578,7 +4578,7 @@ class BinaryView(object): """ ``get_string_at`` returns the string that falls on given virtual address. - .. note:: This returns discovered strings and is therefore governed by `analysis.limits.minStringLength` and other settings. For an alternative API that simply returns any potential c-string at a given location, use :py:BinaryView:`binaryview.get_ascii_string_at`. + .. note:: This returns discovered strings and is therefore governed by `analysis.limits.minStringLength` and other settings. For an alternative API that simply returns any potential c-string at a given location, use :py:meth:`get_ascii_string_at`. :param int addr: virtual address to get the string from :param bool partial: whether to return a partial string reference or not @@ -4604,7 +4604,7 @@ class BinaryView(object): """ ``get_ascii_string_at`` returns an ascii string found at ``addr``. - .. note:: This returns an ascii string irrespective of whether the core analysis identified a string at that location. For an alternative API that uses existing identified strings, use :py:BinaryView:`binaryview.get_string_at`. + .. note:: This returns an ascii string irrespective of whether the core analysis identified a string at that location. For an alternative API that uses existing identified strings, use :py:meth:`get_string_at`. :param int addr: virtual address to start the string :param int min_length: minimum length to define a string @@ -5037,7 +5037,7 @@ class BinaryView(object): def parse_types_from_string(self, text): """ ``parse_types_from_string`` parses string containing C into a :py:Class:`TypeParserResult` objects. This API - unlike the :py:Function:`platform.Platform.parse_types_from_source` allows the reference of types already defined + unlike the :py:meth:`Platform.parse_types_from_source` allows the reference of types already defined in the BinaryView. :param str text: C source code string of types, variables, and function types, to create @@ -5543,8 +5543,8 @@ class BinaryView(object): """ ``rebase`` rebase the existing :py:class:`BinaryView` into a new :py:class:`BinaryView` at the specified virtual address - .. note:: This method does not update cooresponding UI components. If the `BinaryView` is associated with - UI components then initiate the rebase operation within the UI, e.g. using the command palette. If working with views that + .. note:: This method does not update cooresponding UI components. If the `BinaryView` is associated with \ + UI components then initiate the rebase operation within the UI, e.g. using the command palette. If working with views that \ are not associated with UI components while the UI is active, then set ``force`` to ``True`` to enable rebasing. :param int address: virtual address of the start of the :py:class:`BinaryView` @@ -5575,8 +5575,8 @@ class BinaryView(object): applications. Markdown reports support hyperlinking into the BinaryView. Hyperlinks can be specified as follows: ``binaryninja://?expr=_start`` Where ``expr=`` specifies an expression parsable by the :py:meth:`parse_expression` API. - Note: This API functions differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ - a simple text prompt is used. + .. note:: This API functions differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ + a simple text prompt is used. :param str contents: markdown contents to display :param str plaintext: Plain text version to display (used on the command-line) @@ -5593,7 +5593,7 @@ class BinaryView(object): applications. HTML reports support hyperlinking into the BinaryView. Hyperlinks can be specified as follows: ``binaryninja://?expr=_start`` Where ``expr=`` specifies an expression parsable by the :py:meth:`parse_expression` API. - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str contents: HTML contents to display @@ -5875,7 +5875,7 @@ class BinaryView(object): def set_load_settings(self, type_name, settings): """ - ``set_load_settings`` set a :py:class:`Settings` object which defines the load settings for the given :py:class:`BinaryViewType` ``type_name`` + ``set_load_settings`` set a :py:class:`settings.Settings` object which defines the load settings for the given :py:class:`BinaryViewType` ``type_name`` :param str type_name: the :py:class:`BinaryViewType` name :param Settings settings: the load settings diff --git a/python/enum/__init__.py b/python/enum/__init__.py index d6ffb3a4..5045b4aa 100644 --- a/python/enum/__init__.py +++ b/python/enum/__init__.py @@ -114,7 +114,7 @@ class _EnumDict(dict): Single underscore (sunder) names are reserved. - Note: in 3.x __order__ is simply discarded as a not necessary piece + .. note:: in 3.x __order__ is simply discarded as a not necessary piece \ leftover from 2.x """ diff --git a/python/function.py b/python/function.py index 8220683e..ba5f5be7 100644 --- a/python/function.py +++ b/python/function.py @@ -24,6 +24,7 @@ import threading import traceback import ctypes import numbers +import string # Binary Ninja components import binaryninja @@ -895,7 +896,7 @@ class Variable(object): @property def name(self): - """Name of the variable""" + """Name of the variable, set to an empty string to delete""" if self._name is None: if self._function is not None: self._name = core.BNGetVariableName(self._function.handle, self.to_BNVariable()) @@ -903,6 +904,18 @@ class Variable(object): @name.setter def name(self, value): + if value == None or value == "": + if self._source_type == VariableSourceType.StackVariableSourceType: + self._function.delete_user_stack_var(self) + else: + self._function.delete_user_var(self) + return + if value and value[0] not in string.ascii_lowercase + string.ascii_uppercase + "_?$@" and not ord(value[0]) & 0x80: + value = "_" + value + if self._source_type == VariableSourceType.StackVariableSourceType: + self._function.create_user_stack_var(self._storage, self._type, value) + else: + self._function.create_user_var(self, self._type, value) self._name = value @property @@ -3110,12 +3123,12 @@ class Function(object): def set_user_var_value(self, var, def_addr, value): """ - `set_user_var_value` allows the user to specify a PossibleValueSet value for an MLIL variable at its + `set_user_var_value` allows the user to specify a PossibleValueSet value for an MLIL variable at its \ definition site. - .. warning:: Setting the variable value, triggers a reanalysis of the function and allows the dataflow - to compute and propagate values which depend on the current variable. This implies that branch conditions - whose values can be determined statically will be computed, leading to potential branch elimination at + .. warning:: Setting the variable value, triggers a reanalysis of the function and allows the dataflow \ + to compute and propagate values which depend on the current variable. This implies that branch conditions \ + whose values can be determined statically will be computed, leading to potential branch elimination at \ the HLIL layer. :param Variable var: Variable for which the value is to be set diff --git a/python/interaction.py b/python/interaction.py index f97186df..708f97ab 100644 --- a/python/interaction.py +++ b/python/interaction.py @@ -190,8 +190,8 @@ class AddressField(object): ``AddressField`` prompts the user for an address. By passing the optional view and current_address parameters offsets can be used instead of just an address. The result is stored as in int in self.result. - Note: This API currently functions differently on the command-line, as the view and current_address are - disregarded. Additionally where as in the UI the result defaults to hexadecimal on the command-line 0x must be + .. note:: This API currently functions differently on the command-line, as the view and current_address are \ + disregarded. Additionally where as in the UI the result defaults to hexadecimal on the command-line 0x must be \ specified. """ def __init__(self, prompt, view=None, current_address=0): @@ -969,7 +969,7 @@ def show_plain_text_report(title, contents): """ ``show_plain_text_report`` displays contents to the user in the UI or on the command-line - Note: This API functions differently on the command-line vs the UI. In the UI, a pop-up is used. On the command-line, + .. note:: This API functions differently on the command-line vs the UI. In the UI, a pop-up is used. On the command-line, \ a simple text prompt is used. :param str title: title to display in the UI pop-up @@ -984,11 +984,11 @@ def show_plain_text_report(title, contents): def show_markdown_report(title, contents, plaintext=""): """ - ``show_markdown_report`` displays the markdown contents in UI applications and plaintext in command-line - applications. This API doesn't support hyperlinking into the BinaryView, use the BinaryView.show_markdown_report + ``show_markdown_report`` displays the markdown contents in UI applications and plaintext in command-line \ + applications. This API doesn't support hyperlinking into the BinaryView, use the BinaryView.show_markdown_report \ if hyperlinking is needed. - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str contents: markdown contents to display @@ -1003,11 +1003,11 @@ def show_markdown_report(title, contents, plaintext=""): def show_html_report(title, contents, plaintext=""): """ - ``show_html_report`` displays the HTML contents in UI applications and plaintext in command-line - applications. This API doesn't support hyperlinking into the BinaryView, use the BinaryView.show_html_report + ``show_html_report`` displays the HTML contents in UI applications and plaintext in command-line \ + applications. This API doesn't support hyperlinking into the BinaryView, use the BinaryView.show_html_report \ if hyperlinking is needed. - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str contents: HTML contents to display @@ -1024,7 +1024,7 @@ def show_graph_report(title, graph): """ ``show_graph_report`` displays a flow graph in UI applications - Note: This API function will have no effect outside the UI. + .. note:: This API function will have no effect outside the UI. :param FlowGraph graph: Flow graph to display :rtype: None @@ -1040,7 +1040,7 @@ def show_report_collection(title, reports): """ ``show_report_collection`` displays multiple reports in UI applications - Note: This API function will have no effect outside the UI. + .. note:: This API function will have no effect outside the UI. :param ReportCollection reports: Reports to display :rtype: None @@ -1052,7 +1052,7 @@ def get_text_line_input(prompt, title): """ ``get_text_line_input`` prompts the user to input a string with the given prompt and title - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str prompt: String to prompt with. @@ -1075,7 +1075,7 @@ def get_int_input(prompt, title): """ ``get_int_input`` prompts the user to input a integer with the given prompt and title - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str prompt: String to prompt with. @@ -1096,7 +1096,7 @@ def get_address_input(prompt, title): """ ``get_address_input`` prompts the user for an address with the given prompt and title - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. :param str prompt: String to prompt with. @@ -1117,7 +1117,7 @@ def get_choice_input(prompt, title, choices): """ ``get_choice_input`` prompts the user to select the one of the provided choices - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. The UI uses a combo box. :param str prompt: String to prompt with. @@ -1147,12 +1147,12 @@ def get_open_filename_input(prompt, ext=""): """ ``get_open_filename_input`` prompts the user for a file name to open - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. The UI uses the native window pop-up for file selection. Multiple file selection groups can be included if separated by two semicolons. Multiple file wildcards may be specified by using a space within the parenthesis. - Also, a simple selector of "*.extension" by itself may also be used instead of specifying the description. + Also, a simple selector of "\*.extension" by itself may also be used instead of specifying the description. :param str prompt: Prompt to display. :param str ext: Optional, file extension @@ -1172,10 +1172,10 @@ def get_open_filename_input(prompt, ext=""): def get_save_filename_input(prompt, ext="", default_name=""): """ - ``get_save_filename_input`` prompts the user for a file name to save as, optionally providing a file extension and + ``get_save_filename_input`` prompts the user for a file name to save as, optionally providing a file extension and \ default_name - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line \ a simple text prompt is used. The UI uses the native window pop-up for file selection. :param str prompt: Prompt to display. @@ -1198,7 +1198,7 @@ def get_directory_name_input(prompt, default_name=""): """ ``get_directory_name_input`` prompts the user for a directory name to save as, optionally providing a default_name - Note: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line a simple text prompt is used. The UI uses the native window pop-up for file selection. + .. note:: This API function differently on the command-line vs the UI. In the UI a pop-up is used. On the command-line a simple text prompt is used. The UI uses the native window pop-up for file selection. :param str prompt: Prompt to display. :param str default_name: Optional, default directory name. @@ -1218,21 +1218,29 @@ def get_directory_name_input(prompt, default_name=""): def get_form_input(fields, title): """ - ``get_from_input`` Prompts the user for a set of inputs specified in ``fields`` with given title. + ``get_from_input`` Prompts the user for a set of inputs specified in ``fields`` with given title. \ The fields parameter is a list which can contain the following types: - - str - an alias for LabelField - - None - an alias for SeparatorField - - LabelField - Text output - - SeparatorField - Vertical spacing - - TextLineField - Prompt for a string value - - MultilineTextField - Prompt for multi-line string value - - IntegerField - Prompt for an integer - - AddressField - Prompt for an address - - ChoiceField - Prompt for a choice from provided options - - OpenFileNameField - Prompt for file to open - - SaveFileNameField - Prompt for file to save to - - DirectoryNameField - Prompt for directory name - This API is flexible and works both in the UI via a pop-up dialog and on the command-line. Note that more complicated APIs should consider using the included pyside2 functionality in the `binaryninjaui` module. Returns true or false depending on whether the user submitted responses or cancelled the dialog. + + ===================== =================================================== + FieldType Description + ===================== =================================================== + str an alias for LabelField + None an alias for SeparatorField + LabelField Text output + SeparatorField Vertical spacing + TextLineField Prompt for a string value + MultilineTextField Prompt for multi-line string value + IntegerFieldch Prompt for an integer + AddressField Prompt for an address + ChoiceField Prompt for a choice from provided options + OpenFileNameField Prompt for file to open + SaveFileNameField Prompt for file to save to + DirectoryNameField Prompt for directory name + ===================== =================================================== + + This API is flexible and works both in the UI via a pop-up dialog and on the command-line. + + .. note:: More complicated APIs should consider using the included pyside2 functionality in the `binaryninjaui` module. Returns true or false depending on whether the user submitted responses or cancelled the dialog. :param fields: A list containing these classes, strings or None :type fields: list(str) or list(None) or list(LabelField) or list(SeparatorField) or list(TextLineField) or list(MultilineTextField) or list(IntegerField) or list(AddressField) or list(ChoiceField) or list(OpenFileNameField) or list(SaveFileNameField) or list(DirectoryNameField) diff --git a/python/platform.py b/python/platform.py index 4e407868..4983adff 100644 --- a/python/platform.py +++ b/python/platform.py @@ -153,11 +153,7 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): @property def cdecl_calling_convention(self): """ - Cdecl calling convention. - - :getter: returns a CallingConvention object for the cdecl calling convention. - :setter sets the cdecl calling convention - :type: CallingConvention + CallingConvention object for the cdecl calling convention """ result = core.BNGetPlatformCdeclCallingConvention(self.handle) if result is None: @@ -166,16 +162,15 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): @cdecl_calling_convention.setter def cdecl_calling_convention(self, value): + """ + Sets the cdecl calling convention + """ core.BNRegisterPlatformCdeclCallingConvention(self.handle, value.handle) @property def stdcall_calling_convention(self): """ - Stdcall calling convention. - - :getter: returns a CallingConvention object for the stdcall calling convention. - :setter sets the stdcall calling convention - :type: CallingConvention + CallingConvention object for the stdcall calling convention """ result = core.BNGetPlatformStdcallCallingConvention(self.handle) if result is None: @@ -184,16 +179,15 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): @stdcall_calling_convention.setter def stdcall_calling_convention(self, value): + """ + Sets the stdcall calling convention + """ core.BNRegisterPlatformStdcallCallingConvention(self.handle, value.handle) @property def fastcall_calling_convention(self): """ - Fastcall calling convention. - - :getter: returns a CallingConvention object for the fastcall calling convention. - :setter sets the fastcall calling convention - :type: CallingConvention + CallingConvention object for the fastcall calling convention """ result = core.BNGetPlatformFastcallCallingConvention(self.handle) if result is None: @@ -202,16 +196,15 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): @fastcall_calling_convention.setter def fastcall_calling_convention(self, value): + """ + Sets the fastcall calling convention + """ core.BNRegisterPlatformFastcallCallingConvention(self.handle, value.handle) @property def system_call_convention(self): """ - System call convention. - - :getter: returns a CallingConvention object for the system call convention. - :setter sets the system call convention - :type: CallingConvention + CallingConvention object for the system call convention """ result = core.BNGetPlatformSystemCallConvention(self.handle) if result is None: @@ -220,6 +213,9 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): @system_call_convention.setter def system_call_convention(self, value): + """ + Sets the system call convention + """ core.BNSetPlatformSystemCallConvention(self.handle, value.handle) @property diff --git a/python/pluginmanager.py b/python/pluginmanager.py index 109876e3..1a3187af 100644 --- a/python/pluginmanager.py +++ b/python/pluginmanager.py @@ -93,16 +93,16 @@ class RepoPlugin(object): def enable(self, force=False): """ - Enable this plugin, optionally trying to force it. - Force loading a plugin with ignore platform and api constraints. - (e.g. The plugin author says the plugin will only work on Linux-python3 but you'd like to + Enable this plugin, optionally trying to force it. \ + Force loading a plugin with ignore platform and api constraints. \ + (e.g. The plugin author says the plugin will only work on Linux-python3 but you'd like to \ attempt to load it on Macos-python2) """ return core.BNPluginEnable(self.handle, force) @property def api(self): - """string indicating the API used by the plugin""" + """String indicating the API used by the plugin""" result = [] count = ctypes.c_ulonglong(0) platforms = core.BNPluginGetApis(self.handle, count) diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 7a970338..773da71d 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -34,7 +34,7 @@ import os import binaryninja from binaryninja import bncompleter, log from binaryninja import _binaryninjacore as core -from binaryninja.settings import Settings +from binaryninja import settings from binaryninja.pluginmanager import RepositoryManager from binaryninja.enums import ScriptingProviderExecuteResult, ScriptingProviderInputReadyState @@ -913,8 +913,8 @@ class PythonScriptingProvider(ScriptingProvider): def _install_modules(self, ctx, modules): # This callback should not be called directly it is indirectly # executed binary ninja is executed with --pip option - python_lib = Settings().get_string("python.interpreter") - python_bin_override = Settings().get_string("python.binaryOverride") + python_lib = settings.Settings().get_string("python.interpreter") + python_bin_override = settings.Settings().get_string("python.binaryOverride") python_bin, status = self._get_executable_for_libpython(python_lib, python_bin_override) if sys.platform == "darwin" and not any([python_bin, python_lib, python_bin_override]): log.log_error(f"Plugin requirement installation unsupported on MacOS with bundled Python: {status} Please specify a path to a python library in the 'Python Interpreter' setting") @@ -930,13 +930,13 @@ class PythonScriptingProvider(ScriptingProvider): return False args = [str(python_bin), "-m", "pip", "--isolated", "--disable-pip-version-check"] - proxy_settings = Settings().get_string("downloadClient.httpsProxy") + proxy_settings = settings.Settings().get_string("downloadClient.httpsProxy") if proxy_settings: args.extend(["--proxy", proxy_settings]) args.append("install") args.append("--verbose") - venv = Settings().get_string("python.virtualenv") + venv = settings.Settings().get_string("python.virtualenv") in_virtual_env = 'VIRTUAL_ENV' in os.environ if venv is not None and venv.endswith("site-packages") and Path(venv).is_dir() and not in_virtual_env: args.extend(["--target", venv]) diff --git a/sphinx_rtd_theme b/sphinx_rtd_theme -Subproject 1d5db330da88dcdbfff34e70e06659c0561d3ea +Subproject 63d392f82f91ed136c865f4134d148d1ccfe978 |
