Skip to content

Commit

Permalink
Added missing null terminator at the end of the string table
Browse files Browse the repository at this point in the history
  • Loading branch information
seiya-git committed Nov 10, 2023
1 parent 41c9a46 commit 95a45c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions py/nstools/Fs/Hfs0.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ 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)

h = b''
h += b'HFS0'
h += len(self.files).to_bytes(4, byteorder='little')
Expand Down
4 changes: 2 additions & 2 deletions py/nstools/Fs/Pfs0.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,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 95a45c0

Please sign in to comment.