Analysis model: gpt-5.5 xhigh

# Arkanoid ][ - The Revenge of DoH by The FiRM - Technical Dissection

`Arkanoid ][ - The Revenge of DoH` is a July 1989 MS-DOS cracktro / cracked
game wrapper by The FiRM. Demozoo credits Lord Blix for the crack and lists the
production as an advert for several boards. Scene.org preserves a compact ZIP
with one DOS COM program and two FiRM text files.

Release year: 1989

The important technical point is that this is not only a static greeting. The
visible cracktro screen is short, but `ARK2FIRM.COM` is also a loader for an
embedded game image: it copies a 16 KiB payload to a higher segment, installs a
private interrupt vector, patches words inside the relocated payload, moves a
helper block, prints the greeting, waits for a key, reshapes DOS memory, switches
stack, and far-returns into the relocated program. The relocated program then
does path recovery, option parsing, hardware/config probing, critical-error
hooking, config-file repair, and finally `EXEC`s `REVOFDOH.DAT`.

The archive sidecars include BBS-era distribution/contact material. This writeup
does not reproduce that material; the included visual is the public greeting
screen, which contains no phone rows.

## Sources

- Demozoo production page:
  https://demozoo.org/productions/204145/
- Scene.org file page:
  https://files.scene.org/view/demos/compilations/lost_found_and_more/cracktro/arkanoid_2_cracktro.zip
- Scene.org group mirror file page:
  https://files.scene.org/view/demos/groups/the_firm/firm-arkanoid2.zip
- Scene.org archive used here:
  https://files.scene.org/get/demos/compilations/lost_found_and_more/cracktro/arkanoid_2_cracktro.zip

## Visuals

| Time | Still | What is happening |
| --- | --- | --- |
| `00:00.000` | ![Arkanoid 2 FiRM public greeting screenshot](images/arkanoid2-firm-demozoo.png) | Public Demozoo screenshot of the loader greeting. This is produced by the small front stub using DOS function `09h`, then held by BIOS keyboard wait. |

Generated loader map:

![Arkanoid 2 FiRM loader map](images/arkanoid2-firm-loader-map.png)

## Archive

Scene.org stores a 12,186-byte ZIP:

```text
f48ebb4f9cd3984e755416f785657614ffabda82ba662166cb4daa472729bdf9  arkanoid_2_cracktro.zip
```

ZIP contents:

```text
ARK2FIRM.COM  25088 bytes  1989-07-23 22:44  CRC 55a82d9f
FIRMBBS.TXT    1249 bytes  1989-07-08 15:14  CRC ba22529d
INFOFIRM       1278 bytes  1989-07-23 23:32  CRC 7625f2c4
scene.org.txt  3369 bytes  2019-05-28 20:31  CRC cdc3e155
```

Extracted hashes:

```text
f554293d2479c2f95302494da456b5a0c4badb91d5b342fd9951bbad593c7040  ARK2FIRM.COM
529d3f2c3b9e110bae3d9037d6b01adfea605dbeed44329e1465ccad7d9da658  FIRMBBS.TXT
875db1a5f1f9fa3382b80a2a049ee7e6575f19817367961a72dbebb43a2775c8  INFOFIRM
4129fc3793964dd11cf8e28971cefe77300343ebdb72e810ec65dfceafce9f80  scene.org.txt
```

The 2019 `scene.org.txt` file is archive metadata, not part of the 1989 loader.
`INFOFIRM` documents the command-line flags and crack note. `FIRMBBS.TXT` is a
distribution-sidecar board list and is deliberately not quoted here.

## Top-Level COM Loader

`ARK2FIRM.COM` starts as a normal DOS COM file at PSP-relative offset `0100h`.
The first stage assumes the COM defaults: `CS`, `DS`, `ES`, and `SS` initially
refer to the PSP segment. The program immediately builds a new in-memory layout.

The loader uses a segment I will call `A`:

```text
A = PSP segment + 0300h
```

The first copy loop is:

```asm
0100  mov ax,cs
0102  mov ax,ds
0104  add ax,0300h
0107  mov es,ax
0109  xor di,di
010B  mov si,0FE8h
010E  mov cx,4000h
0111  rep movsb
```

That copies 16,384 bytes from `CS:0FE8` to `A:0000`. In file terms, because COM
memory offset `0100h` is file offset zero, the copied source begins at file
offset `0EE8h`.

The first-stage loop is byte-for-byte simple:

```text
while CX != 0:
    ES:DI = DS:SI
    SI += 1
    DI += 1
    CX -= 1
```

No decompression is involved in this first move. It is a straight relocation of
an embedded 16 KiB chunk.

## INT 61h Hook

After the copy, the loader sets `DS` to the relocated segment and installs a
private interrupt vector:

