Move and tweak get pointers into talesTOR

code seemed TOR specific anyway
This commit is contained in:
Mc-muffin
2023-05-19 07:45:20 -05:00
parent cb3f9f2845
commit ff0432aa92
2 changed files with 10 additions and 15 deletions

View File

@@ -748,6 +748,16 @@ class ToolsTOR(ToolsTales):
df['Pointers_Offset'] = df['Pointers_Offset'].apply(lambda x: hex(x)[2:])
df.to_excel('../{}.xlsx'.format(self.get_file_name(file_name)), index=False)
def get_pointers(self) -> list[int]:
with open(self.elf_original , "rb") as elf:
elf.seek(self.POINTERS_BEGIN, 0)
blob = elf.read(self.POINTERS_END-self.POINTERS_BEGIN)
return struct.unpack(f"<{len(blob)//4}L", blob)
# Extract the file DAT.BIn to the different directorties
def extract_Main_Archive(self):

View File

@@ -148,21 +148,6 @@ class ToolsTales:
with open(fileName+".res", "rb") as f:
data = f.read()
return data
def get_pointers(self, start_offset):
f = open(self.elf_original , "rb")
f.seek(start_offset, 0)
pointers = []
while f.tell() < self.POINTERS_END:
p = struct.unpack("<L", f.read(4))[0]
pointers.append(p)
f.close()
return pointers
def decode(self, data):
if not data[0]: