Challenge

A compiled Python .pyc file presents a maze. The maze is generated procedurally and you must provide the correct path.

Approach

  1. Disassemble the .pyc with dis or uncompyle6:

    • The maze is generated by a Linear Congruential Generator (LCG) seeded with a fixed constant.
    • The expected move sequence is pre-computed and compared against input.
  2. Reverse the LCG to reproduce the maze grid:

1
2
3
4
5
6
7
8
def lcg(state):
    return (1664525 * state + 1013904223) & 0xFFFFFFFF

state = 0xDEADBEEF
maze = []
for _ in range(SIZE * SIZE):
    state = lcg(state)
    maze.append(state & 1)
  1. BFS/DFS the generated maze to find the solution path, then convert moves to the expected character encoding.

Flag

boroCTF{es4@pe_wA5_1nev!table}