Valhalla Legends Forums Archive | Battle.net Bot Development | [C++] Client Token (Client session key)

AuthorMessageTime
bethra
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...
March 2, 2005, 12:21 AM
LoRd
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.
March 2, 2005, 12:25 AM
kamakazie
[quote author=LoRd[nK] link=topic=10767.msg102136#msg102136 date=1109723159]
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.
[/quote]

In other words, the client token can be completely random (or static) and, as the name indicates, is generated by the client.
March 2, 2005, 1:13 AM
bethra
[quote author=dxoigmn link=topic=10767.msg102147#msg102147 date=1109726039]
[quote author=LoRd[nK] link=topic=10767.msg102136#msg102136 date=1109723159]
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.
[/quote]

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

Ok, so... I can use the one generated by GetTickCount! yay.
March 2, 2005, 2:38 AM
UserLoser.
[quote author="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...
[/quote]
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)
March 2, 2005, 4:39 AM
JoeTheOdd
Remember: You're going to have to set a constant long to GetTickCount(), because otherwise it'll change.
March 2, 2005, 1:00 PM
Myndfyr
[quote author=JoeTheOdd link=topic=10767.msg102183#msg102183 date=1109768447]
Remember: You're going to have to set a constant long to GetTickCount(), because otherwise it'll change.
[/quote]

Not a *constant* long, because that's set at compile-time, not runtime.  :P
March 2, 2005, 5:15 PM
shout
If you are testing your code I belive you can use BNLS_CDKEYEX or something like that to specify a client token.
March 4, 2005, 4:59 PM

Search