One File, Six Codecs: Simply Change The Extension

Editorial Team
3 Min Read


Usually, if you happen to change a file’s extension in Home windows, it doesn’t do something constructive. It simply makes the file open within the incorrect applications that may’t decode what’s inside. Nevertheless, [PortalRunner] has crafted a file that may behave as six totally different filetypes, just by swapping out the extension on the finish of the filename.

The fundamental idea is straightforward sufficient. [PortalRunner] merely discovered a bunch of various file codecs that would feasibly be crammed in collectively right into a single file with out corrupting one another or complicated software program that masses these information.

All of it comes right down to how file codecs work. File extensions are principally meaningless to the content material of a file—they’re only a shorthand information so an working system can work out which program ought to load them. In truth, most information have headers inside that point out to software program what they’re and the way their content material is formatted. Because of this, you’ll be able to usually rename a .PNG file to .JPEG and it’ll nonetheless load—as a result of the working system will nonetheless hearth up a picture viewer app, and that app will use headers to know that it’s really a PNG and never a JPEG at coronary heart, and course of it within the correct means.

[PortalRunner] discovered a approach to merge the headers of assorted codecs, making a file that may very well be many differing types. The only file comprises information for a PNG picture, an MP4 video, a PDF doc, a ZIP archive, a Powerpoint presentation, and an HTML webpage. The info chunks for every format are lumped into one massive file, with the mixed headers on the very high. The hijinx required to drag this off put some limitations on what the file can comprise, and the information received’t work with all software program… but it surely’s nonetheless one file that has six codecs inside.

This doesn’t work for each format. You possibly can’t actually mix GIF or PNG for instance, as every format requires a special preliminary set of characters that need to be on the very starting of the file. Different codecs aren’t so persnickety, although, and you may mix their headers in a means that principally works if you happen to do it excellent.

For those who love diving into the binary specifics of how file codecs work, this can be a nice challenge to dive into. We’ve seen equally mind-bending antics from [PortalRunner] earlier than, like once they turned Portal 2 right into a webserver. Video after the break.

Share This Article