Skip to content

Commit

Permalink
Handle CArchive entries starting with an absolute file path, closes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
extremecoders-re authored Jun 8, 2023
1 parent cad8c74 commit 5268087
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyinstxtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ def parseTOC(self):
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))
Expand Down

0 comments on commit 5268087

Please sign in to comment.