Skip to content

Commit

Permalink
Support files larger than 2GiB, closes #61
Browse files Browse the repository at this point in the history
PyInstaller 4.3 added support for CArchive sizes >2GiB & <4GiB

Details:
- https://pyinstaller.org/en/stable/CHANGES.html#id81
- pyinstaller/pyinstaller@937d8a
  • Loading branch information
extremecoders-re authored Dec 3, 2022
1 parent 158b374 commit 8769046
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyinstxtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def getCArchiveInfo(self):

# Read CArchive cookie
(magic, lengthofPackage, toc, tocLen, pyver, pylibname) = \
struct.unpack('!8siiii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))
struct.unpack('!8sIIii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))

except:
print('[!] Error : The file is not a pyinstaller archive')
Expand Down Expand Up @@ -224,11 +224,11 @@ def parseTOC(self):
# Parse table of contents
while parsedLen < self.tableOfContentsSize:
(entrySize, ) = struct.unpack('!i', self.fPtr.read(4))
nameLen = struct.calcsize('!iiiiBc')
nameLen = struct.calcsize('!iIIIBc')

(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = \
struct.unpack( \
'!iiiBc{0}s'.format(entrySize - nameLen), \
'!IIIBc{0}s'.format(entrySize - nameLen), \
self.fPtr.read(entrySize - 4))

name = name.decode('utf-8').rstrip('\0')
Expand Down

0 comments on commit 8769046

Please sign in to comment.