Support files larger than 2GiB, closes #61

PyInstaller 4.3 added support for CArchive sizes >2GiB & <4GiB

Details:
- https://pyinstaller.org/en/stable/CHANGES.html#id81
- https://github.com/pyinstaller/pyinstaller/commit/937d8a
This commit is contained in:
extremecoders-re
2022-12-03 16:59:23 +05:30
committed by GitHub
parent 158b3748f6
commit 87690463cb

View File

@@ -192,7 +192,7 @@ class PyInstArchive:
# Read CArchive cookie # Read CArchive cookie
(magic, lengthofPackage, toc, tocLen, pyver, pylibname) = \ (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: except:
print('[!] Error : The file is not a pyinstaller archive') print('[!] Error : The file is not a pyinstaller archive')
@@ -224,11 +224,11 @@ class PyInstArchive:
# Parse table of contents # Parse table of contents
while parsedLen < self.tableOfContentsSize: while parsedLen < self.tableOfContentsSize:
(entrySize, ) = struct.unpack('!i', self.fPtr.read(4)) (entrySize, ) = struct.unpack('!i', self.fPtr.read(4))
nameLen = struct.calcsize('!iiiiBc') nameLen = struct.calcsize('!iIIIBc')
(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = \ (entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = \
struct.unpack( \ struct.unpack( \
'!iiiBc{0}s'.format(entrySize - nameLen), \ '!IIIBc{0}s'.format(entrySize - nameLen), \
self.fPtr.read(entrySize - 4)) self.fPtr.read(entrySize - 4))
name = name.decode('utf-8').rstrip('\0') name = name.decode('utf-8').rstrip('\0')