Valhalla Legends Forums Archive | Battle.net Bot Development | Create Account (vb6)

AuthorMessageTime
CrAz3D
Creating an Account using VB 6...
How might I do this using hashes?
June 13, 2003, 10:28 PM
Camel
[code]SendPacket &H3D, CalcHashBuf(password) & UserName & Chr(0)[/code]
June 14, 2003, 12:42 AM
CrAz3D
Thank ya kindly
EDIT: Is that ALL I have to do?
June 14, 2003, 3:01 AM
Yoni
It would help to know what you're doing so that you can process the response correctly, too... See BnetDocs.
June 14, 2003, 10:13 AM
CrAz3D
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.
June 14, 2003, 3:31 PM
Yoni
It wasn't a question.
June 14, 2003, 3:42 PM
Camel
all good things must come to an end.

[code]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[/code]

[edit] modified the seeds so it wont work right :)
June 16, 2003, 12:26 AM
Eibro
[quote][edit] modified the seeds so it wont work right :)[/quote]Now, how utterly stupid and pointless was that?
June 16, 2003, 1:54 AM
Camel
[quote author=Eibro link=board=17;threadid=1628;start=0#msg12397 date=1055728477]
[quote][edit] modified the seeds so it wont work right :)[/quote]Now, how utterly stupid and pointless was that?
[/quote]
well i dont want to make it too easy
June 16, 2003, 2:19 AM
Camel
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!
June 17, 2003, 2:19 AM
dRAgoN
[quote author=Camel link=board=17;threadid=1628;start=0#msg12474 date=1055816350]
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]

lol then why keep refering to it?
June 18, 2003, 3:52 AM
Spht
[quote author=Camel link=board=17;threadid=1628;start=0#msg12474 date=1055816350]
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]

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.
June 19, 2003, 10:42 AM
Eternal
Nice. +1
June 19, 2003, 12:32 PM
Camel
[quote author=Spht link=board=17;threadid=1628;start=0#msg12641 date=1056019331]
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.
[/quote]

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=Camel]refrains from using the 'give a man a fish' saying[/me]
June 19, 2003, 11:04 PM
St0rm.iD
[quote author=Camel link=board=17;threadid=1628;start=0#msg12658 date=1056063852]
[quote author=Spht link=board=17;threadid=1628;start=0#msg12641 date=1056019331]
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.
[/quote]

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=Camel]refrains from using the 'give a man a fish' saying[/me]
[/quote]

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.
June 20, 2003, 2:18 PM
Camel
[quote author=St0rm.iD link=board=17;threadid=1628;start=0#msg12688 date=1056118711]
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]

i've never even seen the source for nbbot
i ported it from bnetauth source. i never took credit for doing it myself.
June 20, 2003, 4:43 PM
DarkMinion
[code]
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);
}
[/code]
June 20, 2003, 6:23 PM
SiMi
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.
June 20, 2003, 7:03 PM
Adron
[quote author=St0rm.iD link=board=17;threadid=1628;start=0#msg12688 date=1056118711]
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
[/quote]

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
June 21, 2003, 2:54 PM
Arta
[quote author=Camel link=board=17;threadid=1628;start=0#msg12658 date=1056063852]
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=Camel]refrains from using the 'give a man a fish' saying[/me]
[/quote]

Camel, I so rarely say this kind of thing, but in this situation... just shut the fuck up. I mean, honestly.
June 21, 2003, 7:03 PM
DarkMinion
Heheh Arta, agreed. ;)
June 21, 2003, 9:24 PM
CrAz3D
Well, I think I've gotten nowhere again. Would anyone care to help me out a little?
June 26, 2003, 3:28 PM
iago
[quote author=Adron link=board=17;threadid=1628;start=15#msg12719 date=1056207271]
[quote author=St0rm.iD link=board=17;threadid=1628;start=0#msg12688 date=1056118711]
My proof: no one uses the name CalcHashBuf except Adron and stuff derived from his code.
[/quote]

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]

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!
June 27, 2003, 1:08 AM
CrAz3D
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.
July 16, 2003, 7:42 PM

Search