• Welcome to Valhalla Legends Archive.
 

Old 0x36 packet [C++]

Started by TruffleShuffle, November 23, 2002, 08:41 PM

Previous topic - Next topic

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?

Noodlez

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

TruffleShuffle

#2
Actually, I did not copy it out of vlbot, and I know what I want it to do..

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 :)

Zakath

#4
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.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

TruffleShuffle

a, b, c, d and encryptvalue are all unsigned longs.

TruffleShuffle

#6
boo!  :'(

Skywing

#7
QuoteWhich 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 :)
The hashing method is not the same.  You shouldn't use SID_AUTH_* for Mac Starcraft or Warcraft II.

Zakath

#8
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!
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

tA-Kane

#9
QuoteWhich 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 :)

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

Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Arta

#10
Well, i was just suggesting, since yours isn't working. As i said i've never used this packet, so I wasn't sure.