Skip to main content

Module magic

Module magic 

Source
Expand description

File magic byte detection utilities.

Provides low-level file format detection by reading and checking magic bytes at the beginning of files. Used by parsers to disambiguate file types that share the same extension (e.g., Alpine .apk vs Android .apk).

Functionsยง

is_nsis_installer
Check if file contains NSIS installer signature.
is_squashfs
Check if file starts with Squashfs magic bytes.
is_zip
Check if file starts with ZIP magic bytes (PK\x03\x04).