• Welcome to Valhalla Legends Archive.
 

BNetAuth.dll Password Hash?

Started by Jaquio, July 19, 2005, 09:28 PM

Previous topic - Next topic

Jaquio

Ok, I need to hash the password for 0x3A and I am using BNetAuth.dll Which I have been told I shouldn't because it sucks, by a couple of people. But oh well this is what I am learning with, anyways my problem is you use it like this


Public Declare Function X Lib "BnetAuth.dll" (ByVal outbuf As String, ByVal Password As String) As Long
PassHash = X(PassHash, Password)


I think... but when I used it like this when it gets down to send 0x3A my bot crashes.. Any idea why at all?

MyndFyre

I believe (and this may be incorrect) that your outbuf parameter needs to be ByRef.
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.

Jaquio

#2
Yea, I tried that and no luck it still crashed I think I am using it wrong or something. Either that or there is something wrong with my bnetauth.dll..


Edit: Oops sorry for posting I should have searched the forums fist. You use it like this


Public Declare Function X Lib "BnetAuth.dll" (ByVal outbuf As String, ByVal Password As String) As Long
TmpP = String(7 * 4, vbNullChar)
PassHash = X(TmpP, Password)


Thanks though

LivedKrad

For reference, I think the point of naming that variable "outbuf" was to imply that it was a buffer. I think when you pass strings to an API that is passed back with a value, it has to be buffered. Meaning I *think* that any string passed to the API that requires data be put back to have a set length string value passed to it instead of a null string. Instance:


Dim someBuf as String
someBuf = String$(28, Chr$(0))


Like I said, I think this is required for all strings passed to an API that is passed back with a value. Someone please correct me if I'm wrong, as you undoubtedly will.

Newby

Quote from: LivedKrad.fe on July 19, 2005, 10:59 PM
Instance:


Dim someBuf as String
someBuf = String$(28, Chr$(0))


IIRC,


Dim someBuf as String * 28


Works too.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Jaquio

Meh, can no one help me with this?  :'( All I need to do is get 0x3A then it's done.. because I know how to do the rest of the packets. Just it is not hashing the password right or maybe I screwed up in the other packets because it disconnects after 0x3A..

MyndFyre

Quote from: Jaquio on July 20, 2005, 11:52 AM
Meh, can no one help me with this?  :'( All I need to do is get 0x3A then it's done.. because I know how to do the rest of the packets. Just it is not hashing the password right or maybe I screwed up in the other packets because it disconnects after 0x3A..
Provide a packet log of your sent 0x3a.

And don't whine.  It's annoying.
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.

Jaquio

Quote from: MyndFyre on July 20, 2005, 11:59 AM
Quote from: Jaquio on July 20, 2005, 11:52 AM
Meh, can no one help me with this?  :'( All I need to do is get 0x3A then it's done.. because I know how to do the rest of the packets. Just it is not hashing the password right or maybe I screwed up in the other packets because it disconnects after 0x3A..
Provide a packet log of your sent 0x3a.

And don't whine.  It's annoying.


Meh, sorry lol here is a packet log of me sending 0x3A I think.. I am not to good with this little packet logger..


0000  00 0f db 20 91 97 00 03  c9 4f 1c f4 08 00 45 00   ... .... .O....E.
0010  00 57 79 94 40 00 80 06  b4 cd c0 a8 01 2d 3f f0   .Wy.@... .....-?.
0020  ca 79 0b d3 17 e0 e5 2c  a0 9a 58 16 21 86 50 18   .y....., ..X.!.P.
0030  43 9c 2a cc 00 00 ff 3a  2f 00 73 19 a3 1c 00 00   C.*....: /.s.....
0040  30 00 12 19 01 03 52 7c  dd 5a 65 bd fc ac 7b 95   0.....R| .Ze...{.
0050  b5 40 74 6a 6d 89 00 00  00 00 00 00 00 00 4a 61   .@tjm... ......Ja
0060  71 75 69 6f 00                                     quio.                       


I hope that is 0x3A.. I have no idea what to look for really(for solving my problem.).

MyndFyre

This is the problem:

0050  b5 40 74 6a 6d 89 00 00  00 00 00 00 00 00 4a 61   .@tjm... ......Ja
0060  71 75 69 6f 00                                     quio.           


You need to trim your username string.
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.

Jaquio

Quote from: MyndFyre on July 20, 2005, 01:44 PM
This is the problem:

0050  b5 40 74 6a 6d 89 00 00  00 00 00 00 00 00 4a 61   .@tjm... ......Ja
0060  71 75 69 6f 00                                     quio.           


You need to trim your username string.


Erm, how exactly would I do that? >.< I am new to all this packet stuff I was using csb for the longest time and decided to do it the right way.

MyndFyre

Quote from: Jaquio on July 20, 2005, 02:04 PM
Erm, how exactly would I do that? >.< I am new to all this packet stuff I was using csb for the longest time and decided to do it the right way.
You don't know how to handle a string?  I don't think you know Visual Basic well enough to continue.

You might look into Trim$, Left$, and Right$.

Another hint: you should do this with the string BEFORE you put it in the packet.  It has nothing to do with "all this packet stuff."
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.

Jaquio

Quote from: MyndFyre on July 20, 2005, 02:17 PM
Quote from: Jaquio on July 20, 2005, 02:04 PM
Erm, how exactly would I do that? >.< I am new to all this packet stuff I was using csb for the longest time and decided to do it the right way.
You don't know how to handle a string?  I don't think you know Visual Basic well enough to continue.

You might look into Trim$, Left$, and Right$.

Another hint: you should do this with the string BEFORE you put it in the packet.  It has nothing to do with "all this packet stuff."


No no no, I know how to use the Trim$,Left$ and Right$ functions in vb but I wouldn't know how to trim the username string to work with the 0x3A packet.

R.a.B.B.i.T

.................................

Jaquio

Yea what a lot of help that was. Am I not doing something right here?  :-\

LivedKrad

I think the point was to help you realize that if you knew how to use Trim$, Right$, and Left$, then trimming the "0x3A string" would be no different than trimming any other string that you apparently know how to do properly.