I am an artist who wrote a simple game in Javascript. Yah! But I don't care, because I'm bruised like a peach! I study the complexity of cheating in a game. So obfuscating code will make it harder to cheat, right? Difficult, not impossible. I understand this and could accidentally open a can of worms here ...
Essentially, I'm looking for an online tool that renames variables; and don’t say search and replace in the text bar :). For example, using http://packer.50x.eu/ in one line of code
var loopCounter = 0;
we get the result:
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 2=0;',3,3,'|var|loopCounter'.split('|'),0,{}))
The above looks like a mess, and that's great; but it’s pretty easy to highlight English words like loopCounter. I would expect this to cause the variable names to become obscure (words with a single letter without nouns?), Very similar or should have been my task anyway as part of writing the code. Or is it a waste of time trying to make variable names since the variable declaration is preceded by var, and therefore it makes no sense to mask it?
source share