diff --git a/nsz/Fs/Hfs0.py b/nsz/Fs/Hfs0.py index 2b7db31..d1205b0 100644 --- a/nsz/Fs/Hfs0.py +++ b/nsz/Fs/Hfs0.py @@ -68,13 +68,11 @@ def getHeader(self): stringTable = '\x00'.join(file['name'] for file in self.files) headerSize = 0x10 + len(self.files) * 0x40 + len(stringTable) - remainder = 0x10 - headerSize % 0x10 - headerSize += remainder h = b'' h += b'HFS0' h += len(self.files).to_bytes(4, byteorder='little') - h += (len(stringTable)+remainder).to_bytes(4, byteorder='little') + h += (len(stringTable)).to_bytes(4, byteorder='little') h += b'\x00\x00\x00\x00' stringOffset = 0 @@ -92,7 +90,6 @@ def getHeader(self): stringOffset += len(f['name']) + 1 h += stringTable.encode() - h += remainder * b'\x00' return h diff --git a/nsz/Fs/Nsp.py b/nsz/Fs/Nsp.py index 83b7a0f..57d45cf 100644 --- a/nsz/Fs/Nsp.py +++ b/nsz/Fs/Nsp.py @@ -407,8 +407,6 @@ def generateHeader(self, files): filesNb = len(files) stringTable = '\x00'.join(os.path.basename(file) for file in files) headerSize = 0x10 + (filesNb)*0x18 + len(stringTable) - remainder = 0x10 - headerSize%0x10 - headerSize += remainder fileSizes = [os.path.getsize(file) for file in files] fileOffsets = [sum(fileSizes[:n]) for n in range(filesNb)] @@ -419,7 +417,7 @@ def generateHeader(self, files): header = b'' header += b'PFS0' header += pk('