From 481d05668db329f30ec1d136bebf66ca5006a766 Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Sun, 12 Oct 2025 17:13:20 +0200 Subject: [PATCH] (hopefully) lower python requirement to 3.8 --- .../Outputs/ScriptResources/Targets/BinaryNinja.py | 4 ++-- .../Outputs/ScriptResources/Targets/Ghidra.py | 2 +- .../Outputs/ScriptResources/Targets/IDA.py | 2 +- .../Outputs/ScriptResources/shared_base.py | 5 +++-- README.md | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/BinaryNinja.py b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/BinaryNinja.py index 787932e..94553de 100644 --- a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/BinaryNinja.py +++ b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/BinaryNinja.py @@ -71,7 +71,7 @@ class BinaryNinjaDisassemblerInterface(BaseDisassemblerInterface): self._type_cache[type] = parsed return parsed - def _parse_type_source(self, types: str, filename: str | None = None): + def _parse_type_source(self, types: str, filename: Union[str, None] = None): parsed_types, errors = TypeParser.default.parse_types_from_source( types, filename if filename else "types.hpp", @@ -127,7 +127,7 @@ class BinaryNinjaDisassemblerInterface(BaseDisassemblerInterface): self._view.set_analysis_hold(False) self._view.update_analysis() - def define_function(self, address: int, end: int | None = None): + def define_function(self, address: int, end: Union[int, None] = None): if self._view.get_function_at(address) is not None: return diff --git a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py index 272f7e8..930d251 100644 --- a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py +++ b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py @@ -51,7 +51,7 @@ class GhidraDisassemblerInterface(BaseDisassemblerInterface): def on_finish(self): pass - def define_function(self, address: int, end: int | None = None): + def define_function(self, address: int, end: Union[int, None] = None): address = self._to_address(address) # Don't override existing functions fn = getFunctionAt(address) diff --git a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/IDA.py b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/IDA.py index ca7f055..030ab3a 100644 --- a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/IDA.py +++ b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/IDA.py @@ -118,7 +118,7 @@ class IDADisassemblerInterface(BaseDisassemblerInterface): def on_finish(self): ida_ida.inf_set_genflags(self._cached_genflags) - def define_function(self, address: int, end: int | None = None): + def define_function(self, address: int, end: Union[int, None] = None): if self._skip_function_creation: return diff --git a/Il2CppInspector.Common/Outputs/ScriptResources/shared_base.py b/Il2CppInspector.Common/Outputs/ScriptResources/shared_base.py index 130e66a..6ad2778 100644 --- a/Il2CppInspector.Common/Outputs/ScriptResources/shared_base.py +++ b/Il2CppInspector.Common/Outputs/ScriptResources/shared_base.py @@ -7,6 +7,7 @@ import json import os from datetime import datetime +from typing import Union import abc class BaseStatusHandler(abc.ABC): @@ -31,7 +32,7 @@ class BaseDisassemblerInterface(abc.ABC): def on_finish(self): pass @abc.abstractmethod - def define_function(self, address: int, end: int | None = None): pass + def define_function(self, address: int, end: Union[int, None] = None): pass @abc.abstractmethod def define_data_array(self, address: int, type: str, count: int): pass @@ -111,7 +112,7 @@ class ScriptContext: self._backend.set_data_name(addr, definition['name']) self._backend.set_data_comment(addr, definition['string']) - def define_field(self, addr: str, name: str, type: str, il_type: str | None = None): + def define_field(self, addr: str, name: str, type: str, il_type: Union[str, None] = None): address = self.from_hex(addr) self._backend.set_data_type(address, type) self._backend.set_data_name(address, name) diff --git a/README.md b/README.md index 6b5ac08..59c6f84 100644 --- a/README.md +++ b/README.md @@ -332,9 +332,9 @@ The `--seperate-attributes` switch directs Il2CppInspector to put assembly-level ### Adding metadata to your IDA workflow -**NOTE:** IDA 7.6+ is required, but 7.7 is recommended. +**NOTE:** IDA 7.6+ is required, but 7.7 is recommended. You also need to use Python 3.8+ to be able to run the script. -**NOTE:** Run script as-soon-as-possible after IDA loads binary into database +**NOTE:** Run script as-soon-as-possible after IDA loads binary into database! Simply run Il2CppInspector with the `-p` switch to choose the IDA script output file. Load your binary file into IDA, press Alt+F7 and select the generated script. Observe the Output Window while IDA analyzes the file - this may take a long time.