scriptingprovider module¶
Class | Description |
|---|---|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping… | |
| |
BlacklistedDict¶
PythonScriptingInstance¶
- classPythonScriptingInstance[source]¶
Bases:
ScriptingInstance- classInterpreterThread[source]¶
Bases:
Thread- __init__(instance)[source]¶
This constructor should always be called with keyword arguments. Arguments are:
group should be None; reserved for future extension when a ThreadGroupclass is implemented.
target is the callable object to be invoked by the run()method. Defaults to None, meaning nothing is called.
name is the thread name. By default, a unique name is constructed ofthe form “Thread-N” where N is a small decimal number.
args is the argument tuple for the target invocation. Defaults to ().
kwargs is a dictionary of keyword arguments for the targetinvocation. Defaults to {}.
If a subclass overrides the constructor, it must make sure to invokethe base class constructor (Thread.__init__()) before doing anythingelse to the thread.
- run()[source]¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() methodinvokes the callable object passed to the object’s constructor as thetarget argument, if any, with sequential and keyword arguments takenfrom the args and kwargs arguments, respectively.
PythonScriptingProvider¶
- classPythonScriptingProvider[source]¶
Bases:
ScriptingProvider- classMagicVariable[source]¶
Bases:
objectRepresents an automatically-populated (magic) variable in the python scripting console
- __init__(get_value:Callable[[PythonScriptingInstance],Any],set_value:Callable[[PythonScriptingInstance,Any,Any],None]|None,depends_on:List[str])→None¶
- Parameters:
get_value (Callable[[PythonScriptingInstance],Any]) –
set_value (Callable[[PythonScriptingInstance,Any,Any],None]|None) –
- Return type:
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 thevariable has changed during the course of the script. If None, a warning will beprinted stating that the variable is read-only.Signature: (instance: PythonScriptingInstance, old_value: any, new_value: any) -> None
- instance_class¶
alias of
PythonScriptingInstance
- classmethodregister_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:param set_value: (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:param depends_on: List of other variables whose values on which this variable’s value depends
- Parameters:
name (str) –
get_value (Callable[[PythonScriptingInstance],Any]) –
set_value (Callable[[PythonScriptingInstance,Any,Any],None]|None) –
- classmethodunregister_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_expr':PythonScriptingProvider.MagicVariable(get_value=<function_get_current_il_expr>,set_value=None,depends_on=['current_il_expr_index','current_il_function']),'current_il_expr_index':PythonScriptingProvider.MagicVariable(get_value=<function_get_current_il_expr_index>,set_value=None,depends_on=['current_token']),'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'¶