Challenges
Flattened JS flow
Reverse engineering
Medium
Undoing JavaScript control-flow flattening and a string array
Solves: 3
Flattened JS flow
Author: CyberSamSU
Points
50
The licence checker checker.js (Node.js) was processed with an obfuscator: the string array was rotated (_0x....), and the logic was "flattened" into the form while(!![]){switch(order[i++]){...}}. The script runs as node checker.js <kalit> and prints OK/NO.
The key is the flag itself (BAYROQ{...}, the last 16 characters are lowercase hex). For each character, ((c*MUL+ADD)%256) ^ key[i%n] is computed and compared with tgt[i]. Note: the file also contains a decoy flag — it is never used.
Attached files
checker.js
Log in to download
Theory: learn the topic
To submit a flag, log in.