Valhalla Legends Forums Archive | Battle.net Bot Development | Checkrevision: Checksum value

AuthorMessageTime
MesiaH
Im sure lots of people use CheckVersion or CheckRevision

[code]Result = CheckVersion(HashDir & "starcraft.exe", HashDir & "storm.dll", HashDir & "battle.snp", Hash, version, Checksum, ExeInfo, MPQName)

pBuffer.InsertDWORD Checksum[/code]

I was wondering if anybody has any info on how that checksum is actually calculated, not source code, just how its reached.
February 12, 2003, 11:11 PM
Kp
The checksum is reached by modifying in-memory variables based on the contents of the file.  Thus, if the file is corrupt or an incorrect version, the final result of the variable will be wrong and the server will reject you.  Of course, you could've guessed this from reading the source to that function.  Similarly, you could get the details of exactly what is done to arrive at the value by reading the function.  Different people use different variations of CheckRevision, some of which are more efficient than others; therefore, I can't add comments to the one you're using since I don't have it. :)

If you'll post back with a more specific question, I can try to offer a better answer.
February 13, 2003, 2:10 AM
Atom@school
Ok i understand all that, but why do i sometimes get a different result?
February 13, 2003, 10:33 AM
Kp
You mean, you receive a value other than what the server wanted?  Two potential answers to this:

1) The server changed its mind about the current "correct" answer before you responded.  Given the low number of clients in existence versus the high number of people connecting at any given time, it would make sense to cache the results of a checkrevision serverside.  That is, it comes up with some answer and says "For the next 2 minutes, this is the correct answer for Brood War logons."  If you happen to connect and get the version string seconds before it's due to change, you might not get your result back until the answer has changed - at which point, you are now "wrong."  This is simply bad luck, and really cannot be avoided without predicting when the answer will change and timing your version checks accordingly.  As far as I know, none outside Blizzard can make such a prediction with any accuracy.
2) Your implementation is flawed.  Some behavior of the checksumming algorithm was not properly duplicated in the implementation you're using.  You'll need to identify what is incorrect and fix it.
February 13, 2003, 12:12 PM
MesiaH
What i wanted to find out is how to calculate it based on the mpq ver and hash equation. Im horrible at math, and reading the c++ source (a language i dont know :() totally confused me, i just wanted to know if there was any way if i could return the checksum value from a website, cause i dont have any 24/7 computer to run a remote hashing server, i just wanted to do somethin simple for my bots brood war login, so it doesnt require local hashing or file updating, im guessing thats not really possible..
February 13, 2003, 4:12 PM
Yoni
Hi? BNLS has done that (and more) for months!
February 13, 2003, 5:17 PM
MesiaH
[quote]i just wanted to do somethin simple[/quote]

Dont want to have to use a whole new binary protocol server just to login, wanted something mega mega simple.
February 13, 2003, 6:00 PM
UserLoser
What about adding game or realm support to BNLS? I'm the lazy type sortof :-/
February 13, 2003, 6:49 PM
Noodlez
you can connect to realm using BNLS
February 13, 2003, 7:38 PM
UserLoser
Is there something I havn't seen on the BNLS document? Last time i looked...last update was changing the server or adding the 2nd one or something...
February 13, 2003, 8:39 PM
Yoni
[quote]Dont want to have to use a whole new binary protocol server just to login, wanted something mega mega simple.[/quote]
How simple can it get? All you have to do is connect, authorize (the function for generating an authorization checksum is *given* in the specification in both VB and C++), and use the version check packet (which seems to be the only packet you care about at this moment). It's all documented in the specification, and you only care about 3 BNLS packets (2 to authorize and 1 to CheckRevision), so you don't even have to read the whole thing.

If you change your mind, ask me on Battle.net and I'll make you an account.

Noodlez/UserLoser: BNLS doesn't have any support for realm logons. It probably never will. The realm logon is documented in BnetDocs and there is no special processing of any kind that needs to be done. You just copy a data block from the chat server to the realm server.
February 14, 2003, 7:44 AM
Noodlez
you need to use hashdata though yoni! :-p
February 14, 2003, 1:35 PM
MesiaH
Yoni, i dont want any authorization or crap like that, it delays login time. I just wanted to send all the stuff required to reach the checksum value, to a script on my site, calculate it, and echo the value back to the bot. thats what i mean when i say simple. IIRC, i already have a bnls account.
February 14, 2003, 3:42 PM
Yoni
[quote]you need to use hashdata though yoni! :-p[/quote]
Not if you just want to CheckRevision.
February 14, 2003, 4:22 PM
Noodlez
userloser was saying you need to add realm support to bnls, i said there already is (hashdata is all you need) ..not talking about checkrevision
February 15, 2003, 3:05 AM
Atom
I dont understand why people want to send 3 BNLS packets for one Battle.net Packet.
February 15, 2003, 10:26 AM

Search