Software obfuscation is a widely used technique to protect programs against reverse engineering attacks. Among these, control flow flattening (CFF) proven effective in complicating program structure by replacing conditions and loops with dispatcher-based execution. However, existing techniques to CFF often lack a formal foundation, making them difficult for reasoning or generalization.
In this paper, we introduce theory for CFF based on Kleene Algebra with Tests (KAT). Our theory enables the systematic transformation of conditionals, loops, nested structures, and multi-statements into flattened control flow structure. We formally prove the behavior equivalence between the original and the flattened code. To illustrate the applicability of the theory, we apply the theory to a C program and analyze the flattened version. The analysis highlights the trade-off between security and performance: while the CFF version introduces runtime overhead compared to the original structured program, it significantly increases program complexity and resilience against reverse engineering.
If you have any questions about submitting your review, please email us at [email protected].