• Welcome to Valhalla Legends Archive.
 

[Resolved]MCP_CHARLIST2(0x19) Help..

Started by Jaquio, March 04, 2006, 01:54 PM

Previous topic - Next topic

Jaquio

Alright, I have gotten the bot able to Realm Connect but now when I send 0x19 and get it back, when I try to remove the proper info for MCP_CHARLOGON(0x07) I am only able to remove maybe 4-5 letters from my characters name.. I am using Joes 'Debuffer Class' to remove what I need and such. But it doesn't seem to be working properly could anyone help?

l2k-Shadow

perhaps you could help us out by posting your code so we could see your mistakes?
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Jaquio

Quote from: l2k-Shadow on March 04, 2006, 09:29 PM
perhaps you could help us out by posting your code so we could see your mistakes?

Ok.. here is my 0x19 Recv'd code.


        Case &H19
        'Debug.Print "Recv'd:0x19"
            With DB
                .Buffer = Data
                .RemoveHeader
                .RemoveWORD 'Unknown
                .RemoveDWORD 'Total amount of characters.
                .RemoveWORD 'Returned amount of characters.
                'Character Stuff
                .RemoveDWORD 'Seconds since January 1 00:00:00 UTC 1970
                .RemoveNTString 'Character name
                .RemoveWORD 'Flags
                .RemoveNTString 'Modified statstring
            End With


I guess I must be doing something wrong?  :-\

MyndFyre

Quote from: Jaquio on March 04, 2006, 10:25 PM
I guess I must be doing something wrong?  :-\

Either that, or Battle.net isn't working just for you!

A packet log would be appropriate too.
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

Nevermind, Hdx helped me. See, the Debuffer class I was using wasn't working properly. I used one Hdx gave me and it returned everything I needed, Joe I think you need to work on yours. Sorry for all the trouble if it wasn't for the bad debuffer class I wouldn't have gotten stuck.

l2k-Shadow

I just looked at Joe's debuffer class and found the following code:

'// Packet Debuffer
'// Written by Joe[x86]

Private m_sBuffer As String

Public Property Let Buffer(Buffer As String)
    Let m_sBuffer = Buffer
End Property

Public Property Get Buffer() As String
    Let Buffer = m_sBuffer
End Property

Public Function RemoveHeader(Optional Bytes As Long = 4) As String
    Let RemoveHeader = Mid(m_sBuffer, m_lPosition, Bytes)
    Let m_sBuffer = Mid(m_sBuffer, Bytes + 1)
End Function

Public Function RemoveNTString() As String
    Dim NTPos As String: Let NTPos = InStr(1, m_sBuffer, vbNullChar)
    If Not CBool(NTPos) Then Exit Sub
    Let RemoveNTString = Mid(m_sBuffer, 1, NTPos - 1)
    Let m_sBuffer = Mid(m_sBuffer, NTPos + 1)
End Function

Public Function RemoveWORD() As Integer
    Let RemoveWORD = GetWORD(Mid(m_sBuffer, 1, 2))
    Let m_sBuffer = Mid(m_sBuffer, 3)
End Function

Public Function RemoveDWORD() As Long
    Let RemoveDWORD = GetDWORD(Mid(m_sBuffer, 1, 4))
    Let m_sBuffer = Mid(m_sBuffer, 5)
End Function

Public Function RemoveQWORD() As Long
    Let RemoveQWORD = GetQWORD(Mid(m_sBuffer, 1, 8))
    Let m_sBuffer = Mid(m_sBuffer, 9)
End Function

Public Function RemoveVoid(Length As Byte) As String
    Let RemoveVoid = Mid(m_sBuffer, 1, Length)
    Let m_sBuffer = Mid(m_sBuffer, Length + 1)
End Function


It's all dandy, except the fact that GetWORD/GetDWORD/GetQWORD functions aren't included.. I thought the point of a class module was to be independent. anyway more specifically i see some problems here:

