I have lurked around these forums for some time though I never posted before.
As many, I'm slightly annoyed by the complete lack of protection for SC2 "locked" maps. To protect my maps to a certain extend ( still unreleased ), I very quickly wrote a command line program that would parse the files extracted from a map MPQ and obfuscate all references. So for example, an effect that would be previously called "BattlecruiserTornadoDamageSearch" becomes something like "xn9pK2".
There are some limitations :
- It assumes that all the data is new : I mean new units, new abilities, effects, whatever. If you modify existing units instead, the existing code won't work. It would have to compare against lists of detault IDs to figure out what's new and what's not. I personally think it's bad practice to modify existing stuff rather than create new from scratch anyway.
- The code isn't clever enough to manage references by parameters if you append prefixes/suffixes. So, stuff like ##id##Damage or ##unitname##Build wouldn't work without extra parsing.
- It's totally not user-friendly. It very probably requires a programmer to use ( configuring it by editing the source code and recompiling ).
Still, it works pretty well. Resulting maps are also smaller and faster to load.
Is there any interest in that code? I don't think I would be motivated into writing it a friendly and flexible graphical user interface, but perhaps someone else would... It's just some 600 lines of C code, so if there's any programmer who wants to have a look, let me know.
This sounds really great.
I`d definitely encourage you to continue and perfect your work if possible. It would be one of the best tools/assets contributed towards Sc2 mappers.
You`d be like a hero or legend;p.
I should have mentioned that : it also fixes Galaxy code references to all data objects ( the Galaxy code is what's generated by the GUI-based triggers ). It also fixes references to existing units/doodas placed on the maps, etc. To summarize, it converted flawlessly my map with 550kb of XML data and 5000 lines of Galaxy code.
@EternalWraith:
I certainly could make it configurable and improve the parsing... Still, I don't think I would be bothered into making a graphical user interface, I'm just not that kind of programmer :p. That's why I'm saying perhaps someone else could be interested into building a fancy graphical interface on top of it.
Why would you want to obfuscate data editor entries?
There's some sense in trying it on script to prevent others from stealing your code. Note that obfuscation will not increase security with respect to save/load systems.
Why would you want to obfuscate data editor entries?
There's some sense in trying it on script to prevent others from
stealing your code. Note that obfuscation will not increase security
with respect to save/load systems.
Its not about save / load bs.... is about people stealing your data related work meh.... I for one really wount worry about it.... but then again my data skills arnt that impressive.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Yeah it sounds messy at the moment as you say, and I don't really need to protect my data... moreso I need to protect my triggers. As well, 99% of us use existing data. No one re-duplicates every model and effect such as 'splash damage'... or if you modified 'default camera' to get rid of zoom levels, you wouldn't exactly make a new one.
Just being honest about practicality... but a really cool idea you got going... if you can figure out for triggers I'll <3 you.
@OneTwoSC
I'm not saying you would need to duplicate every data entry that you use, like splash damage. I'm just saying that the current code only works if you create new objects instead of modifying existing ones ; these new objects can link to existing unmodified objects just fine ( including splash damage ). Anyway, That limitation could be removed if the code would be made clever enough to differentiate between object IDs referring to modified stock objects and new objects.
Some maps may have hundreds of new objects defined, I can imagine a desire to obfuscate that stuff as much as trigger code. There's still a quick pass on the MapScript.galaxy file, basically just renaming all functions/triggers and variables ( plus basic stuff like removing comments, extra spaces and line breaks ).
In the end, the program presently does everything I need. It would imply some work to fix the current limitations ( recognizing modified/new object IDs, and dealing with suffixes like ##unitname##Build, ##id##Missile or whatever ), so I was just wondering if there's some demand for such a tool before putting more time on it.
Anyway, here's an example of the conversion made by the program, before and after :
Great idea. I vote for continuing work on it. If you could add support for triggers (variable and trigger names), this would go a long way towards rectifying Blizzard's failure. I hope to use a mature version of this by the time I'm ready to go public with my map.
Ah I see. My RPG has somewhere close to a thousand custom effects/units/behaviors/abilities/buttons now but honestly I still don't care that much if anyone stole it. Maybe if I was charging money, but I know no one else can make the triggers to go along with my data, assuming my triggers were protected somehow.
It would be cool if it could randomize the encryption alphabet for something like ... the "starcode" library ... and save that library for future use or give you the option to re-create it therefore whiping all players banks clean that play your map.
If this is just a parameter based executable.... I could work on a GUI for it.... it would be visual basic 6 based.... but that would run for just about anybody...
PM me if you want.... wouldnt take me long to do... just give me a list of what youd like to see on the gui and i can whip it up on an hour or 2
Ah I see. My RPG has somewhere close to a thousand custom
effects/units/behaviors/abilities/buttons now but honestly I still don't
care that much if anyone stole it. Maybe if I was charging money, but I
know no one else can make the triggers to go along with my data,
assuming my triggers were protected somehow.
Well I repeat what Karawasa just said...
Well I dont know how deep his thing effects trigger but potentially it could rename all variables in the trigger ... all globals.... all trigger names.... I mean.. at some point your just making it impossible for people to understand what your trigger does..... and in that case it would start to make it way more complicated then its worth for anybody to copy your triggers....
if someone can manage to work out what your triggers do after the obfustcation.... then they can prolly write the triggers themselfs lol
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Trigger code is really easy to obfuscate in comparison to the data. If you look at MapScript.galaxy, all local variables begin with lv_, all globals begin with gv_, functions with gf_, etc. Scopes are followed by tracking { and }, so writing a parser for that is most straightforward.
Regarding data, to make the tool work with all maps, the difficult part is really going to be how to manage implicit references with suffixes. For example, if you create an actor named FooBar with GenericAttack as parent, the missile is assumed to be FooBarMissile unless specified otherwise. So if your missile really is named FooBarMissile, there's no explicit reference at all in the data files. The obfuscation code would have to know about parent objects working with such suffixes, be able to figure out when implicit references happens, and create new explicit references... This is a bit messy.
By the way, SoulCarveRR said it, the point isn't really to protect anything... It's more like making it so much trouble to figure things out that the person is better off creating from scratch.
All right, I'll at least put some hours into making it able to recognize modified IDs and new IDs, then SoulCarveRR could make it a fancy GUI :).
Hi,
I have lurked around these forums for some time though I never posted before.
As many, I'm slightly annoyed by the complete lack of protection for SC2 "locked" maps. To protect my maps to a certain extend ( still unreleased ), I very quickly wrote a command line program that would parse the files extracted from a map MPQ and obfuscate all references. So for example, an effect that would be previously called "BattlecruiserTornadoDamageSearch" becomes something like "xn9pK2".
There are some limitations :
- It assumes that all the data is new : I mean new units, new abilities, effects, whatever. If you modify existing units instead, the existing code won't work. It would have to compare against lists of detault IDs to figure out what's new and what's not. I personally think it's bad practice to modify existing stuff rather than create new from scratch anyway.
- The code isn't clever enough to manage references by parameters if you append prefixes/suffixes. So, stuff like ##id##Damage or ##unitname##Build wouldn't work without extra parsing.
- It's totally not user-friendly. It very probably requires a programmer to use ( configuring it by editing the source code and recompiling ).
Still, it works pretty well. Resulting maps are also smaller and faster to load.
Is there any interest in that code? I don't think I would be motivated into writing it a friendly and flexible graphical user interface, but perhaps someone else would... It's just some 600 lines of C code, so if there's any programmer who wants to have a look, let me know.
Stragus
does it also fix any trigger related code.... that references those data objects?
@StragusMapster:
This sounds really great.
I`d definitely encourage you to continue and perfect your work if possible. It would be one of the best tools/assets contributed towards Sc2 mappers.
You`d be like a hero or legend;p.
@SouLCarveRR:
I should have mentioned that : it also fixes Galaxy code references to all data objects ( the Galaxy code is what's generated by the GUI-based triggers ). It also fixes references to existing units/doodas placed on the maps, etc. To summarize, it converted flawlessly my map with 550kb of XML data and 5000 lines of Galaxy code.
@EternalWraith:
I certainly could make it configurable and improve the parsing... Still, I don't think I would be bothered into making a graphical user interface, I'm just not that kind of programmer :p. That's why I'm saying perhaps someone else could be interested into building a fancy graphical interface on top of it.
@StragusMapster: Go
My solution: I'm too lazy to rename anything. Everything is based off the Missile Turret, its weapon, etc.
Hundreds of "Missile Turret copy 6 copy copy 7 copy 2".
Why would you want to obfuscate data editor entries?
There's some sense in trying it on script to prevent others from stealing your code. Note that obfuscation will not increase security with respect to save/load systems.
Its not about save / load bs.... is about people stealing your data related work meh.... I for one really wount worry about it.... but then again my data skills arnt that impressive.
Yeah it sounds messy at the moment as you say, and I don't really need to protect my data... moreso I need to protect my triggers. As well, 99% of us use existing data. No one re-duplicates every model and effect such as 'splash damage'... or if you modified 'default camera' to get rid of zoom levels, you wouldn't exactly make a new one.
Just being honest about practicality... but a really cool idea you got going... if you can figure out for triggers I'll <3 you.
Great idea. I vote for continuing work on it. If you could add support for triggers (variable and trigger names), this would go a long way towards rectifying Blizzard's failure. I hope to use a mature version of this by the time I'm ready to go public with my map.
@StragusMapster: Go
Ah I see. My RPG has somewhere close to a thousand custom effects/units/behaviors/abilities/buttons now but honestly I still don't care that much if anyone stole it. Maybe if I was charging money, but I know no one else can make the triggers to go along with my data, assuming my triggers were protected somehow.
Well I repeat what Karawasa just said...
It would be cool if it could randomize the encryption alphabet for something like ... the "starcode" library ... and save that library for future use or give you the option to re-create it therefore whiping all players banks clean that play your map.
If this is just a parameter based executable.... I could work on a GUI for it.... it would be visual basic 6 based.... but that would run for just about anybody...
PM me if you want.... wouldnt take me long to do... just give me a list of what youd like to see on the gui and i can whip it up on an hour or 2
Well I dont know how deep his thing effects trigger but potentially it could rename all variables in the trigger ... all globals.... all trigger names.... I mean.. at some point your just making it impossible for people to understand what your trigger does..... and in that case it would start to make it way more complicated then its worth for anybody to copy your triggers....
if someone can manage to work out what your triggers do after the obfustcation.... then they can prolly write the triggers themselfs lol
@SouLCarveRR: Go
Lol good idea.
@SouLCarveRR: Go
I agree. Obfuscating trigger and global variable names should be enough.
This is exactly something I was referring to, awesome idea. Also, moved to the appropriate forum.
Then again.... Ive spent hours.... un-Obfuscating java script before =).
And in the process learned way more about the syntax requirements of java script then I ever wanted to know.
But yeah.
But it's a start, ;).
Trigger code is really easy to obfuscate in comparison to the data. If you look at MapScript.galaxy, all local variables begin with lv_, all globals begin with gv_, functions with gf_, etc. Scopes are followed by tracking { and }, so writing a parser for that is most straightforward.
Regarding data, to make the tool work with all maps, the difficult part is really going to be how to manage implicit references with suffixes. For example, if you create an actor named FooBar with GenericAttack as parent, the missile is assumed to be FooBarMissile unless specified otherwise. So if your missile really is named FooBarMissile, there's no explicit reference at all in the data files. The obfuscation code would have to know about parent objects working with such suffixes, be able to figure out when implicit references happens, and create new explicit references... This is a bit messy.
By the way, SoulCarveRR said it, the point isn't really to protect anything... It's more like making it so much trouble to figure things out that the person is better off creating from scratch.
All right, I'll at least put some hours into making it able to recognize modified IDs and new IDs, then SoulCarveRR could make it a fancy GUI :).
I dont do fancy and niether does vb6 but it generally gets the job done.
PM me about this. Id be happy to help.