You are on page 1of 6

DEPROTECT v2.

3
Nathanmx
deprotect@nathanmx.com
Copyright (c) 2006 Nathanmx. All Rights Reserved.
This program is a continuation of source code previously developed
by Zuitek. He can be reached at zuitek@home.nl
//================================================
// Foreword
//================================================
I GUARANTEE that Deprotect can deprotect ANY MAP and make it editble with the wo
rld editor. There are some cases of extreme protection in which you may lose /so
me/ data, but not much. There is no map Deprotect can't retrieve the triggers, o
bject/item data, or terrain from. None.
INSTALLATION:
I suggest you install this Deprotect folder into the default WCIII installation
directory, i.e. C:\Program Files\Warcraft III\. It really doesn't matter where y
ou place it, but if you don't put it there you have to remember to change your w
ork and listfiles directory in the MPQ editor (see the options).
4 (or so) STEP PROCESS TO OPEN ANY MAP:
Step 1: Now, if you want to save time and not have to try out all the options of
deprotect, open MPQEditor.exe in the Deprotect Folder and open the map file of
the map you want to Deprotect. Choose your listfile* (see note below if you are
unsure). Now, look for the war3map.j file, its either in the root directory or i
n /scripts. 'Right click > extract' or you can double click it to extract AND op
en it. You can open it with Notepad - it may be a large file just let it load. I
f the code has been obfuscated then Deprotect will probably have a hard time rec
overing the GUI triggers ** (see below if you are confused) so remember not to t
ry. Otherwise if the code seems untouched you can try to restore GUI triggers.
Step 2: Close the MPQ editor and BACK UP YOUR MAP.
Step 3: Open up Deprotect, select the appropriate options (usually none other th
an the default options unless you want to restore GUI triggers ***), click brows
e, find your map hit 'Open' then hit Deprotect. That should do it for the most p
art. If you get an error, see below for explanations of some of the more common
errors and how to solve them.
Step 4: Open your map in World Editor - if it doesn't work, depending on the err
or you might need to change a file or two. Just use the MPQ editor to splice in
blank files from the BaseMapFiles folder. Sound confusing? Well it is! I'll give
a good example:
Sometimes when opening a map in WE just newly deprotected still produces an erro
r like:
"This application has encountered a critical error:
Not enough storage is available to process this command.
Program: c:\program fiels\warcraft iii\worldedit.exe
Object: WERandomGroupSet (.?AUERandomGroupSet@@)
Press OK to terminate the application."
Now, the thing you have to look at here is the Object, and in this case the prob
lem is with "WERandomGroupSet (.?AUERandomGroupSet@@)". Keyword: Group. This ind

icates the problem is with the war3map.w3i file. This is the file that deals wit
h the map info and player grouping / forces.
So, how do you fix this? There is more than one way, but the easiest way is to j
ust overwrite the .w3i file. Open the map with the MPQ editor, go to 'Operations
> Add file(s)...' and add a blank war3map.w3i file (there's a blank one in the
BaseMapFiles folder included in the Deprotect package). If you installed Deprote
ct in the location I suggested, it should be "C:\Program Files\Warcraft III\Depr
otect\Work". Just click 'ok' if the 'Add File(s) Options' window appears (you ca
n set it so it doesn't appear in the future) and your file will be added. Close
the MPQ editor and you should be all set to open the map in the World Editor.
* If you are unsure, ALWAYS pick the DEPROTECT.txt listfile from the listfiles s
election, unless you abosolutely know what you are doing. The DEPROTECT.txt list
file is a merger of all the listfiles for WC3 and has additional data as well.
** If you are unsure what the difference is between normal WC3 Editor produced J
ASS script and obfuscated JASS script, then just do a search for "*****" (withou
t the quotes). If a ton of them appear in the file (often strings of asterisks 2
5+ characters wide) this is usually a good sign that the war3map.j (the JASS fil
e) has been untouched (they are comment lines put there by the editor).
*** Full explanations of all the options is below.
//================================================
// Introduction
//================================================
>> What is Deprotect?
Deprotect is a program that allows a user to unprotect (or "deprotect") Warcraft
III maps that have been previously protected via map protection programs such a
s Heavy Locker, Extprotect, and others. The goal originally was to create a prog
ram that unprotect maps, let's you view their triggers in a seperate Editor, but
ultimately not let you open the map in the world editor. However, I have decide
d to keep deprotect the way it is and let it completey unprotect maps. Map prote
ction in itself is corruption by definition. Map protection programs corrupt the
headersize, remove editor files so the editor crashes, and obfusticates the cod
e so it can't be read easily by humans. Deprotect reverses this corruption by fi
xing these problems to the best possible extent.
>> What features does Deprotect currently support?
Deprotect has been loaded with features since it's last BETA release. In fact,
version's 1.0 through 2.0 were NEVER released publicly due to the overwhelming d
emand that this project be halted. This version is a fully functional version o
f Deprotect and supports the following features:
- ROC and TFT Map unprotection
- Breaks all map protection methods including:
- Hiding the war3map.j file in "scripts\"
- Changing the MPQ headersize information
- Code obfustication (doesn't unscramble, that's impossible)
- .w3r, .w3c, .w3s, .wct, .wtg file deletion
- Creates back-up maps
- Debug Mode to further analyze problems with deprotection
- User-friendly interface
- Restored File saving
- Restore GUI triggers option
- Auto-create war3mapunits.doo file
- Alternate Processing Order
- Full Jass Script trigger

