• Welcome to Valhalla Legends Archive.
 

BNet Chat bot?

Started by Ozzapoo, November 05, 2008, 02:35 AM

Previous topic - Next topic

Ozzapoo

#15
But I don't get how I'm supposed to generate it =/

Also, in SID_AUTH_CHECK, when It refers to 'EXE Version' and 'EXE Hash', what file is EXE? The hash exe file?

Barabajagal

GetTickCount works... or 123456... or anything you want. When I say it's generated by the client, I mean it. It can be any value from 0x00000000 to 0xFFFFFFFF.

And yes. The EXE file. Doesn't MBNCSUtil do that for you?

Ozzapoo

#17
Alright, I got it, but when I try to get the 'Key Private' using MBNCSUtils, it returns a 10-byte array, but it's supposed to fit in a DWORD?

Also, in SID_AUTH_CHECK, is '(DWORD) [5] Hashed Key Data' supposed to have the values hashed using the 'Broken SHA-1' thing?

brew

#18
Warcraft 3 style CDKeys have a 10 byte private value instead.
The array of 5 dwords in SID_AUTH_CHECK is the resulting 20-byte (suprise!) hash of the cdkey values and the tokens.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

MyndFyre

Quote from: Ozzapoo on November 11, 2008, 03:05 AM
Alright, I got it, but when I try to get the 'Key Private' using MBNCSUtils, it returns a 10-byte array, but it's supposed to fit in a DWORD?

Also, in SID_AUTH_CHECK, is '(DWORD) [5] Hashed Key Data' supposed to have the values hashed using the 'Broken SHA-1' thing?
You don't actually use the private for anything though.  You'd use .Product and .Value1 on the CdKey object.

Yes, hashed key data is the 20-byte hash returned by cdKey.GetHash(clientToken, serverToken).  It does not need to be converted to integers first; you can simply insert the byte array using .InsertByteArray() if you're using the DataBuffer/BncsPacket classes.
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.

Ozzapoo

So I can just use CdKey.GetHash(ClientToken,ServerToken) and put that result as the [5] DWords?

Ribose

#21
Yeah,
C#:
CdKey key = new CdKey(variablecontainingkeyasstring);
byte[] hash = key.GetHash(clientToken, serverToken);
...
packet.InsertByteArray(hash);

VB.Net:
Dim key As CdKey = New CdKey(variablecontainingkeyasstring)
Dim hash() As Byte = key.GetHash(clientToken, serverToken)
...
packet.InsertByteArray(hash)
~Ribose

MyndFyre

Quote from: Ribose on November 11, 2008, 01:51 PM
Yeah,
C#:
CdKey key = new CdKey(variablecontainingkeyasstring);
byte[] hash = key.GetHash(clientToken, serverToken);
...
packet.InsertByteArray(hash);

VB.Net:
Dim key As CdKey = New CdKey(variablecontainingkeyasstring)
Dim hash As Byte() = key.GetHash(clientToken, serverToken)
...
packet.InsertByteArray(hash)

Actually for VB it'd be:

Dim hash() As Byte = ...
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.

Ribose

~Ribose

Ozzapoo

Wait hold on...
(DWORD) [5] Hashed Key Data
Shouldn't that be 24 bytes? Or is the [5] the length?

MyndFyre

Quote from: Ozzapoo on November 12, 2008, 12:30 AM
Wait hold on...
(DWORD) [5] Hashed Key Data
Shouldn't that be 24 bytes? Or is the [5] the length?
A DWORD is four bytes long.  5 is the length of the array.  5 time 4 is 20.  Therefore the correct number of bytes is 20.
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.

Ozzapoo

QuoteThe data that should be hashed for 'Hashed Key Data' is:
Client Token
Server Token
Key Product (from decoded CD key)
Key Public (from decoded CD key)
(DWORD) 0
Key Private (from decoded CD key)
Then why are there six values to hash?

Hdx

You shove all those into a xSHA-1, and the digest is the 5 dwords you send.
You can have unlimited ammounts of data in a SHA1 hash, and the digest will always be 20 bytes

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Ozzapoo

Arlight....Well I think I got the basics right, but now when I connect it gives me the old product version error -.-

P.S. Hdx, congrats on 1000th post! :D

Hdx

Logs. And you sure your performing the check revision correctly?

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

|