Creating a COM File from Text

The answer here is a rather fascinating trick. For my own edification, I would like to learn how to create this type of program.

Is there a good library that I can use to provide my full ASCII output? Or what tools would I use to create this type of output? I understand that I am most likely creating a 16-bit application, but can I also generate 32-bit applications?

I found that the MSFT debug.exe program has an assembler that works with this, but the output I get from this is not completely ASCII. Also, when disassembling the program presented in Lenik "η»§ ι›·, I don’t see where he calls int 21 to write to the screen. Is there more documentation for this type of program?

Can anyone else deal with these secrets, please?

+4
source share
4 answers

A text file is a very neat trick. It takes advantage of the fact that the 16-bit bootloader will load the image at offset 0x0100 and start execution from that address.

The exe file includes a binary header that cannot be represented as text. As a result, you cannot create a 32-bit or 64-bit executable file that exactly matches the text.

+4
source

A classic example of a .COM file using only printed characters is EICAR , a file used to test antivirus software. Some time ago in bugtraq there was a discussion about EICAR .

+4
source

There is really no "trick" here, other than careful use of the machine code that happens with all cards for ASCII characters. I cannot parse this code at the moment, but θ°’ η»§ ι›· 'Lenik indicates that there is some kind of self-modifying code.

+2
source

On the day of MSDOS programs, simple programs were written using an assembly, or perhaps compiled and linked to .COM, although this was not as common as collecting directly on .COM.

To find out what to do (pre-www), you received two or three guides, including the Peter Norton Programmer's Guide for the IBM PC , aka '' The Pink Shirt Book ''.

Ralf Brown's Interrupt List is a smart replacement and is online here .

If you do not have an old computer, it can be difficult to find a valid runtime for the MSOD.COM file.

+2
source

Source: https://habr.com/ru/post/1344687/


All Articles