• Welcome to Valhalla Legends Archive.
 

[C++] Client Token (Client session key)

Started by Sorc.Polgara, March 01, 2005, 06:21 PM

Previous topic - Next topic

Sorc.Polgara

Ok, I was looking at the open source Yobgul's (I think that is how you spell it) BnetAuth open source to figure out how to create the Client Token (Client session key) for local cd-key hashing in C++.

I figured the piece of code that he used to get the Client Token is the "GetTickCount()" function.

So I tested out the GetTickCount().  I compared the resulting DWORD from GetTickCount() and the Client Token that I recieved from BNLS_CDKEY (0x01).

They aren't the same, at all...

wtf...

Eric

#1
BNLS generates it's own client key, hashes the CD-Key and then returns the client key used and the CD-Key hash.  You are then expected to send both, the client key BNLS used and the CD-Key hash, to Battle.net.

dxoigmn

Quote from: LoRd[nK] on March 01, 2005, 06:25 PM
BNLS generates it's own client key, hashes the CD-Key and then returns the client key used and the CD-Key hash.  You are expected to then send both, the client key BNLS used and the CD-Key hash, to Battle.net.

In other words, the client token can be completely random (or static) and, as the name indicates, is generated by the client.

Sorc.Polgara

Quote from: dxoigmn on March 01, 2005, 07:13 PM
Quote from: LoRd[nK] on March 01, 2005, 06:25 PM
BNLS generates it's own client key, hashes the CD-Key and then returns the client key used and the CD-Key hash.  You are expected to then send both, the client key BNLS used and the CD-Key hash, to Battle.net.

In other words, the client token can be completely random (or static) and, as the name indicates, is generated by the client.

Ok, so... I can use the one generated by GetTickCount! yay.

UserLoser.

Quote from: Solc.Polgara
So I tested out the GetTickCount().  I compared the resulting DWORD from GetTickCount() and the Client Token that I recieved from BNLS_CDKEY (0x01).

They aren't the same, at all...

wtf...
GetTickCount returns the number of milliseconds that the system has been up for.  Unless the server BNLS runs on and your system are perfectally syncronized, the value will never be the same (that is, assuming BNLS uses GetTickCount)

Joe[x86]

Remember: You're going to have to set a constant long to GetTickCount(), because otherwise it'll change.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

MyndFyre

Quote from: JoeTheOdd on March 02, 2005, 07:00 AM
Remember: You're going to have to set a constant long to GetTickCount(), because otherwise it'll change.

Not a *constant* long, because that's set at compile-time, not runtime.  :P
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

shout

If you are testing your code I belive you can use BNLS_CDKEYEX or something like that to specify a client token.