From 34250d453ebe7f1582b2a678d0e45a1e5740e58a Mon Sep 17 00:00:00 2001 From: nicoboss Date: Thu, 9 Nov 2023 12:50:18 +0100 Subject: [PATCH] Added missing null terminator at the end of the string table --- nsz/Fs/Hfs0.py | 2 +- nsz/Fs/Pfs0.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nsz/Fs/Hfs0.py b/nsz/Fs/Hfs0.py index d1205b0..1150739 100644 --- a/nsz/Fs/Hfs0.py +++ b/nsz/Fs/Hfs0.py @@ -65,7 +65,7 @@ def close(self): super(Hfs0Stream, self).close() def getHeader(self): - stringTable = '\x00'.join(file['name'] for file in self.files) + stringTable = '\x00'.join(file['name'] for file in self.files)+'\x00' headerSize = 0x10 + len(self.files) * 0x40 + len(stringTable) diff --git a/nsz/Fs/Pfs0.py b/nsz/Fs/Pfs0.py index 9c5e526..e844d46 100644 --- a/nsz/Fs/Pfs0.py +++ b/nsz/Fs/Pfs0.py @@ -64,12 +64,12 @@ def close(self): super(Pfs0Stream, self).close() def getHeaderSize(self): - stringTable = '\x00'.join(file['name'] for file in self.files) + stringTable = '\x00'.join(file['name'] for file in self.files)+'\x00' headerSize = 0x10 + len(self.files) * 0x18 + self.stringTableSize return headerSize def getStringTableSize(self): - stringTable = '\x00'.join(file['name'] for file in self.files) + stringTable = '\x00'.join(file['name'] for file in self.files)+'\x00' stringTableLen = len(stringTable) if self._stringTableSize == None: self._stringTableSize = stringTableLen