Analysis model: gpt-5.5 xhigh

# Sidewinder Cracktro by PTL Club - Technical Dissection

`Sidewinder Cracktro` is a 27 December 1988 MS-DOS CGA cracktro by PTL Club.
Demozoo lists it as an MS-DOS production tagged `cga`, credits The Grand
Elusion for code and TMC for thanks, and notes that the release date is based
on the file date.

Release year: 1988

The preserved archive is a two-file static-screen loader: `SIDEWIND.COM` is a
116-byte COM program and `TITLE.PTL` is a literal 16 KB CGA page. The executable
does not draw pixels itself. It sets CGA mode 4, opens `TITLE.PTL`, asks DOS to
read the file directly into `B800:0000`, waits for a keypress, queues `S` plus
Enter in the BIOS keyboard buffer, patches `INT 42h`, and exits.

There are no old phone numbers or board listings in the visible frame or the
COM string table.

## Sources

- Demozoo production page:
  https://demozoo.org/productions/276176/
- Scene.org file page:
  https://files.scene.org/view/demos/compilations/lost_found_and_more/cracktro/sidewinder_cracktro.zip
- Scene.org archive:
  https://files.scene.org/get/demos/compilations/lost_found_and_more/cracktro/sidewinder_cracktro.zip

## Visual

This is a static CGA screen. The still below is decoded directly from
`TITLE.PTL` as the exact `B800:0000` page that the loader reads into video RAM.
It uses the same bright CGA mode-4 palette used for the nearby PTL cracktro
reference stills.

| Time | Still | What is happening |
| --- | --- | --- |
| `00:00.000` | ![Decoded Sidewinder Cracktro CGA title page](images/sidewinder-cracktro-cga-title.png) | The static `TITLE.PTL` page after the DOS `read` into `B800:0000`. It remains on screen until the user presses a key. |

The loader/control-flow map:

![Sidewinder Cracktro 116-byte loader map](images/sidewinder-cracktro-loader-map.png)

## Archive Inventory

Scene.org's file page reports a `2.81K` ZIP. The examined archive is:

```text
c4ff1c8f2b64824814fa9e184537def25476a7fb7a1862849e30393703dc2c51  sidewinder_cracktro.zip
```

ZIP central directory:

```text
SIDEWIND.COM    116 bytes  stored                 1988-12-27 04:17
TITLE.PTL     16384 bytes  deflated to 2477 bytes 1988-12-27 04:21
```

Extracted hashes:

```text
3795c3017fa3f41ae362a1993631bfdb8d2c8f612b96bc3c2627affcfbd1708b  SIDEWIND.COM
6ad4c7653e4292560f8fbcab03499a111ed39dc7d44ef11a9f5b4d5e30689aa7  TITLE.PTL
```

`SIDEWIND.COM` is not packed. Its whole architecture fits in 116 bytes:

```text
file 0000h..0069h  runtime 0100h..0169h  code
file 006Ah..0073h  runtime 016Ah..0173h  ASCIIZ filename "TITLE.PTL"
TITLE.PTL          4000h bytes            raw CGA mode-4 page
```

For a COM program, DOS loads file offset `0000h` at `CS:0100`, so runtime
offsets are file offsets plus `0100h`.

## Full Loader Hex

The entire executable:

```text
0000: fb b8 04 00 cd 10 0e 1f ba 6a 01 b8 00 3d cd 21
0010: 73 02 cd 20 50 5b b9 00 40 b8 00 b8 8e d8 33 d2
0020: b8 00 3f cd 21 b8 00 3e cd 21 b8 00 00 cd 16 33
0030: c0 8e d8 b8 cc 54 a3 08 01 b8 ff f0 a3 0a 01 a1
0040: 1c 04 50 05 04 00 3d 3e 00 75 03 b8 1e 00 a3 1c
0050: 04 5e c7 84 00 04 53 1f 46 46 83 fe 3e 75 03 be
0060: 1e 00 c7 84 00 04 0d 1c cd 20 54 49 54 4c 45 2e
0070: 50 54 4c 00
```

The filename starts at COM file offset `006Ah`, runtime `CS:016A`:

```text
54 49 54 4c 45 2e 50 54 4c 00  ->  "TITLE.PTL",0
```

There are no display strings in the COM. The title, credit, thanks line, and
"strike any key" prompt are all rasterized into `TITLE.PTL`.

