Skip to main content
48 votes

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

Plain DOS executables, in either COM or MZ format, don’t provide this information in their headers (when there is one — COM format doesn’t have a header). The only reliable way to determine whether a ...
Stephen Kitt's user avatar
36 votes

How can I extract the contents of a Windows 3.1 (16-bit) game EXE file?

Executable files for 16-bit Windows are usually laid out in the now-rather-inaccurately-named New Executable format. Most current Windows executable analysis tools do not support this format; they can ...
user3840170's user avatar
  • 23.1k
34 votes
Accepted

How did large .COM files work?

Most large files (over 64KiB) with a .COM extension are really MZ executables; the DOS loader doesn’t care whether the extension is .EXE or .COM, it uses the MZ signature to identify the format. This ...
Stephen Kitt's user avatar
24 votes

What was the purpose of the ‘overlay number’ field in the MZ executable format?

TL;DR: The Number is Used to Manage Multiple Overlays in a single EXE File. Microsofts linker (LINK) can create single EXE files containing multiple overlays (up to 63) which are simply numbered in ...
Raffzahn's user avatar
  • 225k
21 votes
Accepted

What tools were used in late MS-DOS era for reverse engineering and patching binary executables?

As others have mentioned, “Program too big to fit in memory” means that DOS can’t find a large enough memory block to fit the amount of memory that your program’s header requests. This can be either ...
Stephen Kitt's user avatar
20 votes
Accepted

Are .COM executable binaries real mode or protected mode?

DOS programs always start in real mode (or an emulation thereof), so it’s best to start disassembling them assuming that. When disassembling, you should assume real mode, with 16-bit data and 16-bit ...
Stephen Kitt's user avatar
17 votes

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

There is no easy way. The original DOS "MZ" type executable header do not contain such information about what kind of code it contains or what CPU type it needs. It just contains a binary ...
Justme's user avatar
  • 33.8k
13 votes

What tools were used in late MS-DOS era for reverse engineering and patching binary executables?

The simplest way to patch a .com file is DEBUG, which comes with any DOS installation. DEBUG is partially usable for .exe files as well, but cannot reverse their relocation process, and so cannot ...
tofro's user avatar
  • 35.2k
13 votes

Why does changing a DOS/Windows EXE cause it to not run?

If you change the lengths of strings in a binary, or indeed move any part of a binary around in any way, then you’re likely to break it: offsets to the data (and code) that the program expects to find ...
Stephen Kitt's user avatar
13 votes
Accepted

How can I properly execute and clean up after a DOS MZ executable loaded into memory with int21 function 4b01h?

Like user3840170 commented, the 21.4B01 call will change the current PSP to the newly created process. However, you should not free its memory on your own. Even if you change the current PSP back to ...
ecm's user avatar
  • 972
12 votes
Accepted

How to write Win16 program with only a single segment (combined code+data)?

I don’t think this is supposed to be possible at all. One reason why is that Windows may decide to run your program in protected mode. Your program obviously needs to have one executable segment to ...
user3840170's user avatar
  • 23.1k
10 votes
Accepted

Original purpose of the Rich Header in PE files

The Rich header is described in detail in this article by Daniel Pistelli. It contains identifiers for all the (Microsoft) compilers and related tools used to build the object files which end up in ...
Stephen Kitt's user avatar
9 votes
Accepted

Initial contents of CPU registers at OS/2 1.x program startup

My OS/2 manuals are currently in storage, but based on 2ine: AX points to the environment segment, BX gives the command-line offset, CX gives the size of the auto data segment, ES, DX, SI, DI, and BP ...
Stephen Kitt's user avatar
9 votes

What tools were used in late MS-DOS era for reverse engineering and patching binary executables?

a bit off topic to your actual question but to make your game/exe whatever usable again: Too much memory common on MS-DOS for 32MByte and 64MByte (IIRC some versions use 32 some 64). The memory ...
Spektre's user avatar
  • 7,276
9 votes

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

Is there some simple method for determining if a DOS binary (.exe or .dll) is 16-bit or 32-bit? For one, DOS doesn't know about 32 bit, it's a strict 16 bit system. Second, .DLL are not DOS ...
Raffzahn's user avatar
  • 225k
