- Joined
- Mar 17, 2007
- Messages
- 399
I couldn't extract the .jar file because the operation would break everytime (even tried open with) so I had someone send me the .jar file which worked fine.
I couldn't extract the .jar file because the operation would break everytime (even tried open with) so I had someone send me the .jar file which worked fine.
If you can't extract a .zip archive I'm not sure how to help you :/
I couldn't extract the .jar file because the operation would break everytime (even tried open with) so I had someone send me the .jar file which worked fine.
If you can't extract a .zip archive I'm not sure how to help you :/
*Solved*: Had to download 7zip to unzip the file. The Windows Extract All when you right click wont work.
-with/without extreme compression
-remove world editor data
-inline trigger strings
-Minify Lua
Edit, if I use "Inline Trigger Strings" it gets stuck on Parsing Script. Everything Else works
Using only "Minify Lua" I can open in the editor but in map lobby when I select it I get the error "There was an error reading the map file"
Same I had to use 7zip to extract, windows kept failing.I couldn't extract the .jar file because the operation would break everytime (even tried open with) so I had someone send me the .jar file which worked fine.
my map has a ridiculous amount of GUI code
turned off lua minify as with almost no lua in my game theres no reason to do anything to it.
After the recent wc3 update the old wc3 optimizer i use now increases map file size by 20,000% from a 5mb file to a 1gb file
function b takes string s returns nothing
call ExecuteFunc(s)
endfunction
function a takes nothing returns nothing
call b("string argument to use with ExecuteFunc doesn't work")
endfunction
Disabling obfuscate script still seems to get stuck on parsing, really hard to tell if its actually working on it or frozen.
Hey, I've found an issue with this tool.
The following code will result in "Code has Errors!" when protecting the map.
Would a fix be possible?JASS:function b takes string s returns nothing call ExecuteFunc(s) endfunction function a takes nothing returns nothing call b("string argument to use with ExecuteFunc doesn't work") endfunction
Thanks.
I'm using ExecuteFunc in order to prevent dumb injections for cheat packs. If the injected function doesn't exist nothing will happen, but if it does, I can detect the injection.I'm not really active in wc3 anymore, just posting a short heads up.
The snippet you posted works if the ExecuteFunc parameter is constant and references an existing function.
Everything else can not be analyzed/optimized and is therefore invalid input.
Same I had to use 7zip to extract, windows kept failing.
I'm using ExecuteFunc in order to prevent dumb injections for cheat packs. If the injected function doesn't exist nothing will happen, but if it does, I can detect the injection.
The optimizer will remove the call if the function doesn't exist unfortunately; so my workaround was to read ability tooltips as an argument to ExecuteFunc, but this resulted in the error.
I'll look for another solution instead, thanks for the hard work, it's a great tool!
It was only a matter of time, frotty never really examined my issue
Either I can't extract zip files or someone can't archive them properly
Hey Frotty, I really appreciate working on this.
It seems like the map is inoperable when using xdep, but I managed to get the wc3map.j and even though I set the obfuscation and custom charmap to Il0O it does nothing. I can see all the function/variable names as if nothing happened. Please let me know what you think
Edit: Seems like the the custom charmap was the problem. Use less readable and it works
Hello there and thanks for this great tool.
Is there any change we could get a few more options available for Lua based maps?
More specifically inlining trigger strings and Obfuscate script like in Jass ?
Also, will the option to convert objects to SLK be implemented one day (or is this not working anymore with Reforged?)
Thanks again for the hard work and for this irreplaceable tool.
Take care.
Exactly. I've extracted the w3.j and it was not obfuscated when attempting a custom charmap of Il0O.Thanks for the kind feedback. Does this mean the custom charmap option isn't working for you?
I'm not either but i keep developing my map, have been for 13 years nowI'm not really active in wc3 anymore, just posting a short heads up.
Hi Jay, I know I replied in wrong place, but could you pls advise which Editor can open and edit Cowicula's Wilderness Survival 1.2b, ? Thank you.It was only a matter of time, frotty never really examined my issue
Either I can't extract zip files or someone can't archive them properly
" If resource is useful / simple, then mark as "Approved" and give rating "(2) Useful / simple. "I don't quite understand the script thing. So, will all Sinple stuff be moved in Approved? The problem with Simple now is that it contains both borderline good stuff and bad stuff. So moving it all will cause drama when we'd manually move the bad stuff back to Simple.
java -jar ./W3Protect-0.6.1.jar $TA_ROOT/TimeAbyssWC3.Builds/compiled_TimeAbyssWC3.w3x
It seems that many of the talented tool makers in this community have lost motivation or even left the boat.
Another suggestion, since this program is called "W3Protect"...How about incorporating MPQ damage to further enhance the protection?
However, somehow this application mixed strings together, im literally getting the wrong Game - Text Message's in the wrong triggers, like in my NPC respond trigger im getting prompts from my custom player kick system which isn't anywhere near that trigger, they share Nothing, no variables, they aren't even in the same folder in the gui triggers.
Please allow program to be more customizable when launching from console.
Lua minifier renders map broken and doesn't even let it launch.
On the latest refactor of my map Lua script, I noticed the Lua minifier indeed brought some issues that were not there before.
I haven't yet had time to find out what went wrong, but last time I tried (very recently), some features of my map went AWOL or half broken.
@Frotty Do you have any plans in adding that option Transform Objects to Slk any time soon?
GetPlayerName(p) == "Local Player"
) into precomputed hash comparisons (e.g. StringHash(GetPlayerName(p))==$7e9e52f6
). This hides e.g. player name checks and command activators from plain sight.call DisplayTimedTextToPlayer(p,0.,0.,15.,"Hello this is a test")
) and replaces them with calls to a decrypt function (e.g. call DisplayTimedTextToPlayer(p,0.,0.,15.,decrypt("f\\@bf`DU[sSWLsFPTYQ"))
) which lazily decrypts the string and caches it in a hashtable. This obfuscation allows retaining debug information, i.e. stacktraces, without leaking plaintext information in the code.1/ how to use "Xdep" without revealing the model? "Xdep" reveals the model when usingInfo
Jass and Lua map optimizer. Most of the special "protections" are only available for Jass maps.
View attachment 382534
The main reason for this tool was/is to have an all in one solution for map finalization.
(If Water and me fix SLK transform at some point)
Install
Requires an installation of Java 8 (Java 8 | AdoptOpenJDK)
If you have Java installed, just download the .zip file from this post and extract the .jar file from it.
Usage
Run the .jar from the downloaded archive with no arguments to start open the graphical interface.
Use the "Browse" button or drag & drop a map onto the app window to load it.
If the load was successful, you should see the preview image.
Otherwise the map is already protected or otherwise unreadable.
(If you think it's unprotected but not working, please report the map)
You can use w3protect from the commandline by passing a map path as first and only argument.
The config will be read from the .wpc file next to the .jar .
In both cases w3protect will generate a copy of your input map with the suffix "_w3pro" in the same location.
Options explained
- "Extreme Compression" - re-compresses every file in the mpq with best settings. (optionally zopfli)
- "Lua minify" - uses 'luamin' to minify the map's lua script.
- 'String Hashing': Turns constant string comparisons (e.g.
GetPlayerName(p) == "Local Player"
) into precomputed hash comparisons (e.g.StringHash(GetPlayerName(p))==$7e9e52f6
). This hides e.g. player name checks and command activators from plain sight.- 'String Encryption': Encrypts every string value in the map (e.g.
call DisplayTimedTextToPlayer(p,0.,0.,15.,"Hello this is a test")
) and replaces them with calls to a decrypt function (e.g.call DisplayTimedTextToPlayer(p,0.,0.,15.,decrypt("f\\@bf`DU[sSWLsFPTYQ"))
) which lazily decrypts the string and caches it in a hashtable. This obfuscation allows retaining debug information, i.e. stacktraces, without leaking plaintext information in the code.
Feedback
Please let me know if there are any problems with maps after being processes by w3p, but make sure the map can be opened in the world editor.
You can also suggest cool features to implement.
Reporting Maps: Please make sure your maps runs and is openable with the world editor.
0.5.2
0.5.3
- Initial release
0.5.4
- TriggerRegisterVariableEvent is now allowed. Referenced variables will be kept unchanged.
- Added second inliner pass after local optimizations to get rid of functions which were shortened significantly
- Added rewrites for Jass "ternary" functions and equality comparisons with constant booleans
0.5.5
- Trigger string replacement in plain text files doesn't stop after the first match any more
- Trigger strings that are not inlined are now kept intact correctly
- Trigger strings with quotes are now properly escaped in script files
- Disabled experimental function rewrite
0.5.6
- Variables used in TriggerRegisterVariableEvent are now also protected during optimization.
- Charmap used for obfuscation is now customizable
- Default charmap now uses all characters
- Re-enabled experimental rewrites
- Fixed program hang when output map not writable
0.5.7
- Added more files for WTS inlining and fixed objmod inlining
- Fixed WTS inliner normalization of line breaks and max length
- Fixed war3map.wct not being removed
- Fixed uppercase color codes not being displayed
- Fixed variable protection for TriggerRegisterVariableEvent hooks
0.5.8
- Fixed WTS parser bug in underlying lib
0.5.9
- Fixed useless ExecuteFunction calls stopping script optimization. They now get removed.
- Fixed .wav files getting corrupted with extreme compression option
- Fixed input map getting modified after load
0.5.10
- Fixed WTS inliner corruption bug
0.5.11
- Improved Local Variable merging
- Fixed WTS inliner not keeping newlines intact
- Fixed parsing multiline strings
0.6.0
- Fixed bug in integer to hex transformation
0.6.1
- Updated to 1.32 common.j & blizzard.j for reforged support
- WIP: Allow specifying custom common.j & blizzard.j files
- Fixed incorrectly detecting agent type comparisons as errors
- Added github profile link
0.6.2
- Fixed lua minification for reforged and improved execution speed (thanks @BradPittlord)
- Added extra step indication for lua minfication after parsing
- Fixed expressions like (0 - 100) being rewritten to 100 instead of -100 and swallowing other optimizations (thanks @BLOKKADE)
0.6.3
- Fixed a bug with lua minification regarding operator precendece
- Updated common.j and blizzard.j to work with latest patches
0.6.4
- Re-enabled string encryption (only fails on edge cases)
- Split up compression into recompress and extreme, with extreme now using zopfli to even better compress the mpq
- Fixed issues with loadingscreen being removed when Trigger string inlining was enabled
0.7.0
- Added 'Remove Error Logs' option which removes error messages from vJass and Wurst code
- Default charsets now have a randomized order
- Added rewrites to replace EVENT_* variable references with equivalent conversion function calls
- Fixed lua minification bug with scripts containing strings with semicolons
0.7.0
- Fixed two issues with string hashing
- Split up string comparison hashing and encryption into their own options
- 'String Hashing' is what 'Encrypt Strings' was before - turning comparisons between strings into precomputed hash comparisons
- Added new 'String Encryption' option that obfuscates all original strings in the map by encrypting them with a secret key
- 'Remove World Editor Data' now removes the
war3mapMap.blp
file ifwar3mapMap.dds
is present
- Fixed 'Encrypt Strings' only working with other optimizations enabled
- Using random encryption key for 'Encrypt Strings'
Please report the following:
java.lang.IllegalAccessError: class Pe (in unnamed module @0x1d81eb93) cannot access class sun.swing.FilePane (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x1d81eb93
at Pe.a(Unknown Source)
at Pe.updateUI(Unknown Source)
at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:396)
at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:362)
at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:309)
at Pe.<init>(Unknown Source)
at MU.<init>(Unknown Source)
at Km.g(Unknown Source)
at Km.a(Unknown Source)
at main.WAppMain.a(Unknown Source)
at main.WAppMain.a(Unknown Source)
at Kq.a(Unknown Source)
at main.WAppMain.main(Unknown Source)
Yes, by installing the correct Java version mentioned in the first post, Version 8. I will release an update soon however which will lift this requirement.is there any way to fix that?
Try tinkering with the settings.Is map protection supposed to take a long time with this? I'm at like 15 mins now and it still says it's parsing the script :'(
If it takes longer than 5min no. you can run in terminal for more output. Some options require other options to be present, such as string encryption requires script optimization.Is map protection supposed to take a long time with this? I'm at like 15 mins now and it still says it's parsing the script :'(
Please stop it with the misleading suggestions. Disabling all options that actually do something obviously stop errors from happening. But then you might as well not use the program in the first place.Try tinkering with the settings.
For example this is what im using.
you can run in terminal for more output
Download link doesn't workInfo
Jass and Lua map optimizer. Most of the special "protections" are only available for Jass maps.
View attachment 382534
W3Protect.eu
The main reason for this tool was/is to have an all in one solution for map finalization.
(If Water and me fix SLK transform at some point)
Install
Requires an installation of Java 8 (Java 8 | AdoptOpenJDK)
If you have Java installed, just download the .zip file from this post and extract the .jar file from it.
Usage
Run the .jar from the downloaded archive with no arguments to start open the graphical interface.
Use the "Browse" button or drag & drop a map onto the app window to load it.
If the load was successful, you should see the preview image.
Otherwise the map is already protected or otherwise unreadable.
(If you think it's unprotected but not working, please report the map)
You can use w3protect from the commandline by passing a map path as first and only argument.
The config will be read from the .wpc file next to the .jar .
In both cases w3protect will generate a copy of your input map with the suffix "_w3pro" in the same location.
Options explained
- "Extreme Compression" - re-compresses every file in the mpq with best settings. (optionally zopfli)
- "Lua minify" - uses 'luamin' to minify the map's lua script.
- 'String Hashing': Turns constant string comparisons (e.g.
GetPlayerName(p) == "Local Player"
) into precomputed hash comparisons (e.g.StringHash(GetPlayerName(p))==$7e9e52f6
). This hides e.g. player name checks and command activators from plain sight.- 'String Encryption': Encrypts every string value in the map (e.g.
call DisplayTimedTextToPlayer(p,0.,0.,15.,"Hello this is a test")
) and replaces them with calls to a decrypt function (e.g.call DisplayTimedTextToPlayer(p,0.,0.,15.,decrypt("f\\@bf`DU[sSWLsFPTYQ"))
) which lazily decrypts the string and caches it in a hashtable. This obfuscation allows retaining debug information, i.e. stacktraces, without leaking plaintext information in the code.
Feedback
Please let me know if there are any problems with maps after being processes by w3p, but make sure the map can be opened in the world editor.
You can also suggest cool features to implement.
Reporting Maps: Please make sure your maps runs and is openable with the world editor.
0.5.2
0.5.3
- Initial release
0.5.4
- TriggerRegisterVariableEvent is now allowed. Referenced variables will be kept unchanged.
- Added second inliner pass after local optimizations to get rid of functions which were shortened significantly
- Added rewrites for Jass "ternary" functions and equality comparisons with constant booleans
0.5.5
- Trigger string replacement in plain text files doesn't stop after the first match any more
- Trigger strings that are not inlined are now kept intact correctly
- Trigger strings with quotes are now properly escaped in script files
- Disabled experimental function rewrite
0.5.6
- Variables used in TriggerRegisterVariableEvent are now also protected during optimization.
- Charmap used for obfuscation is now customizable
- Default charmap now uses all characters
- Re-enabled experimental rewrites
- Fixed program hang when output map not writable
0.5.7
- Added more files for WTS inlining and fixed objmod inlining
- Fixed WTS inliner normalization of line breaks and max length
- Fixed war3map.wct not being removed
- Fixed uppercase color codes not being displayed
- Fixed variable protection for TriggerRegisterVariableEvent hooks
0.5.8
- Fixed WTS parser bug in underlying lib
0.5.9
- Fixed useless ExecuteFunction calls stopping script optimization. They now get removed.
- Fixed .wav files getting corrupted with extreme compression option
- Fixed input map getting modified after load
0.5.10
- Fixed WTS inliner corruption bug
0.5.11
- Improved Local Variable merging
- Fixed WTS inliner not keeping newlines intact
- Fixed parsing multiline strings
0.6.0
- Fixed bug in integer to hex transformation
0.6.1
- Updated to 1.32 common.j & blizzard.j for reforged support
- WIP: Allow specifying custom common.j & blizzard.j files
- Fixed incorrectly detecting agent type comparisons as errors
- Added github profile link
0.6.2
- Fixed lua minification for reforged and improved execution speed (thanks @BradPittlord)
- Added extra step indication for lua minfication after parsing
- Fixed expressions like (0 - 100) being rewritten to 100 instead of -100 and swallowing other optimizations (thanks @BLOKKADE)
0.6.3
- Fixed a bug with lua minification regarding operator precendece
- Updated common.j and blizzard.j to work with latest patches
0.6.4
- Re-enabled string encryption (only fails on edge cases)
- Split up compression into recompress and extreme, with extreme now using zopfli to even better compress the mpq
- Fixed issues with loadingscreen being removed when Trigger string inlining was enabled
0.7.0
- Added 'Remove Error Logs' option which removes error messages from vJass and Wurst code
- Default charsets now have a randomized order
- Added rewrites to replace EVENT_* variable references with equivalent conversion function calls
- Fixed lua minification bug with scripts containing strings with semicolons
0.7.0
- Fixed two issues with string hashing
- Split up string comparison hashing and encryption into their own options
- 'String Hashing' is what 'Encrypt Strings' was before - turning comparisons between strings into precomputed hash comparisons
- Added new 'String Encryption' option that obfuscates all original strings in the map by encrypting them with a secret key
- 'Remove World Editor Data' now removes the
war3mapMap.blp
file ifwar3mapMap.dds
is present
- Fixed 'Encrypt Strings' only working with other optimizations enabled
- Using random encryption key for 'Encrypt Strings'