You've already forked PythonLib
mirror of
https://github.com/lifebottle/PythonLib.git
synced 2026-02-13 15:25:50 -08:00
Move and tweak get pointers into talesTOR
code seemed TOR specific anyway
This commit is contained in:
10
ToolsTOR.py
10
ToolsTOR.py
@@ -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):
|
||||
|
||||
|
||||
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user