```asm
0113  mov ax,es
0115  mov ds,ax
0117  mov ax,2561h
011A  mov dx,0272h
011D  int 21h
```

`INT 21h / AH=25h` sets an interrupt vector. So interrupt `61h` now points to:

```text
A:0272
```

When the relocated payload is disassembled with zero-based offsets, `A:0272`
is:

```asm
0272  mov ax,cs
0274  mov si,003Ch
0277  iret
```

This is not a visible effect. It is a tiny compatibility/protection service for
the embedded program. A caller using `INT 61h` receives the current code segment
in `AX` and a pointer-like offset `003Ch` in `SI`, then execution resumes through
`IRET`. In other words, the crack wrapper provides a private answer that the
relocated game can ask for later.

## Relocated Word Patches

The loader then patches words in the copied image:

```asm
0120  mov ax,es
0122  add ax,015Eh
0125  mov es:[001Ah],ax

0129  mov ax,es
012B  add ax,0400h
012E  mov es:[1105h],ax
0132  mov es:[110Ch],ax
```

Read these as segment constants:

```text
A:001A = A + 015E
A:1105 = A + 0400
A:110C = A + 0400
```

Then the loader copies another block:

```asm
0136  mov es,ax          ; ax is A+0400
0138  xor di,di
013A  mov ax,cs
013C  mov ds,ax
013E  mov si,02E8h
0141  mov cx,0D00h
0144  rep movsb
```

This copies 3,328 bytes from `CS:02E8` into `(A+0400):0000`. That source area
contains helper code and data also visible elsewhere in the file: OPL port
routines, DOS file helpers, an option parser, configuration-file buffers, and
hardware probes. The copied helper segment is what the patched words at
`A:1105` and `A:110C` point at.

The structure is therefore:

```text
COM PSP segment
  0100h front loader
  0180h greeting string
  02E8h helper block source
  0FE8h relocated payload source

A = PSP+0300h
  0000h relocated payload
  0272h INT 61h private service
  000Eh second-stage entry

A+0400h
  0000h helper block copied from 02E8h
```

## Greeting Screen

The front visible cracktro routine is at `0169h`:

```asm
0169  push ds
016A  mov ax,cs
016C  mov ds,ax
016E  mov ax,0002h
0171  int 10h
0173  mov dx,0180h
0176  mov ah,09h
0178  int 21h
017A  xor ax,ax
017C  int 16h
017E  pop ds
017F  ret
```

It does exactly four things:

1. points `DS` back at the COM segment so the greeting string is addressable;
2. uses BIOS `INT 10h / AH=00h` to select video mode `02h`;
3. prints the `$`-terminated string at `0180h` with DOS `INT 21h / AH=09h`;
4. waits for one key with BIOS `INT 16h / AH=00h`.

The visible screen is not written through `B800h`, not blitted, and not animated.
It is a DOS string print. The code does not even write individual characters in
a loop; DOS owns the inner character-output loop for function `09h`.

The greeting string begins at `0180h` and ends with `$` at `02E7h`. That end
address is why the helper source can begin neatly at `02E8h`.

## Memory Resize And Stack Switch

After the keypress, the front loader prepares to run the relocated payload:

```asm
0149  mov ax,cs
014B  mov es,ax
014D  mov bx,07F0h
0150  mov ah,4Ah
0152  int 21h

0154  mov ah,48h
0156  mov bx,0700h
0159  int 21h

015B  pop ds
015C  cli
015D  mov ss,ax
015F  mov sp,1FFEh
0162  sti
0163  mov ax,000Eh
0166  push ds
0167  push ax
0168  retf
```

The `4Ah` call resizes the original allocation block. The `48h` call allocates
`0700h` paragraphs, which is 28,672 bytes. DOS returns the new allocation segment
in `AX`; the wrapper uses it as the stack segment:

```text
SS = allocated segment
SP = 1FFEh
```

Then it performs a far return to:

```text
A:000E
```

That is the relocated second-stage entry. This is a common DOS loader trick:
set up the target address on the stack and use `RETF` instead of a far jump.

## Relocated Stage Entry

If the copied `CS:0FE8` chunk is disassembled as a zero-based payload, the entry
at `A:000E` is:

```asm
000E  mov cs:[0032h],es
0013  call 0278h
0016  call 0291h
0019  mov ax,3ED0h
001C  mov ds,ax
001E  call 031Ch
0021  call 0116h
0024  call 0139h
0027  call 00B9h
002A  call 00A6h
002D  mov ax,4C00h
0030  int 21h
```

The first instruction saves the segment passed through `ES`. The exact historical
runtime segment depends on DOS allocation state, but the control-flow shape is
clear:

