• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

W3Protect - Jass and Lua map optimizer

Level 23
Joined
Jan 1, 2009
Messages
1,610
Thank you for your interest, we are in the progress of rolling out ultimate, but it's still taking a bit to get all features right.

Free user registration has been enabled for a while now.

Regarding account sharing - sure, I suppose it all relies on good faith - just like the uploading part.

Perhaps supporting independent software developers instead of million dollar corporations could be some incentive to not account share.
 
Level 6
Joined
Jan 12, 2011
Messages
110
Thank you for your interest, we are in the progress of rolling out ultimate, but it's still taking a bit to get all features right.

Free user registration has been enabled for a while now.

Regarding account sharing - sure, I suppose it all relies on good faith - just like the uploading part.

Perhaps supporting independent software developers instead of million dollar corporations could be some incentive to not account share.
I would say you might be best off to offer both time-based sub and count-based one...
Like for me, it would make sense to buy count-based, as I would use the "basic" protection (free one) for testing maps, and for releases, I'd use the full-blown one...
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
I tried to run the old w3p because the website could not analyze my map.
Obscure escape sequences are now supported.
I would say you might be best off to offer both time-based sub and count-based one...
Like for me, it would make sense to buy count-based, as I would use the "basic" protection (free one) for testing maps, and for releases, I'd use the full-blown one...
Thanks for the suggestion.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
This seems like a scam more than ever now, does this do anything more than the usual make the script file so corrupted that it'd be better to remake the script oneself?

Not sure where you're getting that vibe from. This is a free, reforged compatible jass/lua map protector (which afaik doesn't exist otherwise, and contains tons of custom code) with some announced paid features which you don't have to opt-in to at all.

Of course the ultimate features offer additional protection - they should be pretty self explanatory. E.g. encrypting strings will make all strings in the script file unreadable, asserting handle properties will prevent easy object modifications from the editor, etc.
 
Not sure where you're getting that vibe from. This is a free, reforged compatible jass/lua map protector (which afaik doesn't exist otherwise, and contains tons of custom code) with some announced paid features which you don't have to opt-in to at all.

Of course the ultimate features offer additional protection - they should be pretty self explanatory. E.g. encrypting strings will make all strings in the script file unreadable, asserting handle properties will prevent easy object modifications from the editor, etc.
Hmm... Could I see an ultimate corrupted jass map and a lua map?
 
Level 6
Joined
May 29, 2013
Messages
127
After 1.33 patch, vexorian's optimizer throws an error when I turn on the 'optimize spring usage' option in my map. Since then, my map has been having several desync issues. The 1.33 patch itself may be the problem, but I'm guessing optimizer problem. Does this optimizer do vexorian's 'optimize spring usage' function for maps?
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
I am also having that problem - Parsing Script. As BradPitLord found it works if Inline Trigger Strings is turned off.
Some fixes have been implemented regarding this is during the time since your post. Have you retried with Inline Trigger Strings option enabled? If it still doesn't work you could provide me your map in DM to check for the issue.
 
Level 6
Joined
May 29, 2013
Messages
127
My map crashed after running this protect. When the cannon fires and makes a sound, it causes a crash. :cry:
 

Attachments

  • test.w3m
    237.1 KB · Views: 1
  • test.w3m_w3p (2).w3x
    227.4 KB · Views: 3
Last edited:
Level 23
Joined
Jan 1, 2009
Messages
1,610
My map crashed after running this protect. When the cannon fires and makes a sound, it causes a crash. :cry:
I currently cant test due to bizzard server issues, but I observe that your map has been incorrectly changed from w3m to w3x by W3P which looks like a Bug. Consider changing your map to w3x and trying again, w3m maps might not be fully supported.
 
Level 6
Joined
May 29, 2013
Messages
127
I currently cant test due to bizzard server issues, but I observe that your map has been incorrectly changed from w3m to w3x by W3P which looks like a Bug. Consider changing your map to w3x and trying again, w3m maps might not be fully supported.

This is just a test map applied for testing purposes. Of course, the original map, which is w3x from the beginning, also crashes.
I think something is wrong with this protector in compressing the custom sound.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
This is just a test map applied for testing purposes. Of course, the original map, which is w3x from the beginning, also crashes.
I think something is wrong with this protector in compressing the custom sound.
Yes there seems to be an issue due to the .wav file. Since .wav files inside a map prevent any meaningful compression anyway, you can turn off the "recompress" option, then the protected map does not crash for me. Will probably add a note for this in a future update.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
My map Xnd Hero Siege seems to work fine with options:
  • Recompress
  • Make read-only
  • Remove World Editor Data
  • Protect Script
  • Remove Error Logs

