Valhalla Legends Forums Archive | Battle.net Bot Development | checksum (0x07 CLIENT_AUTHREQ1)

AuthorMessageTime
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
November 30, 2003, 11:02 AM
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.
November 30, 2003, 5:45 PM
Julas
[quote author=UserLoser. link=board=17;threadid=3962;start=0#msg32648 date=1070214121]
[font=Tahoma]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.
[/font]
[/quote]
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
November 30, 2003, 9:51 PM
Julas
[quote author=Skywing link=board=17;threadid=3962;start=0#msg32650 date=1070214300]
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.[/quote]
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?

[quote]The version check result is returned by the function CheckRevision in a DLL downloaded from the Battle.net server.
[/quote]
Isn't it the same function like in the example given by UserLoser.? I guess there are few variants for each IX86VerX.dll.
November 30, 2003, 9:57 PM
Kp
[quote author=Julas link=board=17;threadid=3962;start=0#msg32744 date=1070229474]
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?[/quote]

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

[quote author=Julas link=board=17;threadid=3962;start=0#msg32744 date=1070229474]Isn't it the same function like in the example given by UserLoser.? I guess there are few variants for each IX86VerX.dll.[/quote]

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.
November 30, 2003, 11:24 PM
Arta
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.
December 1, 2003, 1:38 AM
Julas
[quote author=Arta[vL] link=board=17;threadid=3962;start=0#msg32792 date=1070242725]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.
[/quote]
But not all packets are listed on your BnetDocs site, e.g 0x1E, 0x12, 0x15... Is there any other source?
December 1, 2003, 2:24 PM
dizzy
[quote author=Arta[vL] link=board=17;threadid=3962;start=0#msg32792 date=1070242725]
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.
[/quote]

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.
[/quote]

Which constants you talk about ?
April 18, 2004, 5:04 PM
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).
April 18, 2004, 5:08 PM
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 ?
April 18, 2004, 5:14 PM
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.
April 18, 2004, 5:19 PM
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...
April 18, 2004, 5:24 PM
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 ?
April 18, 2004, 5:29 PM
UserLoser.
The names can also be found in older versions of Battle.snp
April 18, 2004, 5:31 PM
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!
April 18, 2004, 5:35 PM
Adron
[quote author=dizzy link=board=17;threadid=3962;start=0#msg55671 date=1082309384]
Considering this how do you feel about using something you are almost sure its like in their codes ?
[/quote]

The names were obtained from debug outputs in a particular build of one of the dlls. I don't think those outputs are unique enough to have copyrightable value - they are just definitions.
April 18, 2004, 5:43 PM
Arta
My project supervisor at university thinks that they are copyrightable enough to cause problems. If you're doing anything open source, it'd be wise not to use them, which probably explains bnetd's names.
April 18, 2004, 7:55 PM
Skywing
[quote author=dizzy link=board=17;threadid=3962;start=0#msg55671 date=1082309384]
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 ?
[/quote]
Actually, you can find them by running any program that locates strings in binary files, like strings. You don't need to disassemble it or anything that would break their (questionable) EULA.

As a side note, I think that some of the differences are due to PvPGN's apparent goal of implementing the Battle.net protocol in such a way that most client features work the same to end users. As a result, not all things are correctly implemented because the Blizzard clients do not necessarily require a complete implementation.
April 20, 2004, 6:54 PM

Search