Update ghidra_wasm.py (#551)

This commit is contained in:
xWTF 2022-02-27 14:04:18 +08:00 committed by GitHub
parent f53ee2cec1
commit c3877cf39a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,9 +47,9 @@ if "ScriptMethod" in data and "ScriptMethod" in processFields:
offset = scriptMethod["Address"]
sig = scriptMethod["TypeSignature"]
symbolName = "func_%s_%d" % (sig, offset)
symbol = currentProgram.symbolTable.getSymbol(symbolName, dynCallNamespace)
if symbol:
addr = symbol.address
symbol = currentProgram.symbolTable.getSymbols(symbolName, dynCallNamespace)
if len(symbol) > 0:
addr = symbol[0].address
name = scriptMethod["Name"].encode("utf-8")
set_name(addr, name)
else: