Valhalla Legends Forums Archive | Battle.net Bot Development | Checksums of IX86ver#.mpq files used during SID_AUTH_CHECK

AuthorMessageTime
Trojan
Hello,

When logging in to battle.net, the client is told the name of an MPQ file (IX86ver1-7.mpq for the IX86 platform for example), which is then downloaded (if not already in bncache), and some checksum of this file is then used in the challenge calculation in SID_AUTH_CHECK. In all implementations of CheckRevision that I have seen, the programmer uses a hardcoded list of checksums for these files.

How are those checksums generated? I have tried taking the CRC32 of the mpq file, but that doesn't match. Neither is it the CRC32 of the file contained within the MPQ file. I am very interested if anyone knows what process is used to generate these values. Hopefully someone has knowledge of this area that they can share.

Thanks for your help!
July 14, 2006, 2:11 AM
Myndfyr
As I understand it, it's not actually a checksum of the MPQ.  The downloaded MPQ files only differ by seed value, and that (the seed value) is what you see as a checksum.
July 14, 2006, 2:35 AM
Trojan
Thanks for the information.
How were the seed values initially determined for the mpqs? I am interested in the process of determining them myself at runtime.
July 14, 2006, 2:52 AM
Myndfyr
[quote author=Trojan link=topic=15395.msg155701#msg155701 date=1152845554]
Thanks for the information.
How were the seed values initially determined for the mpqs? I am interested in the process of determining them myself at runtime.
[/quote]
I don't know how they were initially determined, but I bet it was done by decompilation.
July 14, 2006, 3:15 AM
LoRd
The MPQs each contain a nearly identical copy of the CheckRevision() function, which is used to compute the checksum of the three main game files.  The only difference, as MyndFyre mentioned, is that each MPQ uses its own unique seed value.  You can discover these values by extracting the dynamic libraries from each MPQ and reverse engineering or, more simply, comparing them.  If you compare the various libraries, you'll be able to quickly discover the values.
July 14, 2006, 3:41 AM
l2k-Shadow
[quote author=Trojan link=topic=15395.msg155701#msg155701 date=1152845554]
Thanks for the information.
How were the seed values initially determined for the mpqs? I am interested in the process of determining them myself at runtime.
[/quote]

They're not determined, they're just chosen constants by Battle.net, the way they were retrieved by users is by decompilation. Each MPQ has the same CheckRevision() function with different seed value, so all you need to do is tell a single function which seed to use.
July 14, 2006, 3:43 AM
Trojan
Excellent, I see these values and understand how it works now. Thanks very much for everyone's help.
July 14, 2006, 3:49 AM

Search