We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(10)
试试这个:JS Beautifier
Try this: JS Beautifier
尝试 http://www.jsnice.org/
我只是偶然发现它,它很棒。它扩展了代码。它具有统计变量重命名功能。例如,如果您有以下代码:
那么它会将您的代码变成:
我认为这是很好的猜测。
它变成了这样:
我
正在开发的一个库有几个错误,在花了几个小时尝试破译代码后,发现这一点将为我节省大量时间。
说真的,这个工具用 JS Beautifier 来擦地板。
Try http://www.jsnice.org/
I just stumbled on it and it is great. It expands the code. It has statistical variable renaming. for example, if you have this code:
Then it it turns your code into:
Pretty good guess, methinks.
It turned this:
Into this:
A library I'm working on has a couple of bugs, and after spending hours trying to decipher the code, finding this is going to save me a bunch of time.
Seriously, this tool wipes the floor with JS Beautifier.
呃,除非存在 minified -> 的映射,否则不可能恢复变量名。可用原始变量名称。否则,我认为该工具的作者可能会因灵异功绩而赢得兰迪奖。
Uhhh, it would be impossible to restore variable names unless there was a mapping of minified -> original variable names available. Otherwise, I think the authors of that tool could win the Randi prize for psychic feats.
Chrome 开发者工具内置了此功能
Chrome Developer tools has this built in
您将无法重建方法名称或变量名称。您所能期望的最好的结果是一个简单的 JS 代码格式化程序(如前面提到的那样),然后逐行检查文件的方法,找出每个部分的作用。
也许使用一个好的 JS 重构工具也会让这变得更容易(能够重命名/记录方法)
You will not be able to reconstruct method name or variable names. The best you can hope for is a simple JS code formater (like those previously mentioned), and then to go through the file method by method, line by line, working out what each part does.
Perhaps using a good JS refactoring tool would make this easier as well (being able to rename/document methods)
请参阅我们的 SD ECMAScript Formatter,了解可以很好地格式化代码的工具。
编辑:如果您想反转重命名过程,您需要一些东西可以将混淆的名称重命名回原始名称。
从技术上讲,该工具可以做到这一点:SD Thicket ECMAScript Obfuscator。
它通过应用您可以精确控制的重命名映射来实现这一点。
通常,您可以在混淆过程中通过选择要混淆的名称和要保留的名称来隐式构造这样的映射,然后混淆器应用该映射来生成混淆的代码。
当您进行混淆时,Thicket 混淆器会生成此映射作为副作用
本质上是一组对的形式(原始名称,混淆名称)
供参考和调试之用。
交换元素给出映射(混淆名称,原始名称)。 Thicket 可以应用该倒排映射从混淆的代码中恢复具有原始名称的代码。 Thicket 混淆器包含格式化程序,可让您使其再次看起来漂亮。
“反转缩小”的问题(正如你说得不好,你试图反转混淆)是你需要地图。由于进行混淆的人不会泄露地图,因此作为混淆代码的接收者,您没有任何可应用的内容。想要成为海盗的人可能必须通过痛苦的逆向工程来重建地图。
“逆转”过程也无法恢复评论。他们永远消失了。
这都是设计使然,所以真正的问题是为什么要寻求逆向混淆?
See our SD ECMAScript Formatter for a tool that will nicely format code.
EDIT: If you want to reverse the renaming process you need something can rename the obfuscated names back to the originals.
This tool can technically do that: SD Thicket ECMAScript Obfuscator.
It does so by applying a renaming map over which you have precise control.
Typically you implicitly construct such a map during the obfuscation process by choosing which names to obfuscate and which to preserve, and the obfuscator applies that map to produce the obfuscated code.
The Thicket obfuscator generates this map as side effect when you obfuscate
in the form essentially of a set of pairs (originalname,obfuscatedname)
for reference and debugging purposes.
Swapping elements gives the map (obfuscatedname,originalname). That inverted map can be applied by Thicket to recover the code with the original names, from the obfuscated code. And the Thicket obfuscator includes the Formatter to let you make it look nice again.
The catch to "reversing minification" (as you put it poorly, you are trying to reverse obfuscation), is that you need the map. Since people doing obfuscation don't give away the map, you, as a recipient of obfuscated code, have nothing to apply. A would-be pirate would have to reconstruct the map presumably by painful reverse engineering.
The "reversing" process also can't recover comments. They're gone forever.
This is all by design, so the real question is why are you looking to reverse obfuscation?
您可以在正则表达式中使用
\b
(字边界)功能来查找文件中的单字母变量名称。您还可以在 vim 中使用类似
:%s/\/truesaiyanpower/g
的内容。You can use the
\b
(word boundary) feature in regular expressions to find single-letter variable names in a file.You can also use this in vim with something like
:%s/\<a\>/truesaiyanpower/g
.要取消缩小 JavaScript 文件,Unminify 将是最好的!
To unminify JavaScript files, Unminify would be the best!
要取消缩小 CSS、HTML 和 JavaScript 文件,您可以使用 Unminify 或 Unminify JS在线工具!
To unminify CSS, HTML and JavaScript files, you can use the Unminify or Unminify JS online tools!
JavaScript 压缩器和 JavaScript 混淆器是两个不同的东西。
Minifier - 从程序中删除注释、不必要的空格和换行符。
混淆器 - 对程序进行修改,更改变量、函数和成员的名称,使程序更难理解。一些混淆器对代码的修改非常激进。
这个 JavaScript 混淆器 会混淆您的代码。
如果您想对代码进行反混淆,请尝试 JavaScript Beautifier。如果发现混淆就会进行反混淆,然后美化代码。
A JavaScript minifier and JavaScript obfuscator are two different things.
Minifier - removes the comments, unnecessary whitespace and newlines from a program.
Obfuscator - make modifications to the program, changing the names of variables, functions, and members, making the program much harder to understand. Some obfuscators are quite aggressive in their modifications to code.
This JavaScript obfuscator will obfuscate your code.
If you want to deobfuscate your code, try JavaScript Beautifier. It will deobfuscate if obfuscation is found and then beautify the code.