TheDraw COM File
(→Sample files) |
|||
| Line 5: | Line 5: | ||
|released=1989 | |released=1989 | ||
}} | }} | ||
| − | '''TheDraw COM File''' is a format for | + | '''TheDraw COM File''' is a format for a character graphics screen, associated with the DOS software [[TheDraw Save File|TheDraw]]. The format was introduced in TheDraw v3.20 (1989-04). |
It is in the form of a [[DOS executable (.com)|DOS .COM]] file that, when executed, prints the graphics to the screen. | It is in the form of a [[DOS executable (.com)|DOS .COM]] file that, when executed, prints the graphics to the screen. | ||
| Line 12: | Line 12: | ||
There are three "types" of the format, distinguished by the byte at offset 6 having value 0, 1, or 2. | There are three "types" of the format, distinguished by the byte at offset 6 having value 0, 1, or 2. | ||
| − | Types 1 and 2 were introduced in version 4.00. TheDraw selects the type to use automatically. Type 1 | + | Types 1 and 2 were introduced in version 4.00. TheDraw selects the type to use automatically. Type 1 is rare; it is used only if the image is incompressible. |
== Identification == | == Identification == | ||
| + | === Identification - basic === | ||
Type 0 files start with bytes {{magic|eb 3d 90}}, and have <code>00</code> at offset 6. | Type 0 files start with bytes {{magic|eb 3d 90}}, and have <code>00</code> at offset 6. | ||
| Line 26: | Line 27: | ||
See also [[P-Screen COM Screen]], which looks a lot like type 0, except for the different signature string. | See also [[P-Screen COM Screen]], which looks a lot like type 0, except for the different signature string. | ||
| + | |||
| + | === Identification - advanced === | ||
| + | (For convenience, we include [[P-Screen COM Screen]] here, as it may need to be distinguished from TheDraw COM.) | ||
| + | |||
| + | The strings near the start of the file were often edited, so are not ideal signatures. The 7 bytes at offset 2 are used for various purposes, and also may not be good for identification. | ||
| + | |||
| + | That leaves the two bytes at the beginning of the file ("BoF") -- a jump instruction -- and the viewer machine code that it jumps to. These parts of the file seem to be identical in all files of a given type. Here's a table of viewer code locations: | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !Type !! BoF !! Viewer offs., size !! Payload offs. | ||
| + | |- | ||
| + | |0 || <code>eb 3d</code> || 63, 113 || 176 | ||
| + | |- | ||
| + | |1 || <code>eb 18</code> || 26, 68 || 94 | ||
| + | |- | ||
| + | |2 || <code>eb 3d</code> || 63, 177 || 240 | ||
| + | |- | ||
| + | |P-Screen || <code>eb 3d</code> || 63, 166 || 229 | ||
| + | |} | ||
| + | |||
| + | The following table is just one suggestion for signatures that could be used. It uses bytes starting with the instruction that contains the pointer to the payload data. (This pointer is different in all known versions, and it also ought to make false positives from unrelated COM files highly unlikely.) | ||
| + | |||
| + | {| class="wikitable" | ||
| + | !Type !! Sig. offs. !! Sig. bytes | ||
| + | |- | ||
| + | |0 || 117 || <code>8d 36 b0 01 fc 57 8b 0e 05 01 80 3e</code> | ||
| + | |- | ||
| + | |1 || 34 || <code>be 5e 01 8b 0e 04 01 fc bb 00 b0 3c</code> | ||
| + | |- | ||
| + | |2 || 104 || <code>be f0 01 ba da 03 b3 09 8b 0e 04 01</code> | ||
| + | |- | ||
| + | |P-Screen || 117 || <code>be e5 01 fc 57 8b 0e 05 01 80 3e 03</code> | ||
| + | |} | ||
== Specifications == | == Specifications == | ||
Latest revision as of 15:16, 10 February 2026
TheDraw COM File is a format for a character graphics screen, associated with the DOS software TheDraw. The format was introduced in TheDraw v3.20 (1989-04).
It is in the form of a DOS .COM file that, when executed, prints the graphics to the screen.
Contents |
[edit] Format details
There are three "types" of the format, distinguished by the byte at offset 6 having value 0, 1, or 2.
Types 1 and 2 were introduced in version 4.00. TheDraw selects the type to use automatically. Type 1 is rare; it is used only if the image is incompressible.
[edit] Identification
[edit] Identification - basic
Type 0 files start with bytes eb 3d 90, and have 00 at offset 6.
Type 1 files start with bytes eb 18 90, and have 01 at offset 6.
Type 2 files start with bytes eb 3d 90, and have 02 at offset 6.
Types 0 and 2 have the signature string "TheDraw COM file Screen Save" at offset 9, followed by byte 0x1a.
Type 1 has the shorter string "TheDraw COM file" at offset 9, followed by 0x1a.
See also P-Screen COM Screen, which looks a lot like type 0, except for the different signature string.
[edit] Identification - advanced
(For convenience, we include P-Screen COM Screen here, as it may need to be distinguished from TheDraw COM.)
The strings near the start of the file were often edited, so are not ideal signatures. The 7 bytes at offset 2 are used for various purposes, and also may not be good for identification.
That leaves the two bytes at the beginning of the file ("BoF") -- a jump instruction -- and the viewer machine code that it jumps to. These parts of the file seem to be identical in all files of a given type. Here's a table of viewer code locations:
| Type | BoF | Viewer offs., size | Payload offs. |
|---|---|---|---|
| 0 | eb 3d |
63, 113 | 176 |
| 1 | eb 18 |
26, 68 | 94 |
| 2 | eb 3d |
63, 177 | 240 |
| P-Screen | eb 3d |
63, 166 | 229 |
The following table is just one suggestion for signatures that could be used. It uses bytes starting with the instruction that contains the pointer to the payload data. (This pointer is different in all known versions, and it also ought to make false positives from unrelated COM files highly unlikely.)
| Type | Sig. offs. | Sig. bytes |
|---|---|---|
| 0 | 117 | 8d 36 b0 01 fc 57 8b 0e 05 01 80 3e
|
| 1 | 34 | be 5e 01 8b 0e 04 01 fc bb 00 b0 3c
|
| 2 | 104 | be f0 01 ba da 03 b3 09 8b 0e 04 01
|
| P-Screen | 117 | be e5 01 fc 57 8b 0e 05 01 80 3e 03
|
[edit] Specifications
- An overview of the decompression algorithm for type 2 is in the UNCRUNCH.PAS file included with TheDraw 4.x.
[edit] Software
- TheDraw - Refer to TheDraw Save File#Software (v3.20+)
- Deark
(Or just execute the file in a DOS environment.)
[edit] Sample files
- TACT538.ZIP - Most of the .COM files
- dexvert samples — image/theDrawCOM
- S. A. T. Survival Kit → MENU/{KIT.COM, SATS.COM} (type 1 files)
Examples of modified files:
- SAVE____.ZIP → SCREEN*.COM
- NU_ART.ZIP → PS.COM
- DVFAX.ZIP → *.COM
- s_nws500.zip → *.COM