From 81a5171e8fac66ef76117c322c16ac30110abf0f Mon Sep 17 00:00:00 2001 From: Christian Jones Date: Tue, 29 Sep 2020 16:46:51 -0400 Subject: [PATCH] Simplified make_function to improve speed and avoid data loss --- Il2CppDumper/ghidra.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Il2CppDumper/ghidra.py b/Il2CppDumper/ghidra.py index e1038e1..267aea2 100644 --- a/Il2CppDumper/ghidra.py +++ b/Il2CppDumper/ghidra.py @@ -20,18 +20,10 @@ def set_name(addr, name): name = name.replace(' ', '-') createLabel(addr, name, True, USER_DEFINED) -def make_function(start, end): - next_func_start = getFunctionAfter(start).getEntryPoint() - if next_func_start < end: - end = next_func_start - body = createAddressSet() - body.addRange(start, end.subtract(1)) - functionManager.deleteAddressRange(start, end.subtract(1), getMonitor()) +def make_function(start): func = getFunctionAt(start) if func is None: - functionManager.createFunction(None, start, body, USER_DEFINED) - else: - func.setBody(body) + createFunction(start, None) f = askFile("script.json from Il2cppdumper", "Open") data = json.loads(open(f.absolutePath, 'rb').read().decode('utf-8')) @@ -75,8 +67,7 @@ if "Addresses" in data and "Addresses" in processFields: addresses = data["Addresses"] for index in range(len(addresses) - 1): start = get_addr(addresses[index]) - end = get_addr(addresses[index + 1]) - make_function(start, end) + make_function(start) print 'Script finished!'