>> What are some of the Pro and Cons of Map protecting?
Pros:
- Keeps inexperienced users from opening your map and stealing credit and/or hac
king the game
Cons:
- People cannot learn from your maps
- if you lose the original, you're screwed
//================================================
// Methods of Security
//================================================
There are a lot of different ways of protecting a warcraft 3 map. Here are some:
>> 1: Damaging the MPQ headersize information.
A warcraft3 map is like a zip file. You have first a 512 bytes big map header wi
th some informations. Then you have a MPQ archive attached. The MPQ archive cont
ains all the numerous files needed for a map. The first 4 bytes of the MPQ file
are the identifier. It can be read as 'MPQ'. The next four bytes are the header
size, which is always hex 0x20 00 00 00. Some map protectors now change the size
from 0x20 00 00 00 to a random number which can look like this for example: hex
0xF6 6E BA 76. Most MPQ applications now cannot open the MPQ archive anymore be
cause of that wrong size entry. Warcraft3 seems to ignore false header size entr
ies, so those maps still run in war3.
This protection can be very easily be repaired by just setting the value back to
0x20 00 00 00.
>> 2: Delete the war3map.wgt file inside a map The war3map.wgt contains all the
necessairy information about the variables, triggers and groups your map uses. T
his file is only used by the World-Editor. A missing or altered war3map.wgt file
results the World-Editor to fail loading the map.
This protection can be removed pretty easily as well. With a Deprotects parser s
cripts, you can rebuild the war3map.wgt file using the information stored in the
war3map.j file (The Map script file).
2b: Deleting the war3map.w3c, war3map.w3s, war3map.w3r, .war3mapunits.doo files
war3map.w3c stores the camera settings for the world editor. war3map.w3s stores
the sounds used by a map world editor. war3map.w3r defines the regions used in a
map for world editor.
All those files are also only used by the world editor and can be easily regener
ated by the war3map.j file. See "Delete the war3map.wgt file inside a map" above
.
>> 3: Hiding the war3map.j file
Some clever map protecting people figured out a way to hide the war3map.j file,
so you cannot extract it easily with some programs. Regular map files contains t
he war3map.j file directly in the root directory. The map protector guys figured
out that a map still works if the file is moved into a directory called "Script
s\".
This protection can be broken very easily... just by know this and placing the w
ar3map.j file back in its normal location.
>> 4: Scrambling the war3map.j file
Some protecting dudes think they are clever, so they renamee all the variables a
nd function names with random numbers. This renders the war3map.j file very hard
to read by normal people, but it's useless for parser scripts. Deprotect's pars
er scripts do not care for keywords. It only scans for patterns and therefore it

can still extract any information from the map.


//================================================
// How safe is map protecting?
//================================================
As you've already read above, map protecting might keep some "noobs" away from o
pening your maps in world editor.
The fact is, as long as warcraft 3 can open your map, theres a way to repair the
map, so it can be opened by the World Editor.
//================================================
// Instructions - Intro
//================================================
There are many events that can occur with Deprotect not being able to deprotect
a map, and if you know what they are, you should be able to get around the error
and force deprotect it. That's why you're reading this.
First off, just to let you know, Deprotect doesn't restore the war3mapunits.doo
file. I removed this implementation from the system so as to avoid direct map s
tealing. This way, the average person won't be able to unprotect the average map
completely and rename it - however, you will still be able to view the triggers
and such. If you think about it - the only reason you should be wanting to dep
rotect a map anyways is because you want to learn from the triggers and maybe ot
her object data. So it's not like you need to be able to save the map anyways.
However, if the war3mapunits.doo file IS in the map, well, then today's your luc
ky day. And even if it isn't there are definately a few ways of getting the war
3mapunits.doo file if you have the know how... Anyways, let's get on with Deprot
ect. Below are some of the tips to success.
//================================================
// Tips (to Success)
//================================================
- Keep the original Deprotect folder and files intact. You'll need the war3mapu
nits.doo file anyways, and this document will undoubtably be useful in the futur
e.
- When you use the "Save Restored Files" option, the files that will be saved ar
e of the following extentions: .wtg, .wct, .w3r, and .w3c.
- The option "Create backup" can sometimes cause errors. Back up your maps manu
ally instead and uncheck the option in Deprotect for the best results.
- Restoring GUI triggers may fail. So try restoring first, and if that fails, d
on't restore them. Deprotect will 99% of the time be able to restore triggers i
n at least custom text form.
//================================================
// Common Errors
//================================================
"The parameter is incorrect"
- Which means that you probably typed the maps file's location in wrong or Depr
otect simple can't access it. You don't need to put it in the same folder neces
sarily anymore, that bug has been fixed.

