There was actually a tool "com2txt" back in the DOS days. So you could convert an executable and put it into an email....
Update: I have my data well sorted enough that I found it :-) It even comes with code and is under a vague free license: https://github.com/hannob/com2txt
Shameless plug: I also wrote a tool similar to com2txt in 1996: https://github.com/pts/pts-xcom . A quick comparison:
* com2txt.exe is 7110 bytes long, xcom.com is only 401 bytes long.
* xcom.com can also convert back from text to binary.
* xcom.com can also convert to data text (without the self-decoder header).
Can it also stop an alien invasion?
Send some aliens and test it out!
Thanks for sharing!
Kind of uncanny to see a perfectly readable Makefile written around the year I was born...
Make's been around since the '70s. Bell Labs cranked it out right after inventing C.
Back in the BBS/FidoNet days someone sent me a comic GIF that, when renamed with a .COM extension, would execute under DOS. It was a nifty little demo, although .COM files were going the way of the dinosaur around then.
Wish I could remember the trick, but in the DOS days I used to type in a few characters (5ish IIRC) at the start of text files that allowed them to be renamed and executed as COM files.
If you read the paper I think you'll find it is something like "ZM~~_#____PRinty__C", where _ is a space, (HTML compresses spaces). See section 8, also the beginning of the paper.
No, COM files had no header. [2] I think that's part of why they were replaced. ZM was for EXEs. I think that one was someone's initials. (Yes, looked it up. [1])
I think what parent is remembering were characters that effectively created a jump instruction at the beginning of the file.
[1] https://en.wikipedia.org/wiki/DOS_MZ_executable
edit: [2] Section 6 of the paper talks about that, just noticed.
They were replaced because they could not handle more than 64KB.
.COM files were straight binary, no header and loaded at address 256 (0x100) into any 64KB segment. All indirections were local to that segment, hence the 64KB limit of .com files.
The characters you were typing are (probably) the code for a jump to an entry point somewhere else in the file.
Does this output self-modifying code, or does it also try to avoid that like ABC does?
I also remember JauMing Tseng's XPACK...
Why not just use base64 (from 1992)?
It didn't just create a text file. It created an executable text file.
First two paragraphs of the README:
Com2txt is a tool on MS-DOS which converts a com file to a text file. It's DOS generic. Unlike tools such as uuencode, the text file generated by com2txt works as a com file, exactly like the original com file does. Using com2txt, you can create a com file which can be sent through networks such as internet, and runs without any decoding.
Moreover, the text file got by com2txt consists only of ECHOable characters; it doesn't contain characters such as `<' or `|'. So, using ECHO command, you can easily generate the textized com file and use it in a batch file. For detail see section 4.
I didn't gleam that from the original comment either.
Crazy fun stuff though.