Extract Boot Code
BOOTEXE.ZIP or BOOTEXE.EXE
This program extracts the raw boot code from a COM file.
BOOTEXE (01.01, 03/15/98) - Extract boot sector from .EXE, write to .BIN
usage: BOOTEXE [-L (SIZE)] [(INPUTFILE)] [(OUTPUTFILE)]
BOOTEXE (01.01, 03/15/98)
BOOTEXE extracts the boot code from a EXE file.
-L (SIZE) specifies the size in bytes of the file.
If not specified, the size defaults to 8000h (32768) bytes.
(The standard size for a 512 byte boot record at 7C00h)
(INPUTFILE) defaults to BOOT.EXE
The EXE file must be (SIZE) bytes long.
The EXE file must be zeros from 0020h to 7DFFh.
The EXE file must only contain code in 7E00h to 7FFFh.
The EXE file must be zeros from 8000h to (SIZE).
(OUTPUTFILE) defaults to (INPUTFILE).BIN
The BIN file will be 200h (512) bytes long.
C:>BOOTEXE newboot.com newboot.bin
Open (INPUT) file.
Check (INPUT) filesize, must be (SIZE) bytes.
Check (INPUT), bytes 0020h..7DFFh, must be 00.
Read (INPUT), bytes 7E00h to 7FFFh, save in buffer.
Check (INPUT), butes 8000h to (SIZE), must be 00.
Close (INPUT) file.
Open (OUTPUT) file.
Write buffered bytes into (OUTPUT).
Close (OUTPUT) file.
I was originally extracting code from a .COM file.
Once the boot code was assembled and linked into a COM file, I had
to get it out into a separate 512 byte file so that BOOTSECT could use it.
This required an extra step in some cases to convert an EXE to COM (EXE2BIN),
so this program was written to extract the boot code directly from am EXE file.