This repository hosts code relevant to malware development, supporting some articles I'm writing on medium.
This is mostly about retro computing (to the extent that an Intel x86 can be considered retro), and no code that could be considered dangerous will be distributed.
The products mentioned are copyright of their respective manufacturers. Although they are available from various websites, it is your responsibility to have a valid license.
- Bochs x86 PC Emulator
- MS-DOS 6.22
- Borland Turbo C++ 3.0 for DOS
- Borland Turbo Pascal 7.0 for DOS
- Borland Turbo Assembler 5.0 for DOS
The MS-DOS 6.22 can be replaced with a previous version (although I recommend you have at least 5.0), or IBM PC-DOS, FreeDOS, DR-DOS etc..
In this repo you'll find a dos.bxrc file preconfigured. After you install Bochs on your machine, just copy dos.bxrc in your working directory.
bximage -func=create -hd=80M -sectsize=512 -q c.imgIn case you want to change filename, or disk geometry, please update the file dos.bxrc (see BOCHS documentation for that).
The Bochs Image is already configured to support boot sequence from floppy disk/hard disk (how my computer did it).
When the emulator is ready, it will show an error because there is no bootable device, just click on floppy disk icon (A) and configure the first floppy disk for the operating system, set the floppy status as inserted and reboot the machine. When you're done this will be your command prompt:

After that, you can install all your favorite tools (Turbo Pascal, Turbo Assembler, Turbo c++ or whatever you need it!).
If your setup it works fine, you can build the examples.
You have two options to transfer data into bochs image:
- You can create an hard disk or floppy image and copy data inside it.. from linux using dd if=/dev/zero of=shared.img bs=1024 count=1440. After that you need to format the image as FAT12 or FAT16 (MSDOS doesn't support FAT32 or ExFat), mount it, copy files inside, unmount and mount as floppy when bochs is running.
- You can configure your floppy/hd in dos.bxrc using a VFAT media. Instead of image path, you need to write vvfat:yourfolder.
In both cases, remember that you are using MS-DOS, so the file names must be 8+3, case insensitive and in uppercase (in case of VFAT, not sure about every single distro with BOCHS).