Public Function RemoveNTString() As String
    Dim NTPos As String: Let NTPos = InStr(1, m_sBuffer, vbNullChar)
    If Not CBool(NTPos) Then Exit Sub
    Let RemoveNTString = Mid(m_sBuffer, 1, NTPos - 1)
    Let m_sBuffer = Mid(m_sBuffer, NTPos + 1)
End Function


Since when does InStr() return a string? Now when we properly put it to the variable it is supposed to be:

If Not CBool(NTPos) Then Exit Sub

is acceptable but

If NTPos > 0 Then
    Let RemoveNTString = Mid(m_sBuffer, 1, NTPos - 1)
    Let m_sBuffer = Mid(m_sBuffer, NTPos + 1)
End If

a little easier there..
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Hdx

If anyone cares, the following is the class he is using now:
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
    (ByRef destination As Any, _
    ByRef Source As Any, _
    ByVal numbytes As Long)
Private strBuffer As String

Public Sub SetData(Data As String)
    strBuffer = Data
End Sub

Public Function GetData() As String
     GetData = strBuffer
End Function

Public Sub ClearData()
    strBuffer = vbNullString
End Sub

Public Function rFILETIME(Optional QWORD As Boolean = False) As String
    Dim strFT() As String, strTMP As String
    If Not QWORD Then
        strFT = Split(rNTString & Space(1), Space(1))
        If strFT(0) > 2147483647 Then strFT(0) = (strFT(0) - 4294967296#)
        If strFT(1) > 2147483647 Then strFT(1) = (strFT(1) - 4294967296#)
    Else
        ReDim strFT(0 To 1)
        strFT(1) = rDWORD
        strFT(0) = rDWORD
    End If
    rFILETIME = strFT(0) & Space(1) & strFT(1)
End Function

Public Function StripHeader() As Byte
    StripHeader = Asc(Mid(strBuffer, 2, 1))
    strBuffer = Mid(strBuffer, 5)
End Function

Public Function StripBNLSHeader() As Byte
    StripBNLSHeader = Asc(Mid(strBuffer, 3, 1))
    strBuffer = Mid(strBuffer, 4)
End Function

Public Function StripRealmHeader() As Byte
    StripRealmHeader = Asc(Mid(strBuffer, 3, 1))
    strBuffer = Mid(strBuffer, 4)
End Function

'//This removed a DWORD, but insted of returng it's integer value
'//this function returns its ASCII value. This would most commenly
'//be used for extracting the Product ID's/Platform ID's
'//Witch are infact, DWORDS, but look like strings.
Public Function rNonNTString() As String
    rNonNTString = Left(strBuffer, 4)
    strBuffer = Mid(strBuffer, 5)
End Function

Public Function rATString() As String
    On Error Resume Next
    rATString = Left(strBuffer, InStr(strBuffer, Chr(&HA)) - 1)
    strBuffer = Mid(strBuffer, Len(rATString) + 2)
End Function

Public Function rNTString() As String
    On Error Resume Next
    rNTString = Left(strBuffer, InStr(strBuffer, Chr(&H0)) - 1)
    strBuffer = Mid(strBuffer, Len(rNTString) + 2)
End Function

Public Function rDWORD() As Long
    Dim lReturn As Long, strTMP As String
    strTMP = Left(strBuffer, 4)
    Call CopyMemory(lReturn, ByVal strTMP, 4)
    rDWORD = lReturn
    strBuffer = Mid(strBuffer, 5)
End Function

Public Function rWORD() As Long
    Dim lReturn As Long, strTMP As String
    strTMP = Left(strBuffer, 2)
    Call CopyMemory(lReturn, ByVal strTMP, 2)
    rWORD = lReturn
    strBuffer = Mid(strBuffer, 3)
End Function

Public Function rBYTE() As Byte
    rBYTE = Asc(Left(strBuffer, 1))
    strBuffer = Mid(strBuffer, 2)
End Function
Public Function rVOID(Leng As Integer) As String
    If Len(strBuffer) < Leng Then Leng = Len(strBuffer)
    rVOID = Left(strBuffer, Leng)
    strBuffer = Mid(strBuffer, Leng + 1)
End Function


I have a 'better' one it's a straight buffer class. having the functionality of both a buffer and debuffer class.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status