```text
save segment base
install/check private vectors
recover launch directory
run setup/config hardware logic
resize memory for child
EXEC REVOFDOH.DAT
restore directory/vector state
exit to DOS
```

Some calls enter areas that are partly original game setup code rather than
FiRM-only cracktro code. The safe boundary is to describe what the wrapper does,
not to claim that every copied byte is original FiRM effect code.

## Path Recovery

The routine at relocated `0291h` records the current drive, asks DOS for the
current directory, then walks the environment block to find the program path:

```asm
0291  mov ah,19h
0293  int 21h              ; current drive
0295  mov cs:[00CEh],al
0299  mov cs:[0110h],al

029D  mov ah,47h
029F  xor dl,dl
02A5  mov si,00D0h
02A8  int 21h              ; current directory
```

Then it follows the PSP environment pointer:

```asm
02AA  mov es,cs:[0032h]
02AF  mov di,002Ch
02B2  mov es,es:[di]       ; ES = environment segment
02B5  xor al,al
02B7  xor di,di
02B9  mov cx,8000h
02BC  repne scasb          ; find first NUL
02BE  cmp byte es:[di],00h
02C2  jne 02BCh            ; continue until double-NUL
```

After the double-NUL, DOS stores the program path. The code skips a possible
drive prefix, searches backward for the last backslash, terminates the path, and
calls `INT 21h / AH=3Bh` to change directory. That is deliberate: the wrapper
wants later file opens and the `EXEC` target to resolve relative to the directory
where the COM was launched.

The backward slash search is careful:

```text
find end of ASCIIZ path
set AL = '\\'
set direction flag
scan backward for '\\'
clear direction flag
write NUL just after the directory separator
chdir to the resulting directory
```

The use of `STD`/`CLD` around `REPNE SCASB` is the interesting inner loop. It
lets one instruction scan memory backward until the separator appears.

## Critical Error Hook

Relocated `0412h` hooks DOS critical errors:

```asm
0412  push ds
0413  mov ax,3524h
0416  int 21h
0418  mov cs:[040Eh],bx
041D  mov cs:[0410h],es
0422  mov ax,cs
0424  mov ds,ax
0426  mov dx,0458h
0429  mov ax,2524h
042C  int 21h
042E  pop ds
042F  ret
```

The handler at `0458h` is tiny:

```asm
0458  inc byte cs:[0457h]
045E  xor al,al
0460  iret
```

The practical reason is DOS file access. If a drive or file operation triggers a
critical error, the wrapper does not want DOS to halt at an interactive
"Abort, Retry, Ignore" prompt before the cracked game setup even starts. It
counts the event and returns a controlled failure.

The restore routine at `0430h` writes the saved vector back with `INT 21h /
AH=25h`, then clears the saved pointer. This is small but important etiquette:
the wrapper does not leave the critical-error vector redirected after the child
run.

## File Helpers And Config Repair

The relocated payload has small wrappers around DOS file calls:

```asm
03A9  mov al,00h
03AB  mov ah,3Dh
03AD  int 21h        ; open read-only

03B2  mov ah,3Eh
03B4  int 21h        ; close

03B7  mov cl,00h
03B9  mov ah,3Ch
03BB  int 21h        ; create

03C7  mov ah,3Fh
03C9  mov dx,0B66h
03CC  mov cx,0018h
03CF  int 21h        ; read 24 bytes
```

There is a companion `4Eh`-byte read path and write paths that copy data between
a scratch buffer at `0B66h` and internal config blocks at `003Ch` and `0054h`.
The filenames visible in the payload include:

```text
REVOFDOH.DAT
DOH.CFG
REVOFDOH.SCR
```

The control flow is roughly:

```text
try opening config-like file
if present:
    read exact-size record
    copy into internal config block
else:
    create file
    write default internal config block
```

The read helpers check both carry and exact byte count:

```text
if DOS call failed: carry remains failure
else if AX != expected_count: force carry
else: success
```

That is better than many tiny cracktros of the same era. It treats short reads
as invalid rather than blindly accepting partial configuration.

## Command-Line Option Parser

The included `INFOFIRM` text says the wrapper can receive one-letter options.
The parser at relocated `0475h` confirms that. It starts at the PSP command tail:

```asm
0475  mov bx,0081h
0478  mov al,es:[bx]
047B  inc bx
047C  call 0573h       ; uppercase if a-z
047F  cmp al,0Dh
0481  je done
```

The uppercase helper is:

```asm
0573  cmp al,'a'
0575  jb  done
0577  cmp al,'z'
0579  ja  done
057B  sub al,20h
057D  ret
```

Then the parser folds option letters into state bytes:

