Valhalla Legends Forums Archive | Battle.net Bot Development | Old 0x36 packet [C++]

AuthorMessageTime
TruffleShuffle
                             printf("Checking product key...\n");
                                   ValidCdkey = DecodeCDKey(cdkey, &valProdID, &valValue1, &valValue2);
                                   if(!ValidCdkey){
                                         printf("Local decode of product key returned false -- aborting!\n");
                                         Disconnect();
                                         return;
                                   }
                                   cdkeyhashbuf[0] = d;
                                   cdkeyhashbuf[1] = encryptvalue;
                                   cdkeyhashbuf[2] = a;
                                   cdkeyhashbuf[3] = b;
                                   cdkeyhashbuf[4] = c;
                                   HashData((char *)cdkeyhashbuf, 20, (char *)cdkeyhash);

                                   packetbuf.insert((int)0);
                                   packetbuf.insert(strlen(cdkey));
                                   packetbuf.insert(a);
                                   packetbuf.insert(b);
                                   packetbuf.insert(encryptvalue);
                                   packetbuf.insert(d);
                                   packetbuf.insert(cdkeyhash[0]);
                                   packetbuf.insert(cdkeyhash[1]);
                                   packetbuf.insert(cdkeyhash[2]);
                                   packetbuf.insert(cdkeyhash[3]);
                                   packetbuf.insert(cdkeyhash[4]);
                                   packetbuf.insert(username);
                                   packetbuf.sendpacket(bnet_data, 0x36);

This doesn't ip ban, but bnet returns invalid cdkey. Anyone see why?
November 24, 2002, 2:41 AM
Noodlez
ewwww use 0x51

and do you even know what that code does? or did you copy & paste it out of the vlbot on pscode

/me rollseyes

i dont remember 0x36 very clearly, but that looks correct
November 24, 2002, 5:05 AM
TruffleShuffle
Actually, I did not copy it out of vlbot, and I know what I want it to do..
November 24, 2002, 11:44 AM
Arta
Which game are you doing this for?

I don't use this packet but I would assume the hash is the same as SID_AUTH_INFO's. if it is, you're hashing the wrong data - should be:

ClientToken
ServerToken
KeyProduct
KeyValue1
0
KeyValue2

But you should use new packets, nood is right :)
November 24, 2002, 3:14 PM
Zakath
Yeah...new packets are much more compact. Less handling you have to do...and they're mapped out in the BNLS protocol spec, which is available for anyone to see.

Umm...where do you define d, encryptvalue, a, b, and c? Without knowing what those are, it's hard to help you.
November 24, 2002, 4:15 PM
TruffleShuffle
a, b, c, d and encryptvalue are all unsigned longs.
November 24, 2002, 4:19 PM
TruffleShuffle
boo!  :'(
November 24, 2002, 10:54 PM
Skywing
[quote]Which game are you doing this for?

I don't use this packet but I would assume the hash is the same as SID_AUTH_INFO's. if it is, you're hashing the wrong data - should be:

ClientToken
ServerToken
KeyProduct
KeyValue1
0
KeyValue2

But you should use new packets, nood is right :)[/quote]The hashing method is not the same.  You shouldn't use SID_AUTH_* for Mac Starcraft or Warcraft II.
November 25, 2002, 2:55 PM
Zakath
I use it for War2 because Bnet will accept it. If they change that, so will I, but until then I see no reason to put in old auth code, since every other client I'm interested in supporting uses the newer auth system.

Connection.cpp is already 800+ lines long, I don't wanna make it more complex than I absolutely have to at this point!
November 25, 2002, 6:37 PM
tA-Kane
[quote]Which game are you doing this for?

I don't use this packet but I would assume the hash is the same as SID_AUTH_INFO's. if it is, you're hashing the wrong data - should be:

ClientToken
ServerToken
KeyProduct
KeyValue1
0
KeyValue2

But you should use new packets, nood is right :)[/quote]

No, 0x36 uses this packet format:

DWORD: 0x00000000
DWORD: CDKeyStringLength
DWORD: ProductID (Not STAR/SEXP/etc; Look at BNLS's GetVersionByte sequence for valid product IDs)
DWORD: KeyValue1
DWORD: ServerKey
DWORD: ClientKey
5 DWORDS: KeyHash

You get the KeyHash value by hashing...
DWORD: ServerKey
DWORD: ClientKey
DWORD: ProductID
DWORD: KeyValue1
DWORD: KeyValue2

November 27, 2002, 6:45 PM
Arta
Well, i was just suggesting, since yours isn't working. As i said i've never used this packet, so I wasn't sure.
November 29, 2002, 9:12 PM

Search