• Welcome to Valhalla Legends Archive.
 

Checkrevision: Checksum value

Started by Mesiah / haiseM, February 12, 2003, 05:11 PM

Previous topic - Next topic

Mesiah / haiseM

Im sure lots of people use CheckVersion or CheckRevision

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

pBuffer.InsertDWORD Checksum

I was wondering if anybody has any info on how that checksum is actually calculated, not source code, just how its reached.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Kp

#1
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.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Atom@school

#2
Ok i understand all that, but why do i sometimes get a different result?

Kp

#3
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.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Mesiah / haiseM

#4
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..
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Yoni

#5
Hi? BNLS has done that (and more) for months!

Mesiah / haiseM

#6
Quotei just wanted to do somethin simple

Dont want to have to use a whole new binary protocol server just to login, wanted something mega mega simple.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

UserLoser

#7
What about adding game or realm support to BNLS? I'm the lazy type sortof :-/

Noodlez

#8
you can connect to realm using BNLS

UserLoser

#9
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...

Yoni

#10
QuoteDont want to have to use a whole new binary protocol server just to login, wanted something mega mega simple.
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.

Noodlez

#11
you need to use hashdata though yoni! :-p

Mesiah / haiseM

#12
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.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Yoni

#13
Quoteyou need to use hashdata though yoni! :-p
Not if you just want to CheckRevision.

Noodlez

#14
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