```text
T -> graphics bit 80h
C -> graphics bit 04h
E -> graphics bit 08h
H -> graphics bit 02h

K -> input bit 01h
M -> input bit 02h
J -> input bit 04h

N -> music code 06h
I -> music code 07h
Y -> music code 0Bh
A -> music code 13h

1/2 -> player count
G/X -> game or construction-set start
R -> reset config
? -> help screen
```

The parser is simple but compact. Each category routine loads a candidate bit
or code into `CH`, compares `AL`, and if it matches stores `CH` into the relevant
configuration byte and sets a "specified by command line" mask in `CS:003Ah`.

The inner loop is:

```text
repeat:
    AL = next command-tail byte
    uppercase AL
    if AL == CR: stop
    try graphics table
    try input table
    try music table
    try player/start/reset/help cases
    continue
```

There is no DOS argument tokenizer. Spaces and punctuation are just ignored
unless they match one of the recognized command letters.

## Hardware Detection

The setup code probes several hardware families:

- CRTC mono/color ports around `03B4h` and `03D4h`;
- EGA/VGA presence through BIOS `INT 10h / AH=12h`;
- display-combination information through `INT 10h / AX=1A00h`;
- Tandy markers near the top of memory;
- mouse driver presence through `INT 33h`;
- status bits around the BIOS data area;
- vertical retrace on port `03DAh`;
- sound-related ports including `0388h`.

The OPL-style write helper in the copied helper block is characteristic:

```asm
02FE  push ax
02FF  push cx
0300  push dx
0301  mov dx,0388h
0304  out dx,al
0307  call 031Ch
030A  mov al,ah
030C  inc dx
030D  out dx,al
0310  mov cx,0007h
0313  call 031Ch
0316  loop 0313h
0318  pop dx
0319  pop cx
031A  pop ax
031B  ret
```

`031Ch` is the delay/read helper:

```asm
031F  mov dx,0388h
0322  mov cx,0007h
0325  in  al,dx
0328  loop 0325h
```

This is not music playback. It is register poking and status-delay logic. The
later detection path also reads timer/status bits and compares masked values.
The wrapper is trying to infer a working configuration and write one-time setup
state so the user does not have to pass options every time.

The VGA retrace check is similarly direct:

```asm
112A  mov dx,03DAh
112D  xor cx,cx
112F  in  al,dx
1130  test al,08h
1132  jne 1138h
1134  loop 112Fh
...
113A  in  al,dx
113B  test al,08h
113D  je 1147h
113F  loop 113Ah
```

This code waits for a transition into and out of vertical retrace, bounded by
`CX` rolling down from zero. If it cannot observe the expected transition, it
sets a flag at `004Dh`.

## EXEC Handoff

The actual game handoff is at relocated `0139h`:

```asm
0139  mov ax,cs
013B  mov es,ax
013D  mov ds,ax
013F  mov bx,0178h
0142  mov dx,016Ah
0145  mov ax,4B00h
0148  mov cs:[0166h],ss
014D  mov cs:[0168h],sp
0152  int 21h
0154  cli
0155  mov ss,cs:[0166h]
015A  mov sp,cs:[0168h]
015F  sti
0160  jae 0165h
0162  call 0188h
0165  ret
```

`DX=016Ah` points at:

```text
REVOFDOH.DAT
```

`BX=0178h` points at the EXEC parameter block. The wrapper saves `SS:SP` before
calling DOS and restores it afterwards, which is the conservative way to run a
child program from a custom stack arrangement.

If the `EXEC` fails, `0188h` prints a DOS-error-specific message using the
message table beginning near `01C5h`. The visible strings include the standard
cases for invalid function, file not found, access denied, insufficient memory,
invalid environment, invalid format, and an unknown error fallback.

So the preserved `ARK2FIRM.COM` is self-contained as a wrapper, but it still
expects the external `REVOFDOH.DAT` child. The Scene.org ZIP does not contain
that child file; it preserves the cracktro/loader front end and metadata, not a
complete runnable game directory.

## Why This Is A 1989 PC Cracktro, Not A 1990s Demo

The visible part is modest: one text greeting and a key wait. Judged only by the
public screenshot, it looks like another static loader card.

The code is more interesting than that. It shows a late-1980s PC cracking
workflow:

- the greeting is only the front skin;
- the real work is DOS memory layout, vectors, config files, and handoff;
- the wrapper understands DOS PSP/environment details;
- it patches relocated segment constants manually;
- it supplies a private interrupt service rather than simply overwriting bytes;
- it handles critical errors and failed child execution;
- it tries to auto-select graphics, input, and sound settings from hardware.

That is why `Arkanoid ][ - The Revenge of DoH` belongs in the 1989 pass. It is
not visually spectacular, but it is technically richer than a batch wrapper and
more pragmatic than a pure graffiti screen. It sits right in the transition from
"show a crack note before the game" to "ship a small DOS loader that actively
mediates the game environment."
