Add basic ASM patching

This commit is contained in:
Mc-muffin
2023-08-08 00:46:47 -05:00
parent fc37600aa5
commit 7ec521ab9d

View File

@@ -21,7 +21,7 @@ from pythonlib.formats.theirsce import Theirsce
from pythonlib.formats.theirsce_instructions import (AluOperation, InstructionType,
TheirsceBaseInstruction)
from .ToolsTales import ToolsTales
import subprocess
@dataclass
class LineEntry:
@@ -54,6 +54,7 @@ class ToolsTOR(ToolsTales):
self.paths: dict[str, Path] = {k: base_path / v for k, v in jsonRaw["paths"].items()}
self.main_exe_name = jsonRaw["main_exe_name"]
self.asm_file = jsonRaw["asm_file"]
# super().__init__("TOR", str(self.paths["encoding_table"]), "Tales-Of-Rebirth")
@@ -747,6 +748,18 @@ class ToolsTOR(ToolsTales):
f.write_uint16_at(_l, val_lo)
def patch_binaries(self):
subprocess.run(
[
str(self.paths["tools"] / "asm" / "armips.exe"),
str(self.paths["tools"] / "asm" / self.asm_file),
"-strequ",
"__SLPS_PATH__",
str(self.paths["temp_files"] / self.main_exe_name),
]
)
def create_Node_XML(self, root, list_informations, section) -> None:
strings_node = etree.SubElement(root, 'Strings')
etree.SubElement(strings_node, 'Section').text = section