It's a map with only GUI/Jass/vJass. Size goes down from 1.6MB to 1MB. Trying to open with WE fails with "Missing or invalid unit data".



However I cannot use "Inline Trigger Strings", otherwise my dialog buttons & some texts are empty.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
Hello, why can't download my map after I protect it at the website?
It stays stuck at the download... I tryed to go to map protected list, and even there I can't download.

Regards
Dunno, sounds like a weird problem on your end which has not been reported by anyone before. Perhaps you disabled downloads from our site or something similar. You could check the console to see if there is anything logged.
My map Xnd Hero Siege seems to work fine with options:
  • Recompress
  • Make read-only
  • Remove World Editor Data
  • Protect Script
  • Remove Error Logs

It's a map with only GUI/Jass/vJass. Size goes down from 1.6MB to 1MB. Trying to open with WE fails with "Missing or invalid unit data".



However I cannot use "Inline Trigger Strings", otherwise my dialog buttons & some texts are empty.
Some people have reported issues with that option, if you send me the map I could take a further look. Are only texts affected that you are creating via triggers/code, or also others?
 
Dunno, sounds like a weird problem on your end which has not been reported by anyone before. Perhaps you disabled downloads from our site or something similar. You could check the console to see if there is anything logged.

Some people have reported issues with that option, if you send me the map I could take a further look. Are only texts affected that you are creating via triggers/code, or also others?
I think it was only constant strings created from GUI triggers. The map from this link can be opened in W3 Reforged World Editor. I unprotected my map when Reforged was released (due to the protection tools being broken), and never protected it again ^^

In the case of my map for example, it was the custom dialog buttons on start text & the text at the circle at the bottom right of the castle building.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
I think it was only constant strings created from GUI triggers. The map from this link can be opened in W3 Reforged World Editor. I unprotected my map when Reforged was released (due to the protection tools being broken), and never protected it again ^^

In the case of my map for example, it was the custom dialog buttons on start text & the text at the circle at the bottom right of the castle building.
Thanks for the example. Your map actually did not work correctly, hence the missing strings. Your script contains a number that is above the maximum integer number (9999999999) which I guess Jass allows, though is pretty much an error.
We added support for larger numbers and also improved error handling in the new W3Protect version deployed today.
Feel free to re-test your map with the "Inline Trigger Strings" option enabled now.
 
Thanks for the example. Your map actually did not work correctly, hence the missing strings. Your script contains a number that is above the maximum integer number (9999999999) which I guess Jass allows, though is pretty much an error.
We added support for larger numbers and also improved error handling in the new W3Protect version deployed today.
Feel free to re-test your map with the "Inline Trigger Strings" option enabled now.
Oh thanks for the feedback ! it's a piece of code I got from an old dota map. What's max integer normaly ? 2^(4*8-1) = 2147483648 ?
 
Level 13
Joined
Jul 12, 2018
Messages
510
just tested this on a lua map. All free version options checked produced error ("Please send in map"), then tested with only Recompress, make read-only and remove WE data. This produced a map that's playable on bnet and unopenable by editor, but it seems some functionality went missing. I buy a hero and the camera no longer centers on the purchased hero(move camera line now missing). that's the only difference i noticed in a 2-minute test run but it seems like a weird simple thing to get removed when much more complex systems in the map still seem to function smoothly.
 
Last edited:
Level 13
Joined
Jul 12, 2018
Messages
510
If code protection isn't checked, the script should only be altered by the "inline trigger strings" option. So you could try it without and see if that was the cause. Would need the map for further troubleshooting.
PM:d you with specifics and the map.

edit. turns out i was comparing against the wrong version of my own map open in editor the whole time. Embarrassing.
 
Last edited:
Level 17
Joined
Oct 10, 2011
Messages
462
Hello,

The site returned to me the following error.

1695055502093.png


Can I know the reasons of the bug? How can I solve that?
Have a nice day.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
Hello,

The site returned to me the following error.

View attachment 448027

Can I know the reasons of the bug? How can I solve that?
Have a nice day.
You can send in your map. Though in your case, I was able to check the logs and see that your map script contains problematic code (ExecuteFunc with non-constant string parameter). Your map most likely has always had this error, but in the previous w3p version this just meant the script would not be protected in the output map. Now it throws an error so you know your script is actually not protected. You can disable script protection which would be the same result as before or adjust your code to not contain the offending ExecuteFunc calls.
The reason this is an error is that the optimizer can not properly minify names if ExecuteFunc is used with dynamic arguments. In the future, we might offer more fine-grained control to still optimize the code but not minify names if such offending code is detected.
 