"The program cannot access the file because it is being used by another process.
"
- This can be the same as the above error, or it could mean that something else
on your computer (such as WE) is using the map file you are pointing to. Close
the map in WE before you use this program. If this still doesn't work, the easie
st way to fix this is to restart your computer.
"The system could not find the file specified."
- The error is pretty much as it says - the file you specified no longer exists
. Try re-browsing for the file (you may have moved it by accident before you hit
'Deprotect!'.
"The Application Failed to Initialize.... (0000000000x5)" etc etc etc
- This error could be from many things, and it is hard to pinpoint any one cause
of this. It's usually a problem in conjunction with missing .dll errors, meanin
g that your computer cannot properly read the a needed .dll file, even if you in
stalled it correctly. Also, it might be that for some reason your operating syst
em is trying to bring up same application up but its already loaded and there is
not enough memory to start the same application over again... Make sure your co
mputer is using Microsoft's latest Service Pack installed and try again.
"Out of Memory"
- Usually the way to solve this involves unchecking the "Full JASS script Trigge
r" option before you Deprotect a map. Since the entire JASS script is stored in
memory, large maps will more often than not cause this error.
//================================================
// .DLL Problems
//================================================
A lot of older computers can't handle Deprotects use of newer library calls, and
thus, they won't work. You can change this easily by adding to your existing li
brary some files known as dynamic link libraries. To do this, simply go to http:
//deprotect.nathanmx.com, download the .dll(s) you need from the bottom of the w
ebsite, and place them in the same folder as Deprotect.
//================================================
// The Options Explained
//================================================
- The Auto-create war3mapunits.doo option automatically adds a blank war3mapunit
s.doo file to your map. Use this if the map doesn't have one to begin, so you w
ill be able to open the map in WE. It's best to check this if you're unsure bec
ause it will never overwrite any existing file - it only writes if no file of th
at name exists (it will tell you).
- Debug Mode stops at certain checkpoints in the program and gives the user info
rmation on where it is. In debug mode you'll be informed of every stop so if the
program randomly quits/fails, you'll know the location. Thus, you know what ca
used the error and so you can avoid it by changing your options in the future (s
uch as alternate processing order).
- Save Restored Files lets you keep the files that were restored. They are .wtg,
.wct, .w3r, and .w3c.
- Create Backup creates a back up of the map. This option may cause problems. I
suggest backing up your map by hand first and unchecking this option when Depro
tecting a map.
- Restore GUI triggers attempts to restore all the GUI triggers in a map. It ma
y fail on huge maps with lots of triggers, and it will almost certainly fail on

maps whose code has been obfusticated / scrambled. If it does fail, simply unche
ck it and try re-Deprotecting the map - you'll always succeed in restoring at le
ast the custom text version of the triggers.
- The Alternate Processing Order option simply changes the order of the process'
s that are run by Deprotect. Enabling this can help you unprotect files that wo
uld not have shown before. For example, if you cannot deprotect a map initially
, try to deprotect it in Debug Mode. Then, try again on the same map file but wi
th the extra option of alternative proccessing order. You'll see that via Debug
Mode that the order is changed around - hopefully you can at least be able to g
et the files you need extracted (via save restored files) so you can put them in
yourself later with an MPQ editor.
- The 'Full JASS script trigger' option adds the full JASS script to a single cu
stom trigger in your WTG file. This is in case Restore GUI triggers fails and De
protect cannot restore the custom text triggers individually. The map won't run
correctly unless you disable that trigger but at least you will be able to see t
he maps JASS triggers from the WE.
There's not much more to know other than that... Good luck, have fun, and depro
tect responsibly!
Regards,
Nathanmx

You might also like