Add BinaryNinja 3 script

Adds a script for BinaryNinja 3, currently it only processes the ScriptMethod field from script.json
Script needs to be edited to grab script.json as I haven't
This commit is contained in:
janisslsm 2022-03-10 11:46:02 +02:00
parent c3877cf39a
commit ab47c13249

View file

@ -0,0 +1,27 @@
import binaryninja
from os.path import exists
imageBase = bv.start
def get_addr(addr):
return imageBase + addr
fileDialog = OpenFileNameField("Select script.json", "script.json", "script.json")
if get_form_input([fileDialog], "script.json from Il2CppDumper") != 1:
print("File not selected, try again!")
else:
if exists(fileDialog.result) == True:
data = json.loads(open(fileDialog.result, 'rb').read().decode('utf-8'))
data["Addresses"] = None
if "ScriptMethod" in data:
scriptMethods = data["ScriptMethod"]
for scriptMethod in scriptMethods:
addr = get_addr(scriptMethod["Address"])
name = scriptMethod["Name"]
func = bv.get_function_at(addr)
if func != None:
bv.get_function_at(addr).name = name
print("Done")
else:
print("File not found")