Many files that you use every day have a deep,
dark secret. I'm talking about Microsoft Office files, like for Microsoft Word,
Excel and PowerPoint, but also plenty of others like Mac office files,
or even the app files used for mobile apps. And even Java files like Minecraft .jar, which some
of you may be familiar with. And that secret is, they're actually just zip files in disguise.
You can literally just change the file extension from whatever it is
to zip and you can extract everything out of it, and check out what's inside.
So that's exactly what we'll do today. I'm gonna look at all the examples I could find.
We're gonna open 'em up, see how they work, it's kind of interesting what files and folders are in
these zip files that you thought were files, and we'll just check it out.
And at the end, I'll also go over a couple files that aren't zip files, but can still be opened up
with a file archiver, so those are cool too. Now, if you ever wanna try this yourself,
and actually there are some practical uses for this I'll go over, anyway all you have to do is
make sure that you have file extensions enabled so you can see them and change them. On windows,
you can do that by searching the Start Menu for "File Explorer Options".
Go to the View tab and then look for and uncheck "Hide extensions for known file types"
and then hit OK. And once you do that, then for any file types I mention,
you can either replace the extension completely with .zip, or just add .zip on the end.
It will work the same exact way. So let's get right into it, and we can start off
with Microsoft Office files. So this is gonna be any of the files that end in an "X" like
XLSX, DOCX, PPTX, anything like that. If we rename the Docx and go in there,
you can see, there are a few folders. We got stuff like docProps,
I assume that's properties. There's also "word", which seems to contain the contents
of the file itself. And then you've got sub folders, like theme and media. And this one
is actually useful because if you ever want to extract the full image quality out of
a Word document, you can just look for the images in this media folder,
instead of having to scroll through the whole document and look for them.
And then there are XML files, which is just a data format, and this is gonna have a whole
bunch of varying stuff, either settings or the document text itself. If we go into an Excel file,
we got the same general folder structure, we got docProps in there and then XL is the main
folder in here. And we could see there are folders for worksheets and themes.
So if you have multiple worksheets, this is where they would go. There's also other folders
and more XML files. So again, similar structure as Docx. For PowerPoint,
similar story, except this is the "ppt" folder.
And there's a whole bunch of more folders in this one, stuff like slide layouts, slides themselves,
notes, if you have notes on there, media, which again is gonna have pictures, stuff like that. So
quite a bit more. And you can usually tell just by the file names of these what they actually do,
and you can look through it all yourself. We can also look at the files made from
the Mac office apps, and this can actually be useful if you're sent a
"pages" or "numbers" or keynote file from someone using Mac and you're on windows.
Well, maybe you need to get an image out of it or something. You can just
open it up as a zip file and take it out. And these file types are .pages .key and .Numbers.
They seem to all have the same general structure so I'm not gonna go over each one individually,
but you can see there's folders for data, index, and metadata.
So index has the actual document data, it looks like. And data has images and
maybe some attached stuff in there. And then metadata folder has stuff like properties,
version history, things like that. And then in the main folder, you can also see that there are some
preview images. So JPEGs, and I guess that's probably used for thumbnails on the computer.
And I can also mention if you use OpenOffice or LibreOffice,
so these use the file type .ODT .ODS and .ODP, same types of programs as before. And in these,
we have stuff like content.XML, and several other XMLs like meta, style, settings,
you can probably guess what each of these are for. There's also a pictures folder.
I'm sure you can guess what's in that. And all of these again,
have the same structure. So no real surprises, pretty standardized,
it's neat to see what's actually in here. Here's some examples that you might not have thought of
for mobile apps. So mobile apps on Android and iOS, they get installed onto the phone
and they have either APK files for Android or IPA files for iOS. And both of these file types
are actually just zip files. So if we look in the Android APK file first,
we can see there are a bunch of these .dex files, which seems to be
executables with like the app itself. And then you're gonna have a bunch of other
supporting folders with different stuff. Assets has stuff like fonts and then UI pages or menus
I believe, and also resources. So these look like they have a ton of icons and images and color
info, stuff like that that might be used by the app. For iOS, if we open this up, there's actually
a couple sub-folders, and you can see this is actually the Minecraft PE app for iOS. And it
looks like there are a few folders that seem to be mostly metadata or extra stuff like app settings,
this "lproj" folder, it looks like it has a bunch of "nib" files, seems to be for like UI things.
Not totally sure, this is basically just after quick Googling. Though, most of the stuff seems
to be in the top level directory. So you have a whole bunch of these images. Also PCM files,
which are actually audio sound effect type files, and fonts even. Whole bunch of variety
in here. The largest file in here is a file called "minecraftpe" with no extension on it.
And I believe this must have to be the main executable for the app
itself. And that's just because it's so much bigger than everything else,
but I'm not a hundred percent. Then there's a few other miscellaneous examples. So .epub is
one that I've seen, it's for eBooks and stuff. So you can see in here one of the files is
content.opf and this appears to be the table of contents. I'm not really sure
what these other files are for, it's not really clear. Then there's some folders like images,
which seems to have like the cover of the book, and I assume anything else in there.
Text, which is the actual book text, and then styles, you can probably guess
what these are for. All right, so finally, we can look at the Minecraft.jar Java file.
I believe this is for servers mostly. But remember at the end I'm also gonna go over
some more file types that aren't zip files, but same idea. Anyway, so in this Minecraft.jar,
we can see in the top level directory there's a ton of these .Class files.
And basically the way I would describe it is that just files with a bunch of the various compiled
code and functions used by the program, a class is a programming term. And there's a whole bunch
of these folders, which seem to have a bunch of images, basically skins for different things.
So for example, you can see "mob" has image skins for all the monsters, animals, and NPCs.
For example, we can look at either the zombie or the creeper,
and when he opened it up, it just looks like the unwrapped version of that image.
And interestingly, there are separate folders for ender dragon, and villagers.
Probably cause each villager occupation has its own file. And they're just organized in here.
The ender dragon has a bunch of different components, I guess. So you have the eyes, the
beam that it shoots out, stuff like that all in here. But that's not the only image folder. So
all the other ones in here, most of them at least,
seem to be the same idea. So there's armor, you got the different like gold armor
you can see what it looks like. The environment, which has clouds, rain, snow. The terrain folder,
which interestingly just has the moon and sun images, no grass or anything. The items
folder has stuff like the chest, the bigger chest, the signs,
books, boat skins. And the GUI is really interesting too, because this has
images used for menus. And also like the popup UI for inventory, crafting,
enchanting table. This is what you actually see when you open these up. So I'm sure
you get the idea how this is structured. The code is actually in the class files,
it's not human readable though. And then the folders has mostly other assets that are just
used by the codes as variables or whatever, so they can be easily changed. All right so
now we can go over some other file types that aren't zip files exactly,
but you can still open them up with a file archiver like 7-Zip or WinRar. Usually if
you just right click on these and you can hit "Open Archive" and just see what's in them,
same as we were doing before. Before we do that though quickly again, if you wanna subscribe,
be sure to do that. Maybe check out some of the rest of the videos on my channel after this.
If you like it, subscribe, hit the bell to enable notifications. I only make
videos about twice a week, you don't want those getting lost in the rest of your subscriptions.
And also if you enjoyed this video so far hit the like button too. All
right so one of these files is the .MSI file, which is for Microsoft Installers,
it's an installer program. I actually made a whole video about this I'll mention later,
but basically if you open this up, you can see there are a bunch of these files in here.
Not exactly sure what they all do, but the biggest one is called Binary.WrappedExe.
Probably the main program or the main extractor program in here,
and MSI files just are used by Windows to install things, it's got all the
information for what files to put where, and you can see how they're all stored in here
now. Interestingly, some exe files, you may think of these as single monolithic files,
but some of them are actually packages. For example, installers like MSI,
there could be some as an exe that you can. What's inside will depend on the type of
installer package it's using. But for example, in this one for Visual Studio,
it doesn't have much in here, but you can see there's a couple things.
I think this is probably cuz it mostly downloads
the files from the web. Another example are .ISO files, these are disc image files. And
usually you can just mount these. And if you open it up with an archive program,
it's gonna look the same inside as if you did mount it. But this could be a good way,
if you're maybe concerned security wise, you can see what's inside without mounting it first.
Finally, as an honorable mention, this doesn't really fit anywhere else, but if you ever heard of
Adobe Illustrator, it's a drawing vector program, and it creates ".ai" files. And it turns out that
you can actually open this if you don't have Adobe Illustrator by simply renaming the extension from
".AI" to ".PDF", and it will show you the vector images in there anyway.
So I thought that's just a fun fact. Now,
if you're wondering why there are so many files that are actually just zip files,
it's basically because zip files are basically supported by every single operating system,
it's already created instead of the programmer going and creating their own archiving file type.
Zip files are super simple, it's good enough for most of the time. So what they just do is
rename the file extension so that the program can
identify which file types are supposed to be for that program,
and just open it up as if it was a zip file. So the program knows it's actually a zip file. It's
just easier to make it identify which programs are actually supposed to be for that file.
Now, if you enjoyed this video, the next video I'd recommend is where
I talked about MSI files versus exe files for installing programs. Which ones should you use?
If you have the choice at least. It's actually pretty interesting, you can click on that
right there. So anyway, thanks so much for watching guys and I'll see in the next one.