## Startup And Open Path

The program begins by enabling interrupts and taking the display:

```asm
0100  sti
0101  mov ax,0004h
0104  int 10h
```

BIOS mode `04h` is CGA 320x200 4-colour graphics. The loader does not save the
previous mode.

It then makes `DS` point at the COM segment so the filename pointer is valid:

```asm
0106  push cs
0107  pop  ds
```

The file-open sequence:

```asm
0108  mov dx,016Ah       ; "TITLE.PTL"
010B  mov ax,3D00h       ; DOS open, read-only
010E  int 21h
0110  jae 0114h          ; continue if carry clear
0112  int 20h            ; open failed
0114  push ax
0115  pop  bx            ; BX = handle
```

`INT 21h/AH=3Dh` returns the file handle in `AX` when carry is clear. The
program copies it to `BX` for later DOS handle calls. If opening `TITLE.PTL`
fails, it exits immediately. Because mode 4 was already selected, that failure
exit can leave the user in CGA graphics mode.

## Disk Read As The Drawing Loop

The key visual operation is this five-instruction setup followed by DOS
function `3Fh`:

```asm
0116  mov cx,4000h       ; 16 KB
0119  mov ax,0B800h
011C  mov ds,ax
011E  xor dx,dx
0120  mov ax,3F00h       ; DOS read from handle BX
0123  int 21h
```

DOS function `AH=3Fh` reads `CX` bytes from handle `BX` into `DS:DX`. Here the
buffer is deliberately the CGA display segment:

```text
BX    = open handle for TITLE.PTL
CX    = 4000h
DS:DX = B800:0000
```

So the drawing loop is not a `rep movsw` in `SIDEWIND.COM`; it is hidden inside
DOS:

```c
read(handle, (void far *)0xB8000000, 0x4000);
```

This is the smallest useful architecture for a full-screen CGA cracktro page:
keep the bitmap external, open it, and stream it directly into video memory.
The loader does not allocate a RAM buffer and does not touch the pixels after
the read.

The program then closes the file:

```asm
0125  mov ax,3E00h       ; DOS close
0128  int 21h
```

It does not check the byte count returned by the read in `AX`, and it does not
check the close result. A short `TITLE.PTL` would leave the rest of the CGA page
unchanged or blank depending on the current video memory contents. The
preserved file is exactly `4000h` bytes, so the intended case is exact.

## Key Wait

The static title stays visible until one key is pressed:

```asm
012A  mov ax,0000h
012D  int 16h
```

BIOS keyboard function `AH=00h` waits and consumes a key. The returned
scan/ASCII word in `AX` is ignored. The user's actual key is only an
acknowledgement; the next section injects the command sequence the loader wants.

## Interrupt Vector Patch

After the keypress, the program switches `DS` to segment zero:

```asm
012F  xor ax,ax
0131  mov ds,ax
```

With `DS=0`, the program can access the interrupt-vector table and BIOS Data
Area by absolute offsets. It first writes interrupt vector `42h`:

```asm
0133  mov ax,54CCh
0136  mov [0108h],ax
0139  mov ax,F0FFh
013C  mov [010Ah],ax
```

Interrupt vectors are four-byte far pointers at `0000:(interrupt * 4)`.
`42h * 4 = 0108h`, so this stores:

```text
INT 42h offset  = 54CCh
INT 42h segment = F0FFh
INT 42h target  = F0FF:54CC
```

This same vector write appears in the nearby PTL `War Game Construction Set`
loader family. `SIDEWIND.COM` never calls `INT 42h` after writing it, so this is
not part of the display path. The conservative reading is that it is an
environment or video/BIOS compatibility patch expected by the cracked
follow-up program.

## Keyboard Buffer Injection

The explicit continuation mechanism is the BIOS keyboard circular buffer. In
the BIOS Data Area:

```text
0040:001A  keyboard-buffer head pointer
0040:001C  keyboard-buffer tail pointer
0040:001E  circular buffer start
0040:003E  circular buffer end pointer
```

Because `DS=0`, the loader reaches the tail pointer as `[041Ch]`:

```asm
013F  mov ax,[041Ch]     ; current tail offset
0142  push ax            ; save old insertion point
0143  add ax,0004h       ; reserve two 2-byte key entries
0146  cmp ax,003Eh
0149  jne 014Eh
014B  mov ax,001Eh       ; wrap if exactly at end
014E  mov [041Ch],ax     ; commit new tail pointer
```

