Skip to content

Commit 5268087

Browse files
Handle CArchive entries starting with an absolute file path, closes #67
1 parent cad8c74 commit 5268087

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyinstxtractor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ def parseTOC(self):
232232
self.fPtr.read(entrySize - 4))
233233

234234
name = name.decode('utf-8').rstrip('\0')
235+
236+
# Prevent writing outside the extraction directory
237+
if name.startswith("/"):
238+
name = name.lstrip("/")
239+
235240
if len(name) == 0:
236241
name = str(uniquename())
237242
print('[!] Warning: Found an unamed file in CArchive. Using random name {0}'.format(name))

0 commit comments

Comments
 (0)