logoalt Hacker News

mzajctoday at 6:14 PM1 replyview on HN

Software like 7-Zip supports many formats, even ones that are not usually treated as archives, and recognises them by magic bytes rather than extension. You can for example add a zip extension an EXE file, and 7-Zip will open it.

A much more robust way to figure out what's in a file is using libmagic, accessible through the `file` command on *nix. I don't know if there's an alternative Windows though.


Replies