food for thought: a message spelled in brainfuck, one cell at a time
huntress ctf 2026, day 26 · warmups · all three modes
tools used: decoding search engine and timed-attempt pipeline.
"a very small language has quite a lot to say." the very small language is brainfuck: eight one-character commands over a tape of byte cells. the single and the time trial were one brainfuck program each that prints the whole message; the mastery was a zip of a hundred and twenty-eight blobs of twenty-six numbered lines, whose twenty-sixth line was a short brainfuck program for the message's last few characters.
the key insight: these programs use three of the eight commands. there is no loop, no input and no pointer move, so the program is a delta code: one cell holds the current character, a run of + or - moves it to the next character and . prints it. any interpreter reads that, and the reading we registered on day 14 for esoteric languages answered every mode without a change.
challenge shape
single 1 field the slug one blob's decoded text instructs
time trial 1 field the same, a fresh blob
mastery 128 fields one slug per blob, 128 blobs of 26 numbered lines
the field is message (setK.message in mastery).
artifact anatomy
the single's blob is one long line with no newline, made of +, - and . and nothing else: one dot for each character of the sentence that names the slug. the first run of + raises the cell from zero to the first character's code; every later run is the difference between two neighbouring characters, upward with + and downward with -. the text is ascii, so the cell never wraps past 0 or 255, and the longest runs are the jumps between a space and a lowercase letter, ninety steps at most (space to z).
+++...+++. cell = first character, print
+++...+. up to the second character, print
---...-. down to the third, print
in the mastery each blob is NN<tab>chunk lines: one message split over twenty-six lines, line k encoded by day k's encoding, from base64 on line 1 through day 25's code points on line 25. line 26 is the same delta program for the message's last few characters, a few hundred commands.
extraction method
the decoding engine keeps a registry of readings and searches them over a blob until english with the answer's shape comes out. the brainfuck reading is a full interpreter rather than a delta decoder, so a program with loops and pointer moves reads the same way. it refuses anything that is not mostly brainfuck before it runs:
def brainfuck(text: str) -> str:
code = [c for c in text if c in "+-<>[].,"]
if len(code) < 8 or len(code) < 0.8 * len(text.replace(" ", "").replace("\n", "")):
raise ValueError("not brainfuck")
jump, stack = {}, []
for i, c in enumerate(code): # match brackets once
if c == "[":
stack.append(i)
elif c == "]":
if not stack:
raise ValueError("unbalanced brainfuck")
j = stack.pop()
jump[i], jump[j] = j, i
if stack:
raise ValueError("unbalanced brainfuck")
tape, ptr, pc, out, steps = [0] * 30000, 0, 0, [], 0
while pc < len(code):
steps += 1
if steps > 2_000_000:
raise ValueError("brainfuck ran too long")
... # + - < > . [ ]
return bytes(out).decode("utf-8")
the refusal matters for the search, not for this blob: brainfuck's command characters are common punctuation, and a reading that ran any text containing a . would print garbage into every candidate list. the step cap bounds a program that never halts; these programs take one step per command, a few thousand at most.
for the single and the time trial the whole-text search reached the brainfuck reading and its output held a slug of the question's shape. for the mastery the line reader decodes each numbered line by its day's reading first and searches only the lines the schedule does not name. line 26 was past the schedule, so the line search read it; on day 26 the schedule gained brainfuck as row 26, and that line is now read by its row before any search runs.
validation and answer formatting
the question asks for the slug that the final non-empty decoded line instructs us to submit, three lowercase words, a hyphen and a two-digit number. our decoded texts were single sentences with one slug-shaped token each, so the rule had nothing to choose between; the slug is submitted alone, happy-comet-blossom-79 for the single's blob, quiet-canoe-fern-21 for the time trial's and dashing-cactus-hazel-97, daring-storm-wagon-62, lively-cactus-fern-26 and 125 more for the mastery's 128 blobs. a reading whose output has no such slug is discarded.
failed approaches and pivots
none on day 26.
automation across modes
the same reading answered the single, the time trial and every mastery blob. the mastery's decode took 0.87 seconds for the whole zip.
lessons
- a loop-free brainfuck program is a delta code over one cell; it reads by a running sum, but a real interpreter costs the same and reads the programs that do use loops.
- a reading over common punctuation must refuse text that is not its own, or every search over every blob pays for it.
solve times
public scoreboard · day 26 finish: below top 10
- 0:03.5single#2 of 162 solvers
- 0:06.6time trial#2 of 156 solvers
- 0:11.2mastery#2 of 154 solvers
- #32team day finishof 135 teams that cleared it, in 19:21.9
- #1single orderof the day's 7, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from when we started working on the mode to its flag. attempts counts our solver runs.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 1.9s | 1 | 0 |
| time trial | 1.1s | 1 | 0 |
| mastery | 2.4s | 1 | 0 |
the clock
server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 30.0s | 1.1s | 28.9s |
| mastery | 145.0s | 2.4s | 142.6s |
where we got stuck
- nowhere on day 26: the brainfuck reading had existed since day 14, and the search reached it on the first run of every mode.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}