mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 00:31:16 +00:00
run linter + formatter
This commit is contained in:
parent
36d6167057
commit
f906c2c355
@ -228,7 +228,6 @@ def log_and_track_failure(
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
if GLOBALS.running_from_ghidra:
|
||||
origfile_name = getProgramFile().getName()
|
||||
|
||||
@ -237,7 +236,9 @@ def main():
|
||||
elif origfile_name in ["LEGO1D.DLL", "BETA10.DLL"]:
|
||||
module = SupportedModules.BETA10
|
||||
else:
|
||||
raise Lego1Exception(f"Unsupported file name in import script: {origfile_name}")
|
||||
raise Lego1Exception(
|
||||
f"Unsupported file name in import script: {origfile_name}"
|
||||
)
|
||||
else:
|
||||
module = SupportedModules.LEGO1
|
||||
|
||||
@ -262,7 +263,9 @@ def main():
|
||||
with Bin(str(origfile_path), find_str=True) as origfile, Bin(
|
||||
str(recompiledfile_path)
|
||||
) as recompfile:
|
||||
isle_compare = IsleCompare(origfile, recompfile, str(pdbfile_path), str(repo_root))
|
||||
isle_compare = IsleCompare(
|
||||
origfile, recompfile, str(pdbfile_path), str(repo_root)
|
||||
)
|
||||
|
||||
logger.info("Comparison complete.")
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
|
||||
class PdbFunctionImporter(ABC):
|
||||
"""A representation of a function from the PDB with each type replaced by a Ghidra type instance."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api: FlatProgramAPI,
|
||||
@ -71,10 +72,12 @@ def build(api: FlatProgramAPI, func: PdbFunction, type_importer: "PdbTypeImporte
|
||||
)
|
||||
|
||||
@abstractmethod
|
||||
def matches_ghidra_function(self, ghidra_function: Function) -> bool: ...
|
||||
def matches_ghidra_function(self, ghidra_function: Function) -> bool:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def overwrite_ghidra_function(self, ghidra_function: Function): ...
|
||||
def overwrite_ghidra_function(self, ghidra_function: Function):
|
||||
...
|
||||
|
||||
|
||||
class ThunkPdbFunctionImport(PdbFunctionImporter):
|
||||
@ -101,6 +104,7 @@ def overwrite_ghidra_function(self, ghidra_function: Function):
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class FullPdbFunctionImporter(PdbFunctionImporter):
|
||||
"""For importing functions into Ghidra where all information are available."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api: FlatProgramAPI,
|
||||
|
||||
@ -80,9 +80,11 @@ def create_ghidra_namespace(
|
||||
namespace = api.createNamespace(namespace, part)
|
||||
return namespace
|
||||
|
||||
|
||||
# These appear in debug builds
|
||||
THUNK_OF_RE = re.compile(r"^Thunk of '(.*)'$")
|
||||
|
||||
|
||||
def sanitize_name(name: str) -> str:
|
||||
"""
|
||||
Takes a full class or function name and replaces characters not accepted by Ghidra.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user