Welcome to WebmasterWorld Guest from 3.92.28.84

Forum Moderators: open

Message Too Old, No Replies

javascript obfuscator

     
3:55 pm on Nov 11, 2018 (gmt 0)

Full Member from BE 

10+ Year Member

joined:Dec 3, 2006
posts:262
votes: 1


I'm trying to compare javascript code of multiple files between the original and a fork.
The fork has been minified and obfuscated. The obvious reason for me (in that particular situation) is that they want to hide their modification(s).
I've tried manually, but it's a bit long to compare function by function, file by file. The obuscator has renamed all variables and functions as well as changed the code syntax. So it slows my comparison.

I'm looking for an obfuscator that I could use on the original code to use in the comparison (if it generates the same syntax modifications).
Does anyone knows something that can I could use as a plugin in pspad?
4:09 pm on Nov 11, 2018 (gmt 0)

Preferred Member

Top Contributors Of The Month

joined:Sept 13, 2018
posts:355
votes: 71


The fork has been minified and obfuscated. The obvious reason for me (in that particular situation) is that they want to hide their modification(s).

Minification is causing obfuscation. They might have just used minifcation to reduce the size of the code. You can easily save 30% by doing so.

I don't know of "pspad plugins", but there are online tools :

[jscompress.com...]
[minifier.org...]
[javascript-minifier.com...]
6:41 pm on Nov 11, 2018 (gmt 0)

Full Member from BE 

10+ Year Member

joined:Dec 3, 2006
posts:262
votes: 1


I know what minification is. And I can beautify the code to reverse the effect. Here they have added of layer of obfucation:
functions and variables names are replaced with 'a' 'b' 'c' ... , while() construct are replaced with for() , if() are also combined in a different way.

PSPad is a freeware text editor with syntax highlight. Plugins (in VBscript, javascript, ...) can be added to perform specific task: I have one that reverses minification.
6:56 pm on Nov 11, 2018 (gmt 0)

Preferred Member

Top Contributors Of The Month

joined:Sept 13, 2018
posts:355
votes: 71


And I can beautify the code to reverse the effect

Not really. Minification is not just removing space, and tabs. Minification is also replacing loops, to optimize the size of the code, so a "for" is shorter than a "while". And Minification also replaces functions and variables by single letter ones, when possible. Minification also group operations to produce shorter code. If you use one of the link I posted, you'll see what I mean. But it's off-topic, I know.
7:22 pm on Nov 11, 2018 (gmt 0)

Full Member from BE 

10+ Year Member

joined:Dec 3, 2006
posts:262
votes: 1


From what I see minifier results vary from one to another. Some only remove whitespace, some rename some variables.

I'll see if I can come close to the result form of the fork.