Hacker News new | ask | show | jobs
by Jeema101 1241 days ago
Don't think so. There's clearly the beginning of a while loop near the top of the obfuscated version. There's no loops at all in the 'de-obfuscated' version.
3 comments

Here's GPT's own explanation what the purpose of that while loop is:

---

This code uses JavaScript's `eval` function to obfuscate the code by looping over an array of strings and passing them as arguments to `eval` to create a variable. It also uses an anonymous function to obfuscate the code. The code is deobfuscated by replacing the `eval` function and the anonymous function with their respective strings.

That explanation is also not correct! The while loop is an obfuscation gadget (of sorts), but it doesn't use eval, it uses push and shift to rotate the array. The only use of eval is 'eval("find")', which is not top grade obfuscation.
That's not generally a good enough indicator; plenty of obfuscation involves loops that otherwise aren't hit.
Yeah, pretty sure that loop is to modify the lookup table for strings in runtime so you can't just statically replace it in the code, it's not strong obfuscation but in a properly deobfuscated code that loop wouldn't exist
The while loop does not come from the original code. Probably part of the obfuscation https://twitter.com/AlexAlexandrius/status/16178998824000839...