HI Cyber Con CTF 2026. Reverse engineering.

Obfuscated Flow

A flattened maze of decoy branches around four number puzzles. The lab was through it in 9 minutes.

Published 2 November 2026. Challenge by otolk1.

The brief

We recovered a secure gateway validator used to authenticate operators on an isolated node. Can you cut through and recover the flag?

  • rev-obs-flow.zip, 6 KB

In short

Obfuscated Flow hides a passkey check behind control flow flattening and decoy branches. Each block reduces to one condition that must equal zero, which leaves square roots, a linear system and discrete logs in prime fields. The binary's own success message supplies the two words the math leaves open.

Ten words behind a gateway

The 18,440 byte binary asks for a passkey of 47 characters, hiCTF and 40 more inside the braces. It reads those 40 as ten 4 byte words and checks them in six blocks behind one flattened dispatcher.

Slot 0 or Access Denied

Each block computes a value x and takes a token from an 8 slot table, slot 0 when x is 0 and slot x mod 7 + 1 otherwise. Only slot 0 continues. So every block says one thing, this value must be 0.

Square roots in a prime field

Words 0 and 1 are square roots modulo the prime 2^31 - 1. Each has two roots and only one reads as text, m4th for word 0. Words 8 and 9 are the two roots of a known sum and product, and two prime tests set their order.

Two discrete logs and a system

Words 4 and 5 hide in exponents, 7^c4 = 0x7bb949ec and 11^c5 = 0x0b3bbfc8 modulo 2^31 - 1. Baby step giant step finds both. A 2 by 2 linear system modulo 2^32 - 5 gives words 6 and 7.

The binary decrypts the rest

Words 2 and 3 are one point on an elliptic curve with many points. But the success message is keyed only by words 0, 1, 8 and 9, so a patched copy with the decoys disarmed decrypted its 98 bytes, flag included.

Access granted on the original

On the unmodified binary the passkey prints ACCESS GRANTED and exits 0. Changing its last character gives Access Denied. The lab had the flag 9 minutes after it started.

The insight

Once every flattened block reads as one value that must be zero, the maze is four small number theory problems, and the open pair never feeds the message key.

The flag

hiCTF{m4th_c0ntr0l_fl0w_3ll1pt1c_dlog_4f7b2c9e}

Loading