• Welcome to Valhalla Legends Archive.
 

Help 0x51 SID_AUTH_CHECK

Started by iNsaNe, March 13, 2007, 07:56 PM

Previous topic - Next topic

iNsaNe

the parameters say:
CreateDecoder(key As String) as MBNCSUtil.CdKey
key:
The CD key to initialize processing for.

and strCDKey is the string variable of my CD Key from the text box from my bot options.

MysT_DooM

not familar with MBNCUtil , but are you positive strcdkey is storing the cdkey
which you provided from ur textbox in ur options?  I reckon it shud error if blank
but im not familar with the dll ur using.  if not sure before doing the decoding of key do

if strcdkey = "" then
Msgbox "ur key is nothing"
else
msgbox "ur key is " & strcdkey
end if




vb6, something about that combination of numbers and letters is sexy

iNsaNe

#17
Yes, ive already used msgbox to show my cdkey, which worked.
Just MBNCSUtil isnt storing my cd key

MysT_DooM

well the code ur using looks just like this one
http://forum.valhallalegends.com/index.php?topic=15325.0
and he didn't have much problems with it stopping at that spot so
try instead of

CDKeyDecoded = MBNCSUtil.CdKey.CreateDecoder(strCDKey)

try putting the direct path to the cdkey

CDKeyDecoded = MBNCSUtil.CdKey.CreateDecoder(form1.text1.text)


vb6, something about that combination of numbers and letters is sexy

brew

I believe MBNCSUtil is open source, you *should* take a look at how it stores your cdkey and what possibly be the problem. And become more familiar with it so you won't have any other problems later on.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Sorc.Polgara

Are you making sure you pass the CD-key without dashes?

The key will need to be 13, 16, or 26 (depends on the product) in length without dashes.

iNsaNe

#21
Ok my CDKeyDecoded works now, now I have a problem with settings the ServerToken.
    Private Sub winSock_DataArrival(ByVal sender As System.Object, ByVal e As
AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles winSock.DataArrival

        Dim Data As String
        winSock.GetData(Data, vbString, e.bytesTotal)

        If InStr(Data, HexToStr("FF50")) Then

            AddChat(Color.SpringGreen, "<- Received: 0x50!")

            Get_SIDAUTHINFO = Data

            Get_SIDAUTHINFO_ValueString = Mid$(Get_SIDAUTHINFO, 40, 102)
            Get_SIDAUTHINFO_MPQ = Mid$(Get_SIDAUTHINFO, 25, 14)
            ServerToken = Val("&H" & StrToHex(StrReverse(Mid(Get_SIDAUTHINFO, 9, 4)))) 'Is this the problem?

            PBuff.SEND_SIDAUTHCHECK()

        End If

...

...

...

End Sub


ServerToken is initially set as Long but then converted to an unsigned integer in my SEND_SIDAUTHCHECK command. I think its wrong.
...

HashLength = CDKeyDecoded.GetHash(ClientToken, CUInt(ServerToken))

...

Im trying to set it to the server token sent by bnet without it being a string because MBNCSUtil requires it to be an unsigned integer. Can someone help me setting the ServerToken (for Warcraft III if the game matters) properly?

[Edit: broke up a long line.]

Sorc.Polgara

#22
Why don't you use the BncsReader Class included in MBNCSutil to parse packets?!

Need to make it a byte array instead of treating the packet data as a string...

winSock.GetData(Data, vbByte, e.bytesTotal)



Dim pck0x50 As New BncsReader(Data)

Dim ServerToken As UInteger
Dim MpqFiletime As Long
Dim MpqFilename As String
Dim ValueString As String
Dim ServerSig() As Byte

pck0x50.Seek(8)
ServerToken = pck0x50.ReadUInt32()
pck0x50.Seek(4)
MpqFiletime = pck0x50.ReadInt64()
MpqFilename = pck0x50.ReadCString()
ValueString = pck0x50.ReadCString()
ServerSig = pck0x50.ReadByteArray(128)


Something like that should work.


Bah, I'm still debating whether or not Insane even wrote the VB6 code he's posting.  If he did he wouldn't be trying to rewrite the whole bot over again in .NET which is basically what he's doing right now/will end up having to do... then again if he leeched it why the hell would he want to leech this god awful VB6 sourcecode b/c I'm sure there are better coded open source VB6 bots (I can't match the code of VB6 bots to the original authors like some people on this forum can :P).

I think it's time for me to stop helping him either way.

iNsaNe

It's nice of you to assume such, but I wrote it all. Get off the forums if you dont feel like helping. This is my first bot, Im sure you had just as many questions.

brew

#24
I had many problems like that when I wrote my first bot too. .NET is challenging, and for a beginner, I would probably get confused on the same things too. Please, just stop trying to put people down Polgara. iNsaNe: What I would do, is extract the long value out of the acual text which coresponds to the server token

sample:
ServerToken = GetDWORDVal(Mid(Data, 9, 4))
'(assuming GetDWORDVal is a function that returns the long value of the string, try using the bit converter class for this)

Or w/e the .NET equivalent to Mid() is.
You really should use your packet debuffer class you're using with this project (if you're using one at all) but in the case you're not, just go with that code and nothing will go wrong.
I can see where sorc.polgara is getting this conclusion from, but any piece of code, even as simple as getting the server token, could become very challenging to someone with little expierence.
Edit* Yeah for the cdkey you really should do CDKey = Replace(CDKey, "-", vbNullString) or something before hashing in your logon code, to make it easier to configure among other things. Don't be afraid to do checks, for example "If Len(CDKey) <> 13 Or Len(CDKey) <> 16 Or Len(CDKey) <> 26 Then MsgBox "you entered the cdkey wrong"". small error catchers like that can prevent huge errors later on.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Sorc.Polgara

Maybe if he LISTENED and LEARNED to stopped treating packets as strings, which he's been told 1000 times already then he wouldn't be running into these problems.

Mystical

Quote from: iNsaNe on March 14, 2007, 06:09 PM
I'm still having troubles. This is my code so far:
 InsertNonNTString(ASCII.GetString(HashLength))

Quote from: MyndFyre[vL] on July 03, 2006, 06:05 PM

you shouldn't use Encoding.ASCII.GetString(hash) to insert the string.  It's a byte array and should stay as such.  With Encoding.ASCII you risk losing values greater than 0x7f

I suppose you could convert each to a character then a byte:

For i = 0 To HashLength.Length
    .InsertByte(CByte(HashLength(i) And &Hff))
Next


Are you aware that MBNCSUtil also includes a packet buffer designed for Battle.net?

Chriso

Try...

            Dim CDKeyDecoded As New MBNCSUtil.CdKey.CreateDecoder(strCDKey)