more work done
This commit is contained in:
parent
5cc5612f4e
commit
d323bb28fc
68 changed files with 714 additions and 19 deletions
27
scripts/_tmp_rebind_entity_vm_runtime_create.py
Normal file
27
scripts/_tmp_rebind_entity_vm_runtime_create.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from ghidra.program.model.symbol import SourceType, SymbolType
|
||||
|
||||
|
||||
function = helpers["get_function"](program, "1420:1499")
|
||||
if function is None:
|
||||
raise RuntimeError("Function 1420:1499 not found")
|
||||
|
||||
symbol_table = program.getSymbolTable()
|
||||
global_namespace = program.getGlobalNamespace()
|
||||
remorse_namespace = symbol_table.getNamespace("Remorse", global_namespace)
|
||||
if remorse_namespace is None:
|
||||
raise RuntimeError("Namespace Remorse not found")
|
||||
|
||||
runtime_namespace = symbol_table.getNamespace("EntityVmRuntime", remorse_namespace)
|
||||
if runtime_namespace is None:
|
||||
raise RuntimeError("Namespace Remorse::EntityVmRuntime not found")
|
||||
|
||||
for symbol in list(symbol_table.getSymbols(function.getEntryPoint())):
|
||||
if symbol.getSymbolType() == SymbolType.LABEL and symbol.getName() == "Create" and symbol.getParentNamespace() == runtime_namespace:
|
||||
symbol.delete()
|
||||
|
||||
function.setParentNamespace(runtime_namespace)
|
||||
function.setName("Create", SourceType.USER_DEFINED)
|
||||
|
||||
print("PARENT", function.getParentNamespace())
|
||||
for symbol in symbol_table.getSymbols(function.getEntryPoint()):
|
||||
print("SYMBOL", symbol.getName(True), symbol.getSymbolType(), symbol.getSource())
|
||||
Loading…
Add table
Add a link
Reference in a new issue