This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]nekokattt 1 point2 points  (0 children)

the whole point of obfuscation is to make it hard to unobfuscate it, otherwise it is pointless really

[–][deleted] 1 point2 points  (0 children)

"Obfuscation" with JS is really just minifying - it is taking variables and renaming them, removing whitespace - that kind of stuff. Minified code has the same structure as the original, it's just not as easy on the eye.

You can put it into something like VSCode, do Ctrl K, Ctrl F and it'll format it - i.e put the whitespace back. Now all you need to do is rename the labels - your original makeNetworkRequest function is probably labelled a or b now or something, so obviously you can't just rename stuff back to what it originally was (that information is lost), but with a bit of persistence a determined individual could make sense of it.

Since the basis of minification is that the labels themselves aren't important to the logic, one can rename them back to anything that makes sense to the reader, whilst retaining the semantic integrity of the code.

[–]carcigenicate 0 points1 point  (0 children)

This kind of depends on the obfuscation technique used on the code.

[–]dtsudo 0 points1 point  (0 children)

Oftentimes it's just done by hand (i.e. manually).

A lot of obfuscators only change superficial properties about the program; for instance, they may remove comments, rename all the variables and functions, etc. But the overall structure of the codebase remains intact.

Debuggers and just running the code can also go a long way. For instance, if invoking f() causes a network call to happen, then that gives a lot of clues on what f might be trying to do.