Skip to content

Releases: trailofbits/polyfile

PolyFile v0.5.6

11 Feb 22:05
d6818f6

Choose a tag to compare

Performance Improvements

  • Lazy loading throughout: Startup time significantly reduced by deferring heavy imports until first use:
    • PDF parser now lazily loads pdfminer only when parsing PDFs
    • NES parser lazily loads PIL/Pillow only when rendering CHR graphics
    • Kaitai parsers load on-demand per format instead of all at once
  • Caching optimizations: descendants(), mimetypes(), and all_extensions() now return cached tuples instead of regenerating on each call

Bug Fixes

  • PDF parser robustness: Fixed crashes on malformed PDF files:
    • Empty lists now return safe zero-length wrappers instead of raising ValueError
    • Malformed dictionary values are now logged and skipped rather than causing crashes
  • Python 3.14 compatibility: Fixed forward reference handling for PEP 649 compliance

New Features

  • Magic test strength scoring: Implemented libmagic-compatible test strength calculation for better match prioritization
  • UTF-16 string support: Extended lestring16/bestring16 to support byte-length modifiers
  • Endianness flip infrastructure: Added foundation for flipped endianness matching (partial implementation)

Magic Definitions

  • Major update: Synced with upstream libmagic definitions
  • New formats: Added detection for bgcode, creativeassembly, keyman, lauterbach, R language, sf3, syd, tapebackup, uxn, and more
  • Expanded coverage: Significant additions to DOS/Windows (+1300 lines), archive (+500 lines), console (+500 lines), images (+680 lines), and Linux (+500 lines) format detection

Breaking Changes

  • Python 3.9 no longer supported: Minimum Python version is now 3.10
  • pdfminer.six version: Now requires version 20251230 or newer

Dependencies

  • Added filelock>=3.20.3
  • Added packaging>=21.0 (replacing deprecated pkg_resources)
  • Updated pdfminer.six requirement to >=20251230

PolyFile v0.5.5

10 Mar 16:08

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.4...v0.5.5

PolyFile v0.5.4

29 Nov 21:53
98fc3c8

Choose a tag to compare

This release switches to using importlib for loading resources. This fixes an issue if PolyFile is installed from an sdist into a discrete venv with resources stored separately from the code.

Documentation on extending PolyFile is also improved.

PolyFile v0.5.3

20 Nov 16:20

Choose a tag to compare

This release ends official support for Python 3.7, updates its use of fickling to a new API, and adds missing build dependencies to the source distribution.

PolyFile v0.5.2

24 May 23:49

Choose a tag to compare

Adds support for detecting Python pickle serializations.

PolyFile v0.5.1

10 May 14:56
f399084

Choose a tag to compare

Adds support for parsing HTTP/1.1 request headers.

PolyFile v0.5.0

22 Nov 15:59
ec0216f

Choose a tag to compare

Significant improvements to the libmagic DSL matching engine. PolyFile now supports the distinction between "text" and "binary" tests, similar to libmagic. This version of PolyFile has been validated against the ~1k file Corkami test corpus.

Several new features were added to PolyFile's interactive debugger.

Breaking Change: Prior to this release, the default behavior of PolyFile was to output its matching results in JSON format (--format json). As of version 0.5.0, PolyFile will now default to mimicking the output of libmagic's file command (--format file).

PolyFile v0.4.2

09 May 16:09

Choose a tag to compare

Updates to the command line interface to allow for greater flexibility in specifying output formats and output files. These updates are backwards-compatible, however, in the forthcoming v0.5.* release there will be a breaking change in the output: PolyFile will then default to the mime output format (to mimic the behavior of the file command) rather than the current sbud output.

This release also includes optimizations to the libmagic search and string tests which should result in significant speed improvements.

PolyFile v0.4.1

07 Apr 19:57
fb101ec

Choose a tag to compare

Bugfix release.

Adds better support for Windows.

Fixes bugs that could cause Kaitai Struct parsers to report incorrect offsets.

PolyFile v0.4.0

11 Feb 02:19
9c2d20b

Choose a tag to compare

Major matching API refactor.

Replaces Didier Stevens' PDF parser with an instrumented version of PDFminer, producing a significant speedup.

JavaScript optimizations for a speedup in the HTML output.

Adds an interactive debugger for the libmagic DSL as well as custom parsers.