RE / Cryptomedium
What the Sigma?
by Pavel Knespl (capyplivl)
message.txt is a brainrot "Sigma" esolang program: it reads stdin one byte at a time and switches on the byte's ASCII code, printing one slang word per byte. output.txt is the word stream produced for the flag. Build the code-to-word table from the source, invert it, and map each output word back to a character.
Solve
-
The esolang keywords map to C constructs:
skibidi mainismain,gooniswhile,slorp(chr)isgetchar,ohio (chr)isswitch, and eachsigma rule N: yapping("word")iscase N: printf("word")where N is the literal ASCII code. Parse the rules out of the source. -
Invert the table and decode output.txt:
import re
src = open("message.txt").read()
rules = {int(n): w for n, w in re.findall(r'sigma rule (\d+):\s*yapping\("([^"]*)"\)', src)}
word2code = {w: c for c, w in rules.items()}
flag = "".join(chr(word2code[w.strip()]) for w in open("output.txt") if w.strip())
print(flag)
- The words are all distinct, so the inversion is unambiguous. The first six words
hawk rizzing spiraling vibe shlawg gassymap to 83 86 73 66 71 82 =SVIBGR, and the body decodes to the leetspeak phrase "Generation Alpha Is Cooked".
Flag: SVIBGR{G3n3r47i0n_4lph4_Is_C00k3d}