Control-flow Flattening hinders program comprehension by creating convoluted switch statements.
⚠️ Significantly impacts performance, use sparingly!
Option name: "controlFlowFlattening"
Option values: true/false/0-1
This example showcases how Control Flow Flattening transforms the code. Try it out by changing the input code and see changes apply in real-time.
Input.js
Output.js
Control Flow Flattening requires non-strict mode to work. This is because the with statement is used to conceal local scope variables.
Control Flow Flattening transforms the code into a large, convoluted switch statement. This switch statement is intended to replicate the functionality of the 'goto' statement seen in other languages.
The switch statement is designed to be difficult to follow, making it harder for reverse engineers to understand the program's flow.
The provided code example will obfuscate the file input.js and write the output to a file named output.js.
Usage Example
Control Flow Flattening reduces the performance of your program. You should adjust the option controlFlowFlattening to be a percentage that is appropriate for your app.
Control Flow Flattening only applies to: