Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: CrAz3D on June 13, 2003, 05:28 PM

Title: Create Account (vb6)
Post by: CrAz3D on June 13, 2003, 05:28 PM
Creating an Account using VB 6...
How might I do this using hashes?
Title: Re:Create Account (vb6)
Post by: Camel on June 13, 2003, 07:42 PM
SendPacket &H3D, CalcHashBuf(password) & UserName & Chr(0)
Title: Re:Create Account (vb6)
Post by: CrAz3D on June 13, 2003, 10:01 PM
Thank ya kindly
EDIT: Is that ALL I have to do?
Title: Re:Create Account (vb6)
Post by: Yoni on June 14, 2003, 05:13 AM
It would help to know what you're doing so that you can process the response correctly, too... See BnetDocs.
Title: Re:Create Account (vb6)
Post by: CrAz3D on June 14, 2003, 10:31 AM
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.
Title: Re:Create Account (vb6)
Post by: Yoni on June 14, 2003, 10:42 AM
It wasn't a question.
Title: Re:Create Account (vb6)
Post by: Camel on June 15, 2003, 07:26 PM
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 :)
Title: Re:Create Account (vb6)
Post by: 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?
Title: Re:Create Account (vb6)
Post by: Camel on June 15, 2003, 09:19 PM
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
Title: Re:Create Account (vb6)
Post by: 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!
Title: Re:Create Account (vb6)
Post by: l)ragon on June 17, 2003, 10:52 PM
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?
Title: Re:Create Account (vb6)
Post by: Spht on June 19, 2003, 05:42 AM
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.
Title: Re:Create Account (vb6)
Post by: Eternal on June 19, 2003, 07:32 AM
Nice. +1
Title: Re:Create Account (vb6)
Post by: 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
Title: Re:Create Account (vb6)
Post by: Banana fanna fo fanna on June 20, 2003, 09:18 AM
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.
Title: Re:Create Account (vb6)
Post by: Camel on June 20, 2003, 11:43 AM
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.
Title: Re:Create Account (vb6)
Post by: DarkMinion on June 20, 2003, 01:23 PM

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);
}
Title: Re:Create Account (vb6)
Post by: SiMi on June 20, 2003, 02:03 PM
    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.
Title: Re:Create Account (vb6)
Post by: 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
Title: Re:Create Account (vb6)
Post by: Arta on June 21, 2003, 02:03 PM
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.
Title: Re:Create Account (vb6)
Post by: DarkMinion on June 21, 2003, 04:24 PM
Heheh Arta, agreed. ;)
Title: Re:Create Account (vb6)
Post by: CrAz3D on June 26, 2003, 10:28 AM
Well, I think I've gotten nowhere again.  Would anyone care to help me out a little?
Title: Re:Create Account (vb6)
Post by: iago on June 26, 2003, 08:08 PM
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!
Title: Re:Create Account (vb6)
Post by: CrAz3D on July 16, 2003, 02:42 PM
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.