<story><title>A dive into the world of MS-DOS viruses</title><url>https://blog.benjojo.co.uk/post/dive-into-the-world-of-dos-viruses</url></story><parent_chain></parent_chain><comment><author>alyandon</author><text>Ah yes, I have fond memories of writing TSR pranks that hooked common DOS interrupts (not technically viruses since they didn&amp;#x27;t infect&amp;#x2F;replicate) that did things like:&lt;p&gt;1) buffer 1 keystroke in memory (so typing diw&amp;lt;backspace&amp;gt;r would leave &amp;quot;di&amp;quot; on screen - then they&amp;#x27;d type &amp;quot;r&amp;quot; and get an &amp;quot;r&amp;quot; and then hit enter and get another &amp;quot;r&amp;quot;, then they&amp;#x27;d hit backspace to correct the &amp;quot;dirr&amp;quot; and the command would execute, etc)&lt;p&gt;2) hooked the printer interrupt to introduce typos in printouts&lt;p&gt;3) randomly swap letters on the screen periodically&lt;p&gt;Fun times.  It&amp;#x27;s probably for the best that I grew up in the era that I did since pulling pranks like these has a high risk of getting slapped with felony charges in this day and age.</text></comment>
<story><title>A dive into the world of MS-DOS viruses</title><url>https://blog.benjojo.co.uk/post/dive-into-the-world-of-dos-viruses</url></story><parent_chain></parent_chain><comment><author>kazinator</author><text>Guilty. In 1988 or so I made a virus that attached to .com files, which would spread it to others when executed. It was never released into the open. On each infection, it incremented a generation counter. Upon reaching a certain value, the payload would trigger, causing a message to be printed.&lt;p&gt;What the heck was I using? MASM? TASM? I cannot remember.&lt;p&gt;IIRC, looking for other .com files was just using DOS&amp;#x27;s FindFirst and FindNext functions at int 21h. (I&amp;#x27;m now naming them in terms of their Win32 counterparts.)&lt;p&gt;I think I didn&amp;#x27;t have a sanity check against duplicate infection in the early versions and added that during testing. 17 year old&amp;#x27;s programmer&amp;#x27;s &amp;quot;doh&amp;quot; moment.&lt;p&gt;I remember that I ran the experiments in a subdirectory called &amp;quot;petridir&amp;quot;. :)</text></comment>