Skip to content

Commit

Permalink
Made the sha256 file level hashing prototype more generalized
Browse files Browse the repository at this point in the history
  • Loading branch information
seiya-git committed Jan 1, 2024
1 parent 74b2613 commit 76b9376
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions py/nstools/Fs/Pfs0.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,14 @@ def updateHashHeader(self):
h += b'\x00\x00\x00\x00'
stringOffset += len(f['name']) + 1

stringTable += '\x00' * 12
if len(self.files) > 0:
if self.files[0]['offset'] - headerSize > 0:
stringTable += '\x00' * (self.files[0]['offset'] - headerSize - 1)
print(self.files[0]['offset'] - headerSize)
h += stringTable.encode()

headerHex = h.hex()
#print(headerHex)
#print(len(h), self.files[0]['offset']-headerSize)
self.binhash.update(h)
#print(self.binhash.hexdigest())
#exit()



Expand Down

0 comments on commit 76b9376

Please sign in to comment.