Handle CArchive entries starting with an absolute file path, closes #67

This commit is contained in:
extremecoders-re
2023-06-09 03:01:02 +05:30
committed by GitHub
parent cad8c74542
commit 5268087d25

View File

@@ -232,6 +232,11 @@ class PyInstArchive:
self.fPtr.read(entrySize - 4))
name = name.decode('utf-8').rstrip('\0')
# Prevent writing outside the extraction directory
if name.startswith("/"):
name = name.lstrip("/")
if len(name) == 0:
name = str(uniquename())
print('[!] Warning: Found an unamed file in CArchive. Using random name {0}'.format(name))