scriptingprovider module¶
|
|
- class PythonScriptingInstance(provider)[source]¶
Bases:
ScriptingInstance
- class InterpreterThread(instance)[source]¶
Bases:
Thread
- run()[source]¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- class PythonScriptingProvider(handle=None)[source]¶
Bases:
ScriptingProvider
- class MagicVariable(get_value: Callable[[PythonScriptingInstance], Any], set_value: Callable[[PythonScriptingInstance, Any, Any], None] | None, depends_on: List[str])[source]¶
Bases:
object
Represents an automatically-populated (magic) variable in the python scripting console
- Parameters:
get_value (Callable[[PythonScriptingInstance], Any]) –
set_value (Callable[[PythonScriptingInstance, Any, Any], None] | None) –
- get_value: Callable[[PythonScriptingInstance], Any]¶
Function to call, before every time a script is evaluated, to get the value of the variable
- set_value: Callable[[PythonScriptingInstance, Any, Any], None] | None¶
(Optional) function to call after a script is evaluated, if the value of the variable has changed during the course of the script. If None, a warning will be printed stating that the variable is read-only. Signature: (instance: PythonScriptingInstance, old_value: any, new_value: any) -> None
- instance_class¶
alias of
PythonScriptingInstance
- classmethod register_magic_variable(name: str, get_value: Callable[[PythonScriptingInstance], Any], set_value: Callable[[PythonScriptingInstance, Any, Any], None] | None = None, depends_on: List[str] | None = None)[source]¶
Add a magic variable to all scripting instances created by the scripting provider :param name: Variable name identifier to be used in the interpreter :param get_value: Function to call, before every time a script is evaluated,
to get the value of the variable
- Parameters:
set_value (Callable[[PythonScriptingInstance, Any, Any], None] | None) – (Optional) Function to call after a script is evaluated, if the value of the variable has changed during the course of the script. If None, a warning will be printed stating that the variable is read-only. Signature: (instance: PythonScriptingInstance, old_value: any, new_value: any) -> None
depends_on (List[str] | None) – List of other variables whose values on which this variable’s value depends
name (str) –
get_value (Callable[[PythonScriptingInstance], Any]) –
- classmethod unregister_magic_variable(name: str)[source]¶
Remove a magic variable by name :param name: Variable name
- Parameters:
name (str) –
- apiName = 'python3'¶
- magic_variables: Dict[str, MagicVariable] = {'bv': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'current_address': PythonScriptingProvider.MagicVariable(get_value=<function _get_here>, set_value=<function _set_here>, depends_on=['current_ui_context']), 'current_basic_block': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'current_comment': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_comment>, set_value=<function _set_current_comment>, depends_on=[]), 'current_data_var': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_data_var>, set_value=None, depends_on=[]), 'current_function': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'current_hlil': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_hlil>, set_value=None, depends_on=[]), 'current_hlil_ssa': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_hlil_ssa>, set_value=None, depends_on=['current_hlil']), 'current_il_basic_block': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_il_basic_block>, set_value=None, depends_on=['current_il_instruction']), 'current_il_function': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_il_function>, set_value=None, depends_on=['current_ui_view_location', 'current_llil', 'current_lifted_il', 'current_llil_ssa', 'current_mapped_mlil', 'current_mapped_mlil_ssa', 'current_mlil', 'current_mlil_ssa', 'current_hlil', 'current_hlil_ssa']), 'current_il_index': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_il_index>, set_value=None, depends_on=['current_ui_view_location']), 'current_il_instruction': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_il_instruction>, set_value=None, depends_on=['current_il_index', 'current_il_function']), 'current_il_instructions': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_il_instructions>, set_value=None, depends_on=['current_il_index', 'current_il_function', 'current_ui_view']), 'current_lifted_il': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_lifted_il>, set_value=None, depends_on=[]), 'current_llil': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_llil>, set_value=None, depends_on=[]), 'current_llil_ssa': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_llil_ssa>, set_value=None, depends_on=['current_llil']), 'current_mapped_mlil': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_mapped_mlil>, set_value=None, depends_on=[]), 'current_mapped_mlil_ssa': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_mapped_mlil_ssa>, set_value=None, depends_on=['current_mapped_mlil']), 'current_mlil': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_mlil>, set_value=None, depends_on=[]), 'current_mlil_ssa': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_mlil_ssa>, set_value=None, depends_on=['current_mlil']), 'current_project': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_project>, set_value=None, depends_on=['current_ui_context', 'current_view']), 'current_raw_offset': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_raw_offset>, set_value=<function _set_current_raw_offset>, depends_on=['current_ui_context']), 'current_sections': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_sections>, set_value=None, depends_on=[]), 'current_segment': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_segment>, set_value=None, depends_on=[]), 'current_selection': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_selection>, set_value=<function _set_current_selection>, depends_on=['current_ui_view']), 'current_symbol': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_symbol>, set_value=None, depends_on=[]), 'current_symbols': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_symbols>, set_value=None, depends_on=[]), 'current_thread': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'current_token': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_token>, set_value=None, depends_on=['current_ui_token_state']), 'current_ui_action_context': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_action_context>, set_value=None, depends_on=['current_ui_view', 'current_ui_action_handler']), 'current_ui_action_handler': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_action_handler>, set_value=None, depends_on=['current_ui_context']), 'current_ui_context': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_context>, set_value=None, depends_on=[]), 'current_ui_token_state': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_token_state>, set_value=None, depends_on=['current_ui_action_context']), 'current_ui_view': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_view>, set_value=None, depends_on=['current_ui_context']), 'current_ui_view_frame': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_view_frame>, set_value=None, depends_on=['current_ui_context']), 'current_ui_view_location': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_ui_view_location>, set_value=None, depends_on=['current_ui_view_frame']), 'current_variable': PythonScriptingProvider.MagicVariable(get_value=<function _get_current_variable>, set_value=None, depends_on=['current_ui_token_state']), 'current_view': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'dbg': PythonScriptingProvider.MagicVariable(get_value=<function <lambda>>, set_value=None, depends_on=[]), 'here': PythonScriptingProvider.MagicVariable(get_value=<function _get_here>, set_value=<function _set_here>, depends_on=['current_ui_context'])}¶
- name = 'Python'¶
- class ScriptingInstance(provider, handle=None)[source]¶
Bases:
object
- property delimiters¶
- property input_ready_state¶
- class ScriptingProvider(handle=None)[source]¶
Bases:
object
- create_instance() ScriptingInstance | None [source]¶
- Return type:
ScriptingInstance | None
- apiName = ''¶
- instance_class: Type[ScriptingInstance] | None = None¶
- name = ''¶