Each BIOS keyboard-buffer entry is a word:

```text
low byte  = ASCII character
high byte = scan code
```

The loader writes the first synthetic key at the old tail:

```asm
0151  pop si
0152  mov word [si+0400h],1F53h
```

`1F53h` means ASCII `53h` (`S`) with scan code `1Fh`, the normal `S` key.

Then it advances to the next slot:

```asm
0158  inc si
0159  inc si
015A  cmp si,003Eh
015D  jne 0162h
015F  mov si,001Eh
```

And writes Enter:

```asm
0162  mov word [si+0400h],1C0Dh
```

`1C0Dh` means ASCII carriage return `0Dh` with scan code `1Ch`.

So the post-key behavior is:

```text
queue "S"
queue Enter
exit
```

A surrounding batch flow, shell prompt, menu, or cracked program can then
consume those two key events as though the user had typed:

```text
S<Enter>
```

One detail worth being precise about: this is not a fully general queueing
routine. It handles the normal empty-buffer path and the `old tail = 003Ah`
two-entry wrap case, but it only tests `tail + 4 == 003Eh`. If the old tail were
already `003Ch`, the committed tail would become `0040h` even though the second
stored word wraps to `001Eh`. After a blocking `INT 16h` read in a clean DOS
session this edge case is unlikely, but the code is clearly a compact launcher
hack, not a robust BIOS keyboard-buffer library.

## Exit

The program terminates immediately after writing the two synthetic keys:

```asm
0168  int 20h
```

Unlike `War Game Construction Set`, this loader does not switch back to text
mode before exiting. If the next consumer does not set its own mode quickly, the
CGA title page can remain visible after the COM returns to DOS.

## CGA Picture Format

`TITLE.PTL` is exactly one mode-4 CGA display page:

```text
file size = 4000h bytes
visible packed bytes = 16000
unused page bytes = 384
unused nonzero bytes = 0
```

CGA mode 4 stores four 2-bit pixels per byte:

```text
bits 7..6 -> pixel x+0
bits 5..4 -> pixel x+1
bits 3..2 -> pixel x+2
bits 1..0 -> pixel x+3
```

The display memory is split into even and odd scanline banks:

```text
offset = (y & 1) * 2000h + (y >> 1) * 80 + (x >> 2)

B800:0000..1FFF  even scanlines
B800:2000..3FFF  odd scanlines
```

Because `TITLE.PTL` is already arranged in that hardware order, a flat DOS read
to `B800:0000` is enough to present the screen.

Visible pixel histogram using the bright CGA reference palette:

```text
index 0 black           54611 pixels
index 1 bright cyan      3757 pixels
index 2 bright magenta   3154 pixels
index 3 white            2478 pixels
total                  64000 pixels
```

Colour bounding boxes:

```text
black:   x=0..319, y=0..199, pixels=54611
cyan:    x=0..318, y=11..187, pixels=3757
magenta: x=1..319, y=10..188, pixels=3154
white:   x=66..243, y=71..131, pixels=2478
```

The page is sparse: `12793` of the `16384` source bytes are zero. That is why
the ZIP deflates `TITLE.PTL` from 16 KB to 2477 bytes.

## What The Program Does

The whole loader in order:

```text
1. Enable interrupts.
2. Set BIOS video mode 04h.
3. Set DS = CS.
4. Open TITLE.PTL read-only.
5. If open fails, exit through INT 20h.
6. Set DS:DX = B800:0000.
7. Read 4000h bytes from TITLE.PTL directly into CGA video memory.
8. Close the file.
9. Wait for one BIOS keypress.
10. Set DS = 0000h.
11. Set INT 42h to F0FF:54CC.
12. Advance the BIOS keyboard-buffer tail by two entries.
13. Store synthetic key word 1F53h, meaning S.
14. Store synthetic key word 1C0Dh, meaning Enter.
15. Exit through INT 20h without restoring text mode.
```

The important inner loop is therefore not a pixel loop in the cracktro:

```asm
mov cx,4000h
mov ax,0B800h
mov ds,ax
xor dx,dx
mov ax,3F00h
int 21h
```

The design is practical 1988 DOS engineering: push a pre-rendered CGA screen
straight from disk to display memory, use BIOS for acknowledgement, seed the
keyboard buffer with the continuation command, and get out of the way.
