(hopefully) lower python requirement to 3.8

This commit is contained in:
LukeFZ
2025-10-12 17:13:20 +02:00
parent ca6c958f9a
commit 481d05668d
5 changed files with 9 additions and 8 deletions

View File

@@ -71,7 +71,7 @@ class BinaryNinjaDisassemblerInterface(BaseDisassemblerInterface):
self._type_cache[type] = parsed self._type_cache[type] = parsed
return 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( parsed_types, errors = TypeParser.default.parse_types_from_source(
types, types,
filename if filename else "types.hpp", filename if filename else "types.hpp",
@@ -127,7 +127,7 @@ class BinaryNinjaDisassemblerInterface(BaseDisassemblerInterface):
self._view.set_analysis_hold(False) self._view.set_analysis_hold(False)
self._view.update_analysis() 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: if self._view.get_function_at(address) is not None:
return return

View File

@@ -51,7 +51,7 @@ class GhidraDisassemblerInterface(BaseDisassemblerInterface):
def on_finish(self): def on_finish(self):
pass 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) address = self._to_address(address)
# Don't override existing functions # Don't override existing functions
fn = getFunctionAt(address) fn = getFunctionAt(address)

View File

@@ -118,7 +118,7 @@ class IDADisassemblerInterface(BaseDisassemblerInterface):
def on_finish(self): def on_finish(self):
ida_ida.inf_set_genflags(self._cached_genflags) 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: if self._skip_function_creation:
return return

View File

@@ -7,6 +7,7 @@
import json import json
import os import os
from datetime import datetime from datetime import datetime
from typing import Union
import abc import abc
class BaseStatusHandler(abc.ABC): class BaseStatusHandler(abc.ABC):
@@ -31,7 +32,7 @@ class BaseDisassemblerInterface(abc.ABC):
def on_finish(self): pass def on_finish(self): pass
@abc.abstractmethod @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 @abc.abstractmethod
def define_data_array(self, address: int, type: str, count: int): pass 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_name(addr, definition['name'])
self._backend.set_data_comment(addr, definition['string']) 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) address = self.from_hex(addr)
self._backend.set_data_type(address, type) self._backend.set_data_type(address, type)
self._backend.set_data_name(address, name) self._backend.set_data_name(address, name)

View File

@@ -332,9 +332,9 @@ The `--seperate-attributes` switch directs Il2CppInspector to put assembly-level
### Adding metadata to your IDA workflow ### 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. 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.