diff --git a/tools/ghidra_scripts/lego_util/function_importer.py b/tools/ghidra_scripts/lego_util/function_importer.py index 7e2cd12c..6ccc6935 100644 --- a/tools/ghidra_scripts/lego_util/function_importer.py +++ b/tools/ghidra_scripts/lego_util/function_importer.py @@ -215,7 +215,7 @@ def overwrite_ghidra_function(self, ghidra_function: Function): """Replace the function declaration in Ghidra by the one derived from C++.""" if ghidra_function.hasCustomVariableStorage(): - # Unfortunately, Ghidra has a bug where setting custom variable storage back to `False` + # Unfortunately, calling `ghidra_function.setCustomVariableStorage(False)` # leads to two `this` parameters. Therefore, we first need to remove all `this` parameters # and then re-generate a new one ghidra_function.replaceParameters( @@ -330,7 +330,7 @@ def _set_this_adjust( ghidra_function: Function, ): """ - Then `this adjust` is non-zero, the pointer type of `this` needs to be replaced by an offset version. + When `this adjust` is non-zero, the pointer type of `this` needs to be replaced by an offset version. The offset can only be set on a typedef on the pointer. We also must enable custom storage so we can modify the auto-generated `this` parameter. """