Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: idoL on March 19, 2005, 08:21 AM

Title: Help using mpqcontrol
Post by: idoL on March 19, 2005, 08:21 AM
I'm making a map unlocker  to help sift all the information coming out of a map when protected, then compare it to a unprotected map, my method was an attempt to try to replace the missing data with a 3rd party program, then the map will become readible again since PROEdit takes out unit string information that StarEdit requires to read it. My question is can I compare encrypted data and replace it? If not is  there a way to decrypt the information when it's recieved?
Title: Re: Help using mpqcontrol
Post by: MyndFyre on March 19, 2005, 10:30 AM
I knew we'd dealt with this topic before, and when I did a search I found out that it was you who started the whole bit anyway.

In case you lost the topic, it's at http://forum.valhallalegends.com/phpbbs/index.php?topic=7825.0.  [edit]I'm not familiar with the topic, and I thought I'd post this for your benefit in case you'd lost the link.[/edit]
Title: Re: Help using mpqcontrol
Post by: idoL on March 19, 2005, 11:55 AM
After awhile of researching data replacement and disassembling PROEdit I found that (what iago said) was true:
Quote251   SFileAuthenticateArchive(HANDLE hArchive,int)
was the information PROEdit was extracting, but this is the only information I can get back before it starts sending encrypted information, i'm not a hacker or a good programmer so now I come back asking you wise people for some advice. Otay?
Title: Re: Help using mpqcontrol
Post by: Warrior on March 19, 2005, 03:19 PM
This was an interesting topic, I was looking at how a locked map compares to an unlocked one and it looked like a few changed bytes but I'd have no idea how it got that way and how to reverse the process. I think dissasembling whatever locks it might reveal some useful information.
Title: Re: Help using mpqcontrol
Post by: Eric on March 19, 2005, 05:24 PM
If you did not already know, scm/scx files are actually MPQ's and you can extract the files from them through the use of the Storm API.

It's rather simple to understand and you can find an example in clsStormAPI of Damnation (http://www.cold-chaos.net/lord/Files/Battle.net/BinaryBots/Damnation.zip).

Unless the information removed is the same in all maps, I doubt you'll be able to recover it, however, I too, am unfamiliar with the subject.
Title: Re: Help using mpqcontrol
Post by: Eric on March 19, 2005, 05:35 PM
Quote from: Snake on March 19, 2005, 11:55 AM
After awhile of researching data replacement and disassembling PROEdit I found that (what iago said) was true:
Quote251   SFileAuthenticateArchive(HANDLE hArchive,int)
was the information PROEdit was extracting, but this is the only information I can get back before it starts sending encrypted information, i'm not a hacker or a good programmer so now I come back asking you wise people for some advice. Otay?

If MPQ authentication fails, StarCraft won't attempt to extract the files from it, so you'll no longer be able to use it to play and IIRC, you can play using a patched map so that can't be how it patches them.
Title: Re: Help using mpqcontrol
Post by: idoL on March 19, 2005, 06:25 PM
251   SFileAuthenticateArchive(HANDLE hArchive,int) is used when opening the map in StarEdit, not when playing the map.
Title: Re: Help using mpqcontrol
Post by: Blaze on March 19, 2005, 07:28 PM
Quote from: LoRd[nK] on March 19, 2005, 05:24 PM
Unless the information removed is the same in all maps, I doubt you'll be able to recover it, however, I too, am unfamiliar with the subject.
I am not sure how it works either but I have used map unprotectors in the past and they work.
Title: Re: Help using mpqcontrol
Post by: Warrior on March 19, 2005, 07:29 PM
I was thinking maybe it draws a character the Editor cannot display, and maybe the answer is not in unlocking the map but patching the editor?
Title: Re: Help using mpqcontrol
Post by: Blaze on March 19, 2005, 08:11 PM
Thats a good idea..
Title: Re: Help using mpqcontrol
Post by: idoL on March 19, 2005, 10:01 PM
Quotepatching the editor
Holy shit good idea.
No, not patching the editor but making something to read the information PROEdit adds, if any. I'll dink around with that.
Title: Re: Help using mpqcontrol
Post by: Warrior on March 19, 2005, 10:13 PM
Well, ProEdit might not be the only map locker to ever come out right? That's why I suggested stopping the editor from crashing on an unknown sprite?
Title: Re: Help using mpqcontrol
Post by: Blaze on March 19, 2005, 10:24 PM
Quote from: Snake on March 19, 2005, 10:01 PM
but making something to read the information PROEdit adds, if any.
Actually, its more of a takes away I think.
Title: Re: Help using mpqcontrol
Post by: idoL on March 19, 2005, 10:50 PM
Yes we know fully that PROEdit takes some kind of information away,  I like the idea of having somthing fix the editor from crashing but building an editor is just way too much work,  when I do find the missing data I could use it in better ways then to patch an editor, which I doubt the creators would let me do.
Title: Re: Help using mpqcontrol
Post by: Soul Taker on March 21, 2005, 04:09 PM
I thought we already went over this.  Protectors delete lots of non-essential stuff such as certain terrain information which only the map editor reads.  There was once a map editor made by someone from CamSys that was done from scratch, and opened protected maps without any problems, why not go that route?
Title: Re: Help using mpqcontrol
Post by: idoL on March 21, 2005, 06:35 PM
QuoteMy question is can I compare encrypted data and replace it? If not is  there a way to decrypt the information when it's recieved?
Title: Re: Help using mpqcontrol
Post by: Soul Taker on March 22, 2005, 09:49 AM
What encrypted data...
Title: Re: Help using mpqcontrol
Post by: Adron on March 22, 2005, 10:47 AM
Quote from: Snake on March 21, 2005, 06:35 PM
QuoteMy question is can I compare encrypted data and replace it? If not is  there a way to decrypt the information when it's recieved?

Of course you can compare and replace encrypted data. Data is just data, encrypted or not. It may take you a while to figure out what to compare for and what to replace with though.

And yes, of course there is a way to decrypt information when it's received.
Title: Re: Help using mpqcontrol
Post by: idoL on March 22, 2005, 11:47 AM
Quote from: Soul Taker on March 22, 2005, 09:49 AM
What encrypted data...


The information that my program calls from mpqcontrol is encrypted before being sent to me. I could use stormlib but I dont know C++.
Title: Re: Help using mpqcontrol
Post by: Warrior on March 23, 2005, 12:21 PM
Like I said patching the editor would render all of the map locking routines futile thus fixing your problem for every future map protector, you just need to find out how the protector malforms the map somehow so that the editor cannot read it which  shouldn't be to hard to do via dissasembly but patching the editor might violate something blizzard like so once again this is just an educated guess.
Title: Re: Help using mpqcontrol
Post by: MyndFyre on March 23, 2005, 05:54 PM
Quote from: Warrior on March 23, 2005, 12:21 PM
Like I said patching the editor would render all of the map locking routines futile thus fixing your problem for every future map protector, you just need to find out how the protector malforms the map somehow so that the editor cannot read it which  shouldn't be to hard to do via dissasembly but patching the editor might violate something blizzard like so once again this is just an educated guess.

The other problem is that if Blizzard decides to patch Starcraft, you could end up having to reinstall the game if you're not smart.