Skip to content

Commit

Permalink
Merge pull request #152 from nicoboss/string-table-null-terminator
Browse files Browse the repository at this point in the history
Added missing null terminator at the end of the string table
  • Loading branch information
nicoboss authored Nov 9, 2023
2 parents 994d7fa + 34250d4 commit 1ddd15a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nsz/Fs/Hfs0.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions nsz/Fs/Pfs0.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ddd15a

Please sign in to comment.