How to debug obfuscated JavaScript?

后端 未结 4 1340
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 10:52

I need to debug obfuscated JavaScript like this example:

__d(\"DataStore\",[],function(a,b,c,d,e,f){var g={},h=1;function i(l){if(typeof l==\'string\'){retur         


        
相关标签:
4条回答
  • 2021-01-04 11:24

    There is no single solution for this. The first thing you can to to have something a bit more readable is to copy/paste the javascript code into http://jsbeautifier.org/

    0 讨论(0)
  • 2021-01-04 11:34

    The Chrome devtools "Scripts/Sources" pane has a "pretty print" mode (look for the {} button in the bottom toolbar).

    0 讨论(0)
  • 2021-01-04 11:36

    Use a Javascript Beautifier to reformat the code and then debug the code.

    Check out http://jsbeautifier.org/

    0 讨论(0)
  • 2021-01-04 11:40

    Google Chrome has a "Pretty print" function that allows to reindent the code.

    I don't normally use it, so I don't know since when it exists, but it's present in Chrome 21 dev.

    0 讨论(0)
提交回复
热议问题