Skip to content

DalCTF 2026

DalCTF 2026

I participated in DalCTF 2026 with my university's team UofRCTF, where I personally cleared the rev category. I found this misc/rev chall 'MS DOS Plumber' with 80s vibes very cool, and wrote a writeup for it.

DalCTF 2026

Misc/ MS DOS Plumber

Author: kidkraken

The challenge

My friend gave me a floppy with her modded version of Angel Ortega’s game Space Plumber (1997), but she said there was something wrong with one of the files. Can you help me fix, build, and run it?

We get an instancer URL that spins up a containerized DOSBox in the browser via noVNC. The whole challenge happens inside that emulator.

Poking around

Connecting to the instance drops me on Z:\>, which is DOSBox’s built in virtual drive (just the bundled commands like mount, imgmount, etc). The actual challenge files have to be on another drive.

Checked A: and found the “floppy”:

A:\>dir
SPLUMBER     <DIR>

Inside A:\SPLUMBER is a real source tree of Angel Ortega’s Space Plumber: src/, graph/, sound/, etc/, plus a MAKEFILE, README, and COPYING.

type README:

The README is in Spanish but the gist is:

  • Build it with DJGPP using make OS_TARGET=DOS
  • Run it from the same directory as splumber.pck

So the plan is: figure out where DJGPP is, install it, build the game, find whatever’s broken, fix it, run it.

Setting up DJGPP

There’s no make and no gcc on the path, but Z:\AUTOEXEC.BAT shows DOSBox mounts a C: drive too:

MOUNT C /root/dos/util
MOUNT A /root/dos/splumber

C:\UTIL contains the standard DJGPP install zips (the kind you’d grab off delorie.com back in the day):

  • DJDEV205.ZIP (core)
  • GCC930B.ZIP (gcc 9.3)
  • BNU2351B.ZIP (binutils)
  • MAK44B.ZIP (GNU make 4.4)
  • CSDPMI7B.ZIP (DPMI runtime, needed to actually run djgpp binaries)
  • UNZIP32.EXE and EDIT.COM

To install DJGPP you just unzip everything into one common directory and point a couple of env vars at it:

C:
md \DJGPP
cd \DJGPP
\UTIL\UNZIP32 \UTIL\DJDEV205.ZIP
\UTIL\UNZIP32 \UTIL\GCC930B.ZIP
\UTIL\UNZIP32 \UTIL\BNU2351B.ZIP
\UTIL\UNZIP32 \UTIL\MAK44B.ZIP
\UTIL\UNZIP32 \UTIL\CSDPMI7B.ZIP

SET DJGPP=C:\DJGPP\DJGPP.ENV
SET PATH=C:\DJGPP\BIN;C:\UTIL;Z:\

Sanity check:

Nice. Now we have a working toolchain.

First build attempt

A:
cd \SPLUMBER
make OS_TARGET=DOS

It chugs through a bunch of files and then dies on src/sp_sb.c:

build error

The relevant errors:

src/sp_sb.c:712:6: warning: missing terminating " character
src/sp_sb.c:712:6: error:   missing terminating " character
src/sp_sb.c:713:7: error: expected string literal before 'movl'
src/sp_sb.c:717:12: error: missing terminating " character
make: *** [makefile:84: sp_sb.o] Error 1

So the broken file is sp_sb.c (the SoundBlaster driver) and the issue is somewhere around line 712 to 717. Cracking it open with C:\UTIL\EDIT src\sp_sb.c and searching for sb_interrupt_handler shows this:

That’s the bug. The asm block treats every line of assembly as part of one big string literal split across newlines. Older gccs used to tolerate that, modern gcc (9.3 here) refuses, since C string literals can’t span lines without explicit escapes.

The fix is to make each line its own quoted string with a \n at the end, so gcc concatenates them properly:

C
asm("movl $96,%%ecx\n"
    "movl $0x80,%%eax\n"
    "movl %0,%%edi\n"
    "cld\n"
    "rep\n"
    "stosl"
    :
    : "m" (sb_mixing_buffer)
    : "%eax", "%ecx", "%edi");

Saved and reran make OS_TARGET=DOS.

Build success

This time it links cleanly and drops SPLUMBER.EXE (about 440 KB) in A:\SPLUMBER next to the existing SPLUMBER.PCK data file:

build success

SPLUMBER         439,578
SPLUMBER EXE     439,578
SPLUMBER PCK   4,082,052

(SPLUMBER with no extension is the unstripped djgpp coff binary, SPLUMBER.EXE is the same thing wrapped with the DPMI stub.)

Run it

A:\SPLUMBER>splumber

The game launches and we get the flag on the loading screen:

Flag

dalctf{d0s_d0s_d0s_yeah}

Screenshot 2026-06-06 at 4.42.09 PM.png (just cuz)

Discussion

Loading discussion…

Related solves

Keep reading

Complete archive