0 Favourites

Minification doesn't change variable name

  • "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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic Locked topic
195 16,205
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
102 6,404
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
58 5,445
deadeye's avatar
deadeye