• Welcome to Valhalla Legends Archive.
 

0x51 Help using BNCSUtil

Started by Archangel, May 18, 2006, 10:05 PM

Previous topic - Next topic

Archangel

Ok, all the problem i had was in my buffer, i resovled it with the help of Pianka, i got a last question, should i take care about the (null)?
I'm not an Addict.

raylu

Didn't we determine somewhere a long time ago about how that was one of the optional fields?

Pianka is still online?!
Pie?

l)ragon

Quote from: raylu on May 21, 2006, 11:40 AM
Didn't we determine somewhere a long time ago about how that was one of the optional fields?

Pianka is still online?!
Believe I posted that it was optional June of 05, the exeinfo and cdkey user name is both optional. Would still rather see people do things the way the game does it but hey it is your cdkey lol.

Public Function p0x51(sck As Winsock, _
                       typ As String, _
                       cKey As Long, _
                       sKey As Long, _
                       CDK1 As String, _
                       CDK2 As String, _
                       Spawn As Long, _
                       CDKeyUsername As String, _
                       Version As Long, _
                       Checksum As Long, _
                       exeinfo As String)
Dim pb As New clsPacketBuffer
Dim NumberOfCDKeys As Long
Dim CDKeyOneBuf As String
Dim CDKeyTwoBuf As String
Dim CDKeyHashDat As String

    NumberOfCDKeys = GetNumberOfKeys(typ)

    Select Case NumberOfCDKeys
        Case 0
            'LTRD, RHSD, RHSS, W3DM can also use this function.
        Case 1
            CDKeyOneBuf = DoCDKeyOne(CDK1, sKey, cKey) 'CDKEY ONE
        Case 2
            CDKeyOneBuf = DoCDKeyOne(CDK1, sKey, cKey) 'CDKEY ONE
            CDKeyTwoBuf = DoCDKeyTwo(CDK2, sKey, cKey) 'CDKEY TWO
        Case Else
            'There are no products that have more then 2
            'cdkeys as of yet, But.. since the packet
            'could take more then 2, possibly they might
            'set up for some expansion to an expansion
            'games?
    End Select
    CDKeyHashDat = CDKeyOneBuf & CDKeyTwoBuf
   
    With pb
        .InsertDWORD cKey
        .InsertDWORD Version
        .InsertDWORD Checksum
        .InsertDWORD NumberOfCDKeys
        .InsertDWORD Spawn
        .InsertNonNTString CDKeyHashDat                             'W3DM, RHSS, RHSD, LTRD this field is empty, so haveing it here still wont have an effect
        .InsertNTString exeinfo                                     'Optional string <- Discovered to be Optional by me, l)ragon June 1, 2005.
        .InsertNTString IIf(NumberOfCDKeys > 0, CDKeyUsername, "")  'Optional string <- Discovered to be Optional by me, l)ragon June 1, 2005.
        .SendBuffer sck, Bnet, SID_AUTH_CHECK
    End With
   
    Set pb = Nothing
End Function

Private Function GetNumberOfKeys(typ As String) As Long
    Select Case typ
        Case "LTRD", "RHSD", "RHSS", "MD3W":
            GetNumberOfKeys = &H0
        Case "PX2D", "PX3W":
            GetNumberOfKeys = &H2
        Case Else:
            GetNumberOfKeys = &H1
    End Select
End Function


I'm sure you can figure out rest thats missing.
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*