YTG123
link
fedilink
41Y

Isn’t the Windows exe also a renamed zip?

No. But the Windows office suite is
You can rename a docx and extract it.
Don’t know how it is with ppt/x and xls/x

xls & co. (the older ones) are something custom. Only after standardization as OOXML (a shitshow btw, there’s a lengthy wiki article about it) they got zip.

The whole Word and Libre/OO-Writer world is a shit show.
So complex and everyone decides to interpret it a bit differently.
Not even Libre and OO can be interoperabel between the same file and feature.

Fonzie!
link
fedilink
51Y

docx are mostly markup language, actually. Much like SVGs and PDFs.

No. The Office ???x files are archives. Inside them you can find folders with resources. Among those, you can find files written in markup languages.

Not quite the same thing.

Just rename your .docx file as .zip to check its contents.

Fonzie!
link
fedilink
21Y

Ah, last time I checked it was a kind of ML directly (XML, I’m guessing from cymor@midwest.social their comment), but that’s back in Office 2016’s time, so things might have changed.

Thanks for the heads-up!

Arent they straight up HTML being specially formatted?

Fonzie!
link
fedilink
-11Y

And HTML is a lot like it, all of them are Markup Language.

See, ZIP files are strange because unlike most other archive formats, they put the “header” and table of contents at the end, and all of the members (files within the zip file) are listed in that table of contents as offsets relative to the start of the file. There’s nothing that says that the first member has to begin at the start of the file, or that they have to be contiguous. This means you can concatenate an arbitrary amount of data at the beginning of a ZIP file (such as an exe that opens its argv[0] as a zip file and extracts it) and it will still be valid. (Fun fact! You can also concatenate up to 64KiB at the end and it will still be valid, after you do some finagling. This means that when a program opens a ZIP file it has to search through the last 64KiB to find the “header” with the table of contents. This is why writing a ZIP parser is really annoying.)

As long as whatever’s parsing the .exe doesn’t look past the end of its data, and whatever’s parsing the .zip doesn’t look past the beginning of its data, both can go about their business blissfully unaware of the other’s existence. Of course, there’s no real reason to concatenate an executable with a zip file that wouldn’t access the zip file, but you get the idea.

A common way to package software is to make a self-extracting zip archive in this manner. This is absolutely NOT to say that all .exe files are self extracting .zip archives.

unalivejoy
link
fedilink
English
2
edit-2
1Y

Just because you can open it with 7-zip doesn’t mean it’s a zip file. Some exes are also zip files.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog