I am reverse engineering one magical script. I have an uglified source code and source map generated by uglifyjs.
Does anybody know any straightforward way how to achieve at least partly readable source code from that? I have found some obscure ways including conversions through multiple languages, but I hope something better exists.
Thank you!
There is an npm library called maximize
that purports to do this, but I couldn't get it to work. I rewrote it as unsourcemap but I am not a Node JS developer, so I'm sure it's awful. Anyway, it was a pretty trivial application of the source-map
npm package.
Once you go through all the rigamarole of installing node-js and nvm and whatnot, you can clone that repo and say:
npm install . -g
unsourcemap path/to/packed.js path/to/packed.js.map path/to/output-dir/
I don't want to maintain this thing, so if someone wants to improve it, please just fork it and point people to that. :-)
If the project is bundled using webpack / browserify, you can use Debundle package to do reverse engineering. Imho, the result will be either good or bad depending on some project.
And because it de-transpiles JS only (the uglifying webpack pipeline), so if you're using Vue SFC, the Debundle cannot produces your original .vue file, it's JS file instead.
Anw, in case of reading source code, if your web page doesn't hide the source map files, you can use Chrome DevTool
> Source
pannel to read the beautiful source easily:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With