9 votes

Why do PC DOS kernel files have the COM extension, even though they are not executable as COM files?

Given that those files are not regular executables, why were they given the COM extension in the first place? They are executable files. They are loadable binary images. In so far they are exactly ...
Raffzahn's user avatar
  • 225k
7 votes

What tools were used in late MS-DOS era for reverse engineering and patching binary executables?

The state of the art in assembly-level debugging of DOS programs is almost certainly SoftICE. I've never used it, but my understanding is that it was for a very long time the tool of choice of ...
Jules's user avatar
  • 13k
7 votes

Are .COM executable binaries real mode or protected mode?

com files are not segmented (its just single segment). They have limitation that it can not cross 64K of code (filesize). They always starts in real mode but I do not think there is any restriction to ...
Spektre's user avatar
  • 7,276
7 votes

Why does changing a DOS/Windows EXE cause it to not run?

Adding or removing some text has the effect that things coming later in the EXE file are now found at a different absolute location, machine code as well as the EXE file format rely a lot on absolute ...
Ralf Kleberhoff's user avatar
6 votes
Accepted

What file formats were used for binary executable files on later Sinclair ZX Spectrums?

The original Spectrum +3 manual has a comprehensive description of the disk format: http://www.worldofspectrum.org/ZXSpectrum128+3Manual/chapter8pt27.html For TR-DOS, it's worth knowing that the ....
gasman's user avatar
  • 1,341
4 votes

Why does my MZ executable's BSS inflate by ~1,5KB after linking fopen() with MSC?

Turns out the MSC linker can put BSS data in an executable that is not referenced anywhere. I inspected the map file generated by the linker and found some public names (__bufin/__bufout/__buferr) ...
neuviemeporte's user avatar
3 votes

What file formats were used for binary executable files on later Sinclair ZX Spectrums?

TR-DOS Files themselves have no header at all. Metadata is stored in the directory section of the disk, along with the filename. The metadata has a type field, which is also the file extension. ...
hippietrail's user avatar
  • 6,654
2 votes

What tools were used in late MS-DOS era for reverse engineering and patching binary executables?

I have an old game I would like to run, but my DOS machine has too much RAM. The most proper way to run DOS applications in Windows is using DOSbox. "Program too big to fit in memory" It may ...
Anonymous's user avatar
  • 1,286
2 votes

Why does my MZ executable's BSS inflate by ~1,5KB after linking fopen() with MSC?

TL;DR: Linker Links Without Judgeing A linker doesn't know about programs and functions and even less about usage. A linker combines objects, including all segments and resolving open relation. If a ...
Raffzahn's user avatar
  • 225k
2 votes

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

Even within "16-bit mode", various 8086-compatible processors that have appeared over the years have extended the 8086 instruction set with instructions that weren't supported by earlier ...
supercat's user avatar
  • 37.1k
1 vote

How can I extract the contents of a Windows 3.1 (16-bit) game EXE file?

There was a tool from Borland that came with Borland Delphi 1.0. You pointed it at an EXE and it would show you all the resources that were embedded in the file. It was extremely useful. I don't ...
AvaTaylor's user avatar
  • 465
1 vote

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

For reference, I am posting the .txt and .ini files from the exetype program. ********************************************************************* EXETYPE 1.0 is a tool to determine the nature of an ...
Tomas By's user avatar
  • 2,102
1 vote
Accepted

How can I tell whether a DOS-looking exe. requires a 32-bit CPU to run?

There is in the windows nt resource kit, a program called 'exetype'. The 3.1 version is a DOS program, while liter ones, like 3.51, is a win32 program. You type exetype filename.ext to get its type. ...
wendy.krieger's user avatar
1 vote

Loading a Tandy CoCo or a Dragon 32 machine code program from cassette with multiple "name blocks"

Since the coco cassette interface used 1200 baud psk audio encoding in it, the tape format of the coco was 4X faster loading files from the tape and the tape files were 1/4th the size of similar files ...
Gary C's user avatar
  • 51

Only top scored, non community-wiki answers of a minimum length are eligible