Level 17
Joined
Oct 10, 2011
Messages
462
Thanks for your response. Script not protected what does that mean? Is the script readable in te editor? Is itbpossible to insert hacks? Is the map openable and updatable?
I've checked the world editor can't open my map.
Should be good at this point that the tool lists what has been protected and not. I would really know before that my script has never been protected. Even if I don't know the consequences. (At least that I can ask you the question, if I know it.)
And finallly returns some logs of the operation.
Btw thanks for the good job you make.
I hope you can make a fix for the minifying system.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
Thanks for your response. Script not protected what does that mean? Is the script readable in te editor? Is itbpossible to insert hacks? Is the map openable and updatable?
I've checked the world editor can't open my map.
Should be good at this point that the tool lists what has been protected and not. I would really know before that my script has never been protected. Even if I don't know the consequences. (At least that I can ask you the question, if I know it.)
And finallly returns some logs of the operation.
Btw thanks for the good job you make.
I hope you can make a fix for the minifying system.
It means the war3map.j file which contains your entire map's code, will not be optimized/protected by w3p. Not being able to open in world editor is done by the "Remove World Editor Data" option.
 
Level 17
Joined
Oct 10, 2011
Messages
462
Hello @Frotty , thanks for your answer
Can you tell me wich example will work please:

Code:
// 1
globals
constant string MY_FUNC_NAME = "FUNC_NAME"
endglobals

function execute1 takes nothing returns nothing
  call ExecuteFunc(MY_FUNC_NAME)
endfunction


// 2
function execute2 takes string funcName returns nothing
  if funcName != "" then
    call ExecuteFunc(funcName)
  endif
endfunction


// 3
function execute3 takes nothing returns nothing
  local string funcName = "MY_FUNC"

  call ExecuteFunc(funcName)
endfunction


// 4
function execute4 takes nothing returns nothing
  local string funcName = "MY_FUNC-" + I2S(12)

  call ExecuteFunc(funcName)
endfunction


// 5, THAT ONE DOES NOT WORK
function execute5 takes integer num returns nothing
  call ExecuteFunc("funcName-" + I2S(num))
endfunction


// 6
function getFuncNameByNum takes integer num returns string
  return "MyFuncName-" + I2S(num)
endfunction

function execute6 takes integer num returns nothing
  call ExecuteFunc(getFuncNameByNum(num))
endfunction

I wrote all the different cases so if you want to test it in a map, you can see when it break if you want to test.

Please give credits if you use it or update it lol (just joking)

I've tried with a blank map all theses scripts and I had every time an error. Can you see in your logs, what's happen. Thanks.
 
Last edited:
Level 23
Joined
Jan 1, 2009
Messages
1,610
Only ExecuteFunc("someString") is supported because then the minifier can easily replace "someString" with the generated small name for the function that is intended to be called. Therefore, none of your cases are supported.
Case 1 could be in theory supported because the string variable is constant, but then you might as well just inline the string.
Case 3 could in theory be supported as well, but it would require an analysis of whether the local string variable is ever changed, because it is not constant, and might as well be inlined.
All other cases are not easily supported because the produced function name is dynamic.
I could add an option to ignore the error and for the user to provide a list of functions that should not be minified, but then it wouldn't be easy to use, might result in strange errors and be less protected.
ExecuteFunc in general, is basically never necessary. It should be easy to replace it with other means. The only downside is that some hive libraries make (pointless) use of it.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
ExecuteFunc has some advanced usage examples in the vJass documentation, and a pretty peculiar implementation.
For how it works, I suggest the map author is shown which line (with ExecuteFunc) blocks the script obfuscation to deal with it.

I oppose map protections.
Judging from the manual, it is only used for doing init stuff in another thread to prevent op limit from crashing it. This can be achieved with other means, e.g. TriggerEvaluate or ForForce which don't rely on string based evaluation. Also, in most cases from the manual the argument is a constant string anyway, which wouldn't cause problems.
As mentioned before, error communication could be improved in the future, but for now it's more important that it doesn't fail silently and outputs a non-protected map.
It's fine if you oppose map protection, most of my maps are completely open source on GitHub. However, it can be a great annoyance if people modify maps without permission and then spread those versions without any indication that it's not an official version. And while resources available on hacking/de-protection are quite vast, there isn't much available for the actual protection side to aid developers, which is why I made W3P. While I would prefer an official solution by blizzard to know if a map is authentic and up to date, I doubt this will happen for reforged.
As stated before, this is more of a project of passion and exercise in running an online service. But I also prefer to give cheaters a harder time to cause ruckus in maps that aim to be competitive or make use of save/load.
 
Top