• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Hiding strings in the JASS script

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

I've seen many tools change the function names around to hard to read characters (e.g. "iiji") but what if you wanted to say hide important plot information about your map? These have to be stored as strings, and the optimizer can't change these.

Has anyone ever encrypted even the display texts in your game, so you actually have to call a function on a blurb of text so a player can read it? SO it would look like this:

JASS:
string encryptedMessage = "abcbfkfkori54kgo4jg4o90850983"
call DisplayTimedTextToPlayer(..., decode(encryptedMessage))
//say the message is "It was the doctor who was the villain the whole time!"
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You are going though pointless effort to hide something trivial. Rather focus on making a plot and a good map rather than trying to prevent the odd person who reads the map script from being spoiled.

Yes it is possible but will always have the 2 fundamental problems below.
1. High computational overhead for something that really should not need it. Unique strings apparently leak and generating a full unique string will create at least N leaks where N is the length of the string.
2. People can just extract the string with the function into their own map and read the results in game anyway.

Blizzard conceals data using a very strong encryption system that involves online servers. With out the key from the online servers, it cannot decrypt the information. This is only given out at or near release.

The other popular method is the Ubisoft classic of missing game data. They cannot read and spoil your plot if you only stream them the plot when they need it.

Both are generally out of reach for WC3 and certainly are over complicated for something simple like a WC3 map. It is far better to divert the efforts into making a better map than trying to stop a few kids spoiling themselves on it.
 
Hi,

I've seen many tools change the function names around to hard to read characters (e.g. "iiji") but what if you wanted to say hide important plot information about your map? These have to be stored as strings, and the optimizer can't change these.

Has anyone ever encrypted even the display texts in your game, so you actually have to call a function on a blurb of text so a player can read it? SO it would look like this:

JASS:
string encryptedMessage = "abcbfkfkori54kgo4jg4o90850983"
call DisplayTimedTextToPlayer(..., decode(encryptedMessage))
//say the message is "It was the doctor who was the villain the whole time!"

I've never tried that before, but yeah it should work. Although, as DSG said, it may not be worth the effort. If you are going to do it, I would choose a relatively simple encryption to reduce the overhead (if the person goes through the length of deprotecting your map and cracking your encryption method, then they deserve to read your strings, lol).

The only drawback is that encryption/decryption of strings can generate a lot of strings (and due to the way wc3 works, this will use up more memory. keep in mind that memory is cheap, but it is still a concern). See this for more info: http://www.hiveworkshop.com/forums/lab-715/documentation-string-type-240473/

Another way could be to relegate your strings to the wts file, kinda like what GUI does. You'll end up putting TRIGSTR_001 and things like that. It isn't much protection because the wts is super easy to read, but maybe they won't know about it.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You could also encrypt it into something else that partly depends on wc3's ingame mechanics. This way, the key resides not completely inside your map. To minimize string leaks, split it up by the words, which are likely to repeat, before compiling the final string from them.
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
If you want to protect your mpa from being hacked changing strings acutally works pretty well. Of course its always possible to break it, but "security through obscurity" at least slows down the hacking. Just like the game itself the hacking community is getting smaller and less active and obfuscating a map (in terms of using incredibly annoying mechanisms that require the hacker to read a lot of code) often prevents your map from getting hacked.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
You could also encrypt it into something else that partly depends on wc3's ingame mechanics. This way, the key resides not completely inside your map. To minimize string leaks, split it up by the words, which are likely to repeat, before compiling the final string from them.

Right but ultimately they could eventually just call my own functions/triggers to the decryption for them, no matter how strong the key may be?
 
Status
Not open for further replies.
Top