Thanks to your guys' help, I'm almost there!
I'm having a problem getting my password hashed...
When I send BNLS_HASHDATA with params:
(DWORD) 6
(DWORD) DOUBLEHASH
(NonNTString) "mypass"
(DWORD) < my client session key >
(DWORD) < my server session key >
I get an invalid password error on bnet with both SID_LOGINRESPONSE and SID_LOGINRESPONSE2.
When I send a BNLS_HASHDATA with params:
(DWORD) 6
(DWORD) 1 _or_ 0
(NonNTString) "mypass"
I get the expected 20-byte hash data back. I need to double-hash it, so then I send BNLS_HASHDATA with params:
(DWORD) 20 _or_ 22, same result
(DWORD) 1 _or_ 0
(DWORD[5]) < first hash result >
(DWORD) < my client session key >
(DWORD) < my server session key >
but then I get the same result with BNLS as if Bnet IP bans me - I get disconnected. What am I doing wrong here?
Thanks!
--Rob
Well, I fixed the second single-hash, but I'm still getting an invalid password. Thoughts?
You should use this:
(DWORD) Password length
(DWORD) HASHDATA_FLAG_DOUBLEHASH (0x04)
(Variable) Password
(DWORD) Client key
(DWORD) Server key
The HASHDATA_FLAG_DOUBLEHASH option tells BNLS to first create a hash of Password, and then create a hash of Client key + Server key + Hash(Password). The latter result is returned. This allows you to combine the common double-hash operation into just one transaction.