Control-Flow Flattening
Also called CFF.
Obfuscation that hides logic behind a dispatcher and state variable.
What it is
A control-flow obfuscation that breaks a function's natural branching into flat blocks selected by a central dispatcher loop and a state variable. The original order is encoded in data rather than the structure.
Why it matters
Flattening makes decompiler output and graphs nearly unreadable, sharply slowing reverse engineering. Recognizing the dispatcher pattern and recovering the real order is a common deobfuscation task.
In practice
A decompiled function reduced to a giant switch inside a while loop, with the true sequence hidden in a state variable.
What to look for
- One large dispatcher loop with a state variable.
- Functions that are hard to read in decompiled form.
- Uniform basic blocks that hide the real order.
Common mistake
Reversing it by hand. Use emulation or deobfuscation tools to recover the flow.
Practice it nearby
CyberKit has no tool for this term itself. These are the closest places to practice it.
- Decoder
Paste any opaque value. It names what it looks like and why, then decodes it: Base64 and other layers, number bases, hashes, JWTs, certificates, SIDs, User-Agents and MAC addresses.
- Decode Range
Name an opaque value before you read it: timestamps, encodings and hashes, all generated by the site's own converters.
In the field
Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.
-
Ghidra Open source
A disassembler and decompiler for reading what a sample's code actually does. Our notes.
-
YARA Open source
Writes rules that match a family's code or strings across many files. Our notes.
-
VirusTotal Commercial
Shows how many engines flag a file, plus its relations to domains and other samples.
-
ANY.RUN Commercial
An interactive sandbox where you watch a sample run and click through what it asks for.
Read next
- Obfuscation: Deliberately making code hard to read or analyze.
- Disassembly: Translating machine code back into human-readable assembly.
- String Stacking: Building strings byte by byte at runtime to hide them from triage.