Handled zlib decompression errors and Added --info flag for metadata inspection #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request improves the tool’s robustness by adding defensive error handling around zlib decompression and introduces a new feature to inspect PyInstaller archive metadata without performing a full extraction. Additionally, a
.gitignorefile has been introduced to maintain a clean repository state.Changes Made
Safe zlib decompression (Bug Fix)
zlib.decompressin atry/exceptblock to handle corrupted archive data gracefully.New Feature:
--info/-icommand-i/--infothat prints metadata about the PyInstaller archive without extracting files.printInfo()method in thePyInstArchiveclass.argparseto allow users to runpython pyinstxtractor-ng.py -i <file>orpython pyinstxtractor-ng.py --info <file>.Maintenance
.gitignoreto exclude common build artifacts and extraction directories.Motivation & Context
While analyzing a specific binary, the script crashed due to a
zlib.erroron a corrupted entry. This made it impossible to extract the remaining valid files or inspect the archive.Before (Crash):

By catching this exception, the tool becomes more resilient and useful for reverse engineering potentially malformed or obfuscated binaries.
Furthermore, the addition of the
--infoflag allows users to quickly determine the Python version or PyInstaller version of a target executable without writing thousands of files to the disk. This is particularly useful for quick triage.Testing & Verification
zlibcrash. The tool now prints[!] Error: Failed to decompress CArchive entry...and successfully proceeds to extract the rest of the file contents.-ifunctionality: Ran the tool with the--infoflag on a valid PyInstaller executable. The output correctly listed the Python version, entry points, and file statistics.Related Issues
No specific issue linked.
Additional Notes
Example Output of
--infoor-i