.com vs. .exe

Started by
15 comments, last by capn_midnight 19 years, 6 months ago
What's the difference? When I use some old assemblers the output is a .com file. But all the C++ compilers I've ever used output .exe files.
Advertisement
.com is really old.

That's really all you need to know.
Yea, but why was it depreciated?
iirc, because it was nothing but machine code from the beginning of the file.

DOS would take the contents of the .com file, dump it into the beginning of a segment, and point the instruction pointer at :0000. (edit: or :0100... uncertain)

.exe's support all kinds of neat things, and aren't limited to 64k.
you know, I always wondered why more virus writers don't use com files. Think of how many people would be fooled if they got a file called Yahoo.com or something
Quote:Original post by pinacolada
you know, I always wondered why more virus writers don't use com files. Think of how many people would be fooled if they got a file called Yahoo.com or something
They're incapable of doing anything outside of DOS. So there'd be no way to propagate themselves.
what do you mean? how about packing the exe in a com file, and having the com file launch it (or move it to a prominent place in the hard drive)
in fact, the first virus was distributed by .com files, but that was when DOS and windows was only a dream
Quote:Original post by PaulCesar
what do you mean? how about packing the exe in a com file, and having the com file launch it (or move it to a prominent place in the hard drive)
oh yeah...
dunno.
Quote:Original post by pinacolada
you know, I always wondered why more virus writers don't use com files. Think of how many people would be fooled if they got a file called Yahoo.com or something
It's a common technique, actually.... the most well-known example I can think of would be the MyParty virus.

This topic is closed to new replies.

Advertisement