Documentation
/
Basic Obfuscation
/

Control Flow Flattening

Control Flow Flattening

controlFlowFlattening

Transforms the code structure to hide the original program flow. Makes manual analysis much harder by converting linear code into a state machine with a switch statement.

JavaScript

This option can noticeably slow execution; measure it on your own code. Use controlFlowFlatteningThreshold to set the share of nodes that are flattened; lower values keep more of the performance.

JavaScript

Control flow flattening composes with the other basic options and with VM obfuscation. When vmObfuscation is enabled, virtualization runs first and control flow flattening then applies to the JavaScript that remains, such as functions not selected for the VM; code already compiled to bytecode is not flattened.