Minification doesn't change variable name

Discussion and feedback on Construct 2

Post » Sun Mar 09, 2014 2:34 am

"Minifying the script makes the script smaller and harder to decompile."
Arguably the most difficult aspect of decompiling or reverse engineering is figuring out what each global variable does. The name of each global variable isn't changed in the c2runtime.js file, and I typically follow good programming practices so I give a name that makes sense to each variable.

I don't think it would be that difficult at compilation of an exported construct 2 game, to substitute names of global variables, arrays, dictionaries, instance variables, and other such items with randomly generated 4 character base-36 names (1,679,616 theoretically possible different names).
This way it would be difficult to determine what a variable does what just by reading the code or using a program to monitor the activity of a game.

Naturally this randomization process wouldn't apply to debug.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Sun Mar 09, 2014 12:02 pm

+1
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Sun Mar 09, 2014 5:15 pm

ryackov wrote:I don't think it would be that difficult at compilation of an exported construct 2 game, to substitute names of global variables, arrays, dictionaries, instance variables, and other such items with randomly generated 4 character base-36 names (1,679,616 theoretically possible different names).


Since array and dictionnaries can load from external files (you can also load the webstorage inside a dictionnary), I don't think it would be wise to minify that
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Mar 10, 2014 3:21 am

It could be an additional option that people are forced to enable.
Ultimately it would break save games, yes, unless in the capx file there is a saved table of randomized names generated for each object.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests