• Welcome to Valhalla Legends Archive.
 

checksum (0x07 CLIENT_AUTHREQ1)

Started by Julas, November 30, 2003, 05:02 AM

Previous topic - Next topic

Julas

Hi,

My first post here :D
Lately I'm trying to make a program in C++ which uses DRTL style of logging into Bnet. The reason why I use the old login style is that I don't want to use any CD-Key. As the main source of knowledge about packets I use pvpgn source (bnet_protocol.h), Ethereal dumps and and Arta's docs. I got stuck at this point: packet 0x07,  checksum (it's 5th DWORD in this packet). I noticed that this value changes everytime I log in with Diablo. So... how is this counted? How can I get that checksum?

TIA, Regards

Skywing

Be careful about basing your work off of bnetd/PvPGN; those are known to have inaccuracies in their implementation of the Battle.net protocol that may cause you to get banned on official servers.

The version check result is returned by the function CheckRevision in a DLL downloaded from the Battle.net server.

Julas

#2
Quote from: UserLoser. on November 30, 2003, 11:42 AM
I believe you'd have to run CheckRevision() which is in IX86VerX.dll, on Diablo.exe, Storm.dll, and Battle.snp.  You also get the Version out of that, which is the 4th DWORD and is likely to change also, along with the information on your Diablo.exe, which is the null terminated string at the end.

You can find an example of this here.

Version won't change until Blizzard releases new patch for Diablo I = never? CheckRevision() from this code (is it the same which is used in BnetAuth?) IMHO requires too much info (assuming that we won't see new patch for Diablo I in the nearest future - some info is constant then) if I only need to get checksum, nothing more.
I'll try to make my own function although when I look into this code I feel like a C++ lamer ;p

Julas

Quote from: Skywing on November 30, 2003, 11:45 AM
Be careful about basing your work off of bnetd/PvPGN; those are known to have inaccuracies in their implementation of the Battle.net protocol that may cause you to get banned on official servers.
Yes, I know there are differences - PVPGN always sends the same 0x06 packet - so checksum is constant. BTW I got banned few times but I was unbanned after a couple of minutes. Is there a chance to get permanent ban if something wrong was sent to BN?

QuoteThe version check result is returned by the function CheckRevision in a DLL downloaded from the Battle.net server.
Isn't it the same function like in the example given by UserLoser.? I guess there are few variants for each IX86VerX.dll.

Kp

Quote from: Julas on November 30, 2003, 03:57 PM
Yes, I know there are differences - PVPGN always sends the same 0x06 packet - so checksum is constant. BTW I got banned few times but I was unbanned after a couple of minutes. Is there a chance to get permanent ban if something wrong was sent to BN?

Not sure about permanent bans, but there are definitely some long lasting ones if you screw up badly enough.

Quote from: Julas on November 30, 2003, 03:57 PMIsn't it the same function like in the example given by UserLoser.? I guess there are few variants for each IX86VerX.dll.

The versioning DLLs all use the same underlying algorithm, but they have subtle differences that result in completely different checksums depending upon which one you use.

To address your versioning issues:
The verbyte and version dword are constant to a version of Diablo.  I recommend never hardcoding other people's magic values, but you could pretty safely just pull those from a configuration file.  The checksum is controlled by the versioning DLL and the control string.  Those change every few minutes, so you'll need to actually compute it each logon.  You'll need the game's main files (Diablo.exe, Storm.dll, Battle.snp) to compute the answer correctly.  They must be from the most recent version and must not have been modified in any way.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Arta

#5
Having worked with PvPGN/BnetD quite a bit, I can say with complete confidence that they break the protocol *horribly* and should never be used to test a bot intended for use with Battle.net - not in the beginning stages, anyway. After you have the logon working and your basic functionality is sound, it could perhaps be used to test other things. Certainly you mustn't depend on it to do the same things as Battle.net.

BTW, the packet you're referring to SID_REPORTVERSION. So far as I know, no one uses the BnetD team's constants except them - you might want to stick to what has become, imo, an accepted convention.

Julas

Quote from: Arta[vL] on November 30, 2003, 07:38 PMBTW, the packet you're referring to SID_REPORTVERSION. So far as I know, no one uses the BnetD team's constants except them - you might want to stick to what has become, imo, an accepted convention.
But not all packets are listed on your BnetDocs site, e.g 0x1E, 0x12, 0x15... Is there any other source?

dizzy

Quote from: Arta[vL] on November 30, 2003, 07:38 PM
Having worked with PvPGN/BnetD quite a bit, I can say with complete confidence that they break the protocol *horribly* and should never be used to test a bot intended for use with Battle.net - not in the beginning stages, anyway. After you have the logon working and your basic functionality is sound, it could perhaps be used to test other things. Certainly you mustn't depend on it to do the same things as Battle.net.

Can you detail on this please? AFAIK there are protocol differences but mathematically speaking pvpgn is getting there with each new release. Also I wouldnt say "horribly" breaking the protocol unless you have some proof on that. And btw, PvPGN is open source, which means if you got something you dont like about it you can always send us a patch.

Quote
BTW, the packet you're referring to SID_REPORTVERSION. So far as I know, no one uses the BnetD team's constants except them - you might want to stick to what has become, imo, an accepted convention.

Which constants you talk about ?
Use the source Luke!

Arta

I'm talking about Blizzard's names for their packets. The SID_ set of names.

I'm not sure how many of the things I noticed that are wrong with pvpgn have been fixed, and I've forgotten a lot of them, since I no longer use pvpgn for anything. I prefer the alternative (*cough* grin).

dizzy

I dont want to start a flame on this but you realise that those constants are completly arbitrary with some technical reasons for their names (SID_ for yours, probably meaning something like Server packet ID), SERVER_ for ours meaning the same thing. Now of course that many people who have inspired on your work and documentation have probably used the same IDs while those who have inspired on starhack, bnetd, pvpgn use the other way arround (btw: Im curious what names do Warforge people use). I dont think one might say which naming scheme is better unless of course you provide some good reasons :)

PS: which alternative to PvPGN you speak about ?
Use the source Luke!

Adron

I think that what Arta wants to say about the constants is that he's using the names they obtained from Blizzard, while you're using the names you made up yourself.

dizzy

ouch!

I have never imagined you people are using information from Blizzard. I wouldnt say more because I hope you realise the legal implications. I thought you reversed it as everybody else. Funny who is on suit now for "using copyrighted code" if you think of it...
Use the source Luke!

dizzy

OK, what I mean to say is that doing a sed 's@CLIENT_AUTHREQ1@SID_something@' in pvpgn sources is very easy but I need to know what are the legal implications of using some code constants as from Blizzard's sources ? In their suit against bnetd they claim the modified SHA-1 hash was "stolen" from their codes, not reversed. Considering this how do you feel about using something you are almost sure its like in their codes ?
Use the source Luke!

UserLoser.

The names can also be found in older versions of Battle.snp

dizzy

then probably we need to ask a lawyer about this. blizzard also claims all those files they send you when connecting to battle.net are copyrighted by them.

we are all programmers here, and what I hate mostly is arguing with programmers about legal issues when what we should do is programming. I am sorry for flooding this thread with this messages. Damn the world we live it and the fscking lawyers!
Use the source Luke!