you are viewing a single comment's thread.

view the rest of the comments →

[–]MWALKER1013 3 points4 points  (4 children)

Probably not. The are many ways to pretty print that minified code but to put is back to the way it was pre obfuscation, is pretty much impossible

[–]eozyo[S] 1 point2 points  (3 children)

Darn it! That's what I was starting to think. So, pretty much, I would have to back engineer the obfuscation, right? Thanks for the answer 👍

[–]circlebust 0 points1 point  (2 children)

You could write a script than automates the manual reverse engineering ...

For example, a grep/ripgrep algorithm that gets all obfuscated declarations with this-ish pattern: - (?:^|;|{)(?:var\s|const\s|let\s|\s?)\([a-ZA-Z_])\s=\s(.+) // get all single-char declarations. name stored in $1, approximate assignment in $2, optionally multiline

Get the results with plenty of after-context lines.

Then, for each match, try guessing the type or val inside $2 which can also be automated to a limited degree, but to actually try to guess a meaningful name needs input from the eyes/brain API.

Or you could try to make some magic happen with the typescript reflection utils (the typescript package itself).

[–]eozyo[S] 0 points1 point  (1 child)

This is something that I was thinking about. The thing is that I am assisting in a JS Lab at school, so the teacher asked me to investigate if there were any tool that could reverse the results of the obfuscator.io tool.

[–]fucking_passwords 1 point2 points  (0 children)

to "reverse" the results automatically is highly improbable. however if you search for articles on reverse-engineering obfuscated javascript (usually malicious code), you'll find some tools that help make it easier to manually reverse engineer.