[GUIDE] Rebuilding An MPQ
Page 1 of 6

Author:  haxorico [ September 8th, 2010, 10:16 pm ]
Post subject:  [GUIDE] Rebuilding An MPQ

This guide is recommended for users who can cheat normal maps, yet want to do more.

We will be covering the following on this guide:
a) Building a listfile
b) Rebuilding an MPQ

Tools that we will be using:


MPQ Recover.rar


XVI32 (Hex Editor).rar


Part A - Learn more about listfile, and how to get it.
What is a listfile?
A listfile is a .txt file, containing the files the map is using. So if all you do is add a cheat pack to maps, then all you need is a .txt file containing the information

as those are the places the war3map.j file will be found.

What do I need a listfile for?
Well if all you want to edit some extra files, like the loading screen, you need the files to extract and edit. And if you want to rebuild MPQ, you will need all the file-names you can get, as all unknown will be deleted, and it may result in the map not functioning correctly.
But be careful as the bigger the listfile is, the longer it takes for the MPQEditor you are using to load the map.

What happens if I don't have some file names in my listfile?
Well it will show you the file in the MPQEditor, tough it wont show you the name, or it wont show the files at all, depends on the MPQEditor you are using. Here is a picture to demonstrate (using RMPQEx)

How do I get file names into my listfile?
There are programs to do this for you. Lets get started with MPQRecover:
1) open MPQRecover.
2) Browse for your map.
3) Tick "Deep MPQ Scanning".
4) Click on Brute Force.
5) Click on scan.. It might take some time.
6a) If the program crash then dont tick "Deep MPQ Scanning" and if it still crashes then dont click on brute force.
6b) Click on Save List.
7) and you got your listfile.

MPQRecover doesn't always get all the file names. So we will now use RMPQEx
1) Paste the listfile we got into the RMPQEx folder.
2) Open RMPQEx.
3) Click on the browse button and choose your map.
4) Click on Open.
5) Click on Auto-Search.
6) Click on Extract-Listfiles.
7) Merge it with your existing listfile.

Now if you are still missing some files:
1) Paste the listfile we got into the x-dep folder.
2) Paste the map into the x-dep folder.
3) Rename the map to mymap.
4) Run x-dep, and let it finish.
5) Click on any button to close x-dep
6) Enter the folder called "mymap.w3x.temp"
7) Copy the 2 .txt files in there and paste them in a new folder, along with the listfile from step 1
8) Merge all this files.

How do I merge listfiles and what is it for?
Well if you have a file inside your listfile, there is no point having it in there again. tough you want to add file names into it, so merging makes sure you wont add the same file name twice.
In-order to merge the listfiles:
1) Open MPQEditor
2) Click on the "Tools" Tab
3) Click on Merge Listfile tool
4) Add the listfiles you want to merge
5) Choose a file that will be the merged listfile (result)
6) Start
Those are all the ways to get a listfile using free tools.

Part B - Rebuilding the MPQ Archive
Ever happened when you tried to open a map in a program such as MPQMaster, and it crashed or didnt open the map? if so, then that means the map MPQ Archive is corrupted, and to solve it, we need to rebuild the MPQ Archive.
When rebuilding the MPQ, we basicly just extract all the files and add them into a blank map. All unknown files will be deleted so use Part A to get a full listfile.
Rebuilding MPQ:
1) Open MPQEditor.
2) Force opening it in read-only mode
3) Select all the files and extract them into the "Files" folder, located inside the MyMap.w3x.temp folder inside your X-Dep folder (Make sure the folder is empty before you do so, if it isnt then empty it)
4) Place the map in X-Dep folder
5) Rename the map to mymap
6) Run x-dep
7) When its done, press any key to close the program
8) Now you got a map called "deprotected" inside you x-dep folder. That is the map with a rebuilt MPQ and will be openable at MPQMaster or any other MPQEditor

Author:  royalsymbol [ September 9th, 2010, 2:30 am ]
Post subject:  Re: [Guide] Advanced Cheating

omg and thank you! i've been waiting for this!

Author:  AbusivePie [ September 9th, 2010, 2:47 am ]
Post subject:  Re: [Guide] Advanced Cheating

Very nice guide.

Author:  royalsymbol [ September 9th, 2010, 2:58 am ]
Post subject:  Re: [Guide] Advanced Cheating

However some files if you tried to open it with MPQ Recover like Dacia1.8_Spaz.w3x , which has MPQ archieve corrupted, we couldn't open it with RMPQEx & X-Deprotector.

so is there an alternative method?

Author:  Kyoshiro [ September 9th, 2010, 4:28 am ]
Post subject:  Re: [Guide] Advanced Cheating

You can use a listfile from an older version that hasnt been spazzled.

Author:  royalsymbol [ September 9th, 2010, 6:39 am ]
Post subject:  Re: [Guide] Advanced Cheating

Thanks Kyoshiro, this has been thought of :)

but im not sure at first if you used this method but now i do.

I've looked at your hacked map, your JJCP [globals] was put right at the end, why not at the start?

then your JJCP [endglobals] was at the start..

finally your JJCP [function main] was in between in the start and the end..

why is that so? its quite confusing how you insert the cheat packs, would you like to explain some parts?

now that listfiles are covered, we only need to learn some cheat packs inserting.

Author:  UndeadxAssassin [ September 9th, 2010, 2:18 pm ]
Post subject:  Re: [Guide] Advanced Cheating

Simply because if you insert it at the start of the .j, it's so much easier to find out. GRanted, putting it further down isn't hard to find, but it does take more time than just having it right there when you open up JASSCraft. It doesn't matter where you put it, as long as it's under the section that it's supposed to be (id esta, globals under globals, endglobals before function main, and function main under function main. However, the locals for function main have to come first.

Author:  infernorock [ September 9th, 2010, 2:35 pm ]
Post subject:  Re: [Guide] Advanced Cheating

Nice guide haxor.

Author:  royalsymbol [ September 10th, 2010, 2:20 am ]
Post subject:  Re: [Guide] Advanced Cheating

Also, we need to take note of JASS editing.
For instance,

Function (trigger_0222)
call customdefeatbj ("no cheating")
End Function

I found out that we cannot delete the three lines, only delete "call customdefeatbj ("no cheating")
so that it becomes
Function (trigger_0222)
End Function

If you delete the three lines, your WC3 couldn't load the map.

What else is there to take note of?

what else can we delete?
I've noticed another like

Function (trigger_0222)
return (Map_control)=Player_slot_playing=computer(trigger_2055)
End Function

notice the 'return', can we delete that line?

all of these is written from my memory, its about the same like this..

Author:  AbusivePie [ September 10th, 2010, 2:26 am ]
Post subject:  Re: [Guide] Advanced Cheating

Don't delete the call function, just change it from call customdefeatbj ("no cheating") to call DoNothing( ) . So it looks like this.

Function (trigger_0222)
call DoNothing( )
End Function

Page 1 of 6 All times are UTC
Powered by phpBB® Forum Software © phpBB Group