Creating an Account using VB 6...
How might I do this using hashes?
SendPacket &H3D, CalcHashBuf(password) & UserName & Chr(0)
Thank ya kindly
EDIT: Is that ALL I have to do?
It would help to know what you're doing so that you can process the response correctly, too... See BnetDocs.
What I'm doing?...I don't think I understand that wuestion but I'll try to answer it.
I'm tryin to make it so that if someone tries login with an account that is not created it will automatically create it for them.
It wasn't a question.
all good things must come to an end.
Public Function CalcHashBuf(ByVal buf As String) As String
Dim pos As Long, sublen As Long
Dim hashbuf(&H10 + 5) As Long
hashbuf(0) = &H67452301
hashbuf(1) = &H98BADCFE
hashbuf(2) = &HC3D2E1F0
hashbuf(3) = &HEFCDAB89
hashbuf(4) = &H10325476
For pos = 0 To Len(buf) Step &H40
sublen = Len(buf) - pos
If sublen > &H40 Then sublen = &H40
Dim t As String
t = Mid(buf, pos + 1, sublen) & String(&H40 - sublen, Chr(0))
Dim i As Long
For i = 0 To 15
hashbuf(5 + i) = CVL(Mid(t, i * 4 + 1, 4))
Next
datahash hashbuf
Next
CalcHashBuf = MKL(hashbuf(0)) & MKL(hashbuf(1)) & MKL(hashbuf(2)) & MKL(hashbuf(3)) & MKL(hashbuf(4))
End Function
Public Sub datahash(ByRef param() As Long)
Dim buf(&H50) As Long
Dim A As Long, B As Long, C As Long, D As Long, E As Long, G As Long
Dim i As Long
Dim p As Long
p = UBound(param) - 5
If p > &H40 Then p = &H40
For i = 0 To p - 1
buf(i) = param(i + 5)
Next
For i = &H10 To &H4F
G = buf(i - &H10) Xor buf(i - &H8) Xor buf(i - &HE) Xor buf(i - &H3)
buf(i) = Rol(1, G)
Next
A = param(0)
B = param(1)
C = param(2)
D = param(3)
E = param(4)
For i = 0 To 79
G = buf(i)
G = Add(G, E)
G = Add(G, Rol(A, 5))
Select Case True
Case i < 20
G = Add(G, ((B And C) Or ((Not B) And D)))
G = Add(G, &H6ED9EBA1)
Case i < 40
G = Add(G, (C And B) Or (D And C) Or (D And B))
G = Add(G, &H5A827999)
Case i < 60
G = Add(G, (D Xor C Xor B))
G = Add(G, &HCA62C1D6)
Case i < 80
G = Add(G, (D Xor C Xor B))
G = Add(G, &H8F1BBCDC)
Case Else
Debug.Assert False
End Select
E = D
D = C
C = Rol(B, 30)
B = A
A = G
Next
param(0) = Add(param(0), A)
param(1) = Add(param(1), B)
param(2) = Add(param(2), C)
param(3) = Add(param(3), D)
param(4) = Add(param(4), E)
End Sub
[edit] modified the seeds so it wont work right :)
Quote[edit] modified the seeds so it wont work right :)
Now, how utterly stupid and pointless was that?
Quote from: Eibro on June 15, 2003, 08:54 PM
Quote[edit] modified the seeds so it wont work right :)
Now, how utterly stupid and pointless was that?
well i dont want to make it
too easy
why would i intentionally mess with the values and then give you the answer two posts later?
figgure it out yourself
and prefferably dont post the answer. the point was to keep the csb noobs away!
Quote from: Camel on June 16, 2003, 09:19 PM
why would i intentionally mess with the values and then give you the answer two posts later?
figgure it out yourself
and prefferably dont post the answer. the point was to keep the csb noobs away!
lol then why keep refering to it?
Quote from: Camel on June 16, 2003, 09:19 PM
why would i intentionally mess with the values and then give you the answer two posts later?
figgure it out yourself
and prefferably dont post the answer. the point was to keep the csb noobs away!
You're purposely stomping on what the BotDev community is trying to accomplish. If you haven't anything of value to post, don't reply at all. Deliberately modifying code samples in an attempt to just confuse people won't get you very far here.
Nice. +1
Quote from: Spht on June 19, 2003, 05:42 AM
You're purposely stomping on what the BotDev community is trying to accomplish. If you haven't anything of value to post, don't reply at all. Deliberately modifying code samples in an attempt to just confuse people won't get you very far here.
what the hell? i didn't feel like giving away the entire answer. modifying small bits of code
forces the consumer to read and understand it. imo, that's
better than just giving the answer away.
/me refrains from using the 'give a man a fish' saying
Quote from: Camel on June 19, 2003, 06:04 PM
Quote from: Spht on June 19, 2003, 05:42 AM
You're purposely stomping on what the BotDev community is trying to accomplish. If you haven't anything of value to post, don't reply at all. Deliberately modifying code samples in an attempt to just confuse people won't get you very far here.
what the hell? i didn't feel like giving away the entire answer. modifying small bits of code forces the consumer to read and understand it. imo, that's better than just giving the answer away.
/me refrains from using the 'give a man a fish' saying
Shut up, you stole it from the NBBot source and we all know it. Whether you translated it yourself or got it indirectly, from someone else, you still stole it. So don't go telling people to do it themselves, OK?
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
Quote from: St0rm.iD on June 20, 2003, 09:18 AM
Shut up, you stole it from the NBBot source and we all know it. Whether you translated it yourself or got it indirectly, from someone else, you still stole it. So don't go telling people to do it themselves, OK?
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
i've never even seen the source for nbbot
i ported it from bnetauth source. i
never took credit for doing it myself.
void SendOLSPassword(char *szAccount, char *szPassword, unsigned long dwSessionKey)
{
unsigned long dwPasswordHash[7];
dwPasswordHash[0] = GetTickCount();
dwPasswordHash[1] = dwSessionKey;
calchashbuf(dwPasswordHash + 2, (char *)szPassword, strlen(szPassword));
calchashbuf(dwPasswordHash + 2, dwPasswordHash, 7 * sizeof(unsigned long));
dBuf.add(dwPasswordHash, 7 * sizeof(unsigned long));
dBuf.add(szAccount);
SendPacket(SID_OLS_PASSWORD);
}
hashbuf(0) = &H67452301
hashbuf(1) = &H98BADCFE
hashbuf(2) = &HC3D2E1F0
hashbuf(3) = &HEFCDAB89
hashbuf(4) = &H10325476
I dont know C++ but im guessing those have something to do with:
hashbuf[0] = 0x67452301
hashbuf[1] = 0xEFCDAB89
hashbuf[2] = 0x98BADCFE
hashbuf[3] = 0x10325476
hashbuf[4] = 0xC3D2E1F0
Maybe those are some of the strings you edited.
Quote from: St0rm.iD on June 20, 2003, 09:18 AM
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
It's very interesting to see how I gave various functions working names while disassembling them, then was too lazy to change them when implementing them in C, and now those names appear in various other software. Maybe I should've spent some more time picking good names :P
Quote from: Camel on June 19, 2003, 06:04 PM
what the hell? i didn't feel like giving away the entire answer. modifying small bits of code forces the consumer to read and understand it. imo, that's better than just giving the answer away.
/me refrains from using the 'give a man a fish' saying
Camel, I so rarely say this kind of thing, but in this situation... just shut the fuck up. I mean, honestly.
Heheh Arta, agreed. ;)
Well, I think I've gotten nowhere again. Would anyone care to help me out a little?
Quote from: Adron on June 21, 2003, 09:54 AM
Quote from: St0rm.iD on June 20, 2003, 09:18 AM
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
It's very interesting to see how I gave various functions working names while disassembling them, then was too lazy to change them when implementing them in C, and now those names appear in various other software. Maybe I should've spent some more time picking good names :P
I do the same thing, although I doubt that anybody ever will ever use my names again :-)
I called it "GetHash"
And if you want the real way to hash, look at the function located in battle.snp at 0x19012400. I'll give you a hint:
void __fastcall GetHash(BYTE HashBuffer[5], BYTE *HashData, DWORD DataLength);
That should be more than enough to figure it out yourself.. I personally started with nothing :-P
Good luck!
I've gotten it to create accounts in the Cesign mode so I compiled the EXE, now I'm told it doesn't make the accounts from the bot & it doesn't.
Any ideas on what may be the difference between the designmode & the actual EXE?....I use the exact smae bnetauth.dll for both.