Valhalla Legends Forums Archive | Battle.net Bot Development | Re: Insults

AuthorMessageTime
BreW
Allright sounds cool
its sad how immature some people could be though -_-
Especially on the "why is bnls down" topic I started in general
Anyways speaking of which, my bot is doing it again (disconnecting on send packet)
If there's anything wrong please tell me although I highly doubt it's my code....
[code]
Public Sub BNLSSend0x09()
    Dim buf$
    buf = pbuffer.MakeDWORD(GetClient(Client)) & pbuffer.MakeDWORD(mpqNumber) & ChecksumFormula
    SendBNLS buf, &H9
End Sub

Public Sub BNLSSend0x1A()
    Dim buff$
    buff = pbuffer.MakeDWORD(GetClient(Client)) & pbuffer.MakeDWORD(0) & pbuffer.MakeDWORD(&H3713) & Filetime & mpqName & ChecksumFormula
    SendBNLS buff, &H1A
End Sub

Public Sub SendBNLS(Buffer As String, PacketID As Byte)
    frmMain.BNLSWS.SendData pbuffer.MakeWORD(Len(Buffer) + 3) & Chr(PacketID) & Buffer
    AddChat vbYellow, "[BNLS] Sending 0x" & Hex(PacketID) & "..."
End Sub
[/code]
February 18, 2007, 8:10 PM
Spht
[quote author=BreW link=topic=16346.msg165112#msg165112 date=1171829402]
its sad how immature some people could be though -_-
Especially on the "why is bnls down" topic I started in general
[/quote]

Careful
February 18, 2007, 8:23 PM
BreW
sorry man
February 18, 2007, 8:24 PM
LockesRabb
Got a packet log?

Edit: I just looked at your code and examined them -- all three subs are fine.

Your bot of course should be outputting debug information/logs, so could you paste the debug info here? This way we can see where your bot failed. Packet logs of where exactly it failed would also help.

On a side note, it's not BNLS; I tested BNLS with my bot. It connected and processed packets with no problem. So the problem must be somewhere in your code...
February 18, 2007, 8:30 PM
BreW
[quote author=Kyro link=topic=16346.msg165121#msg165121 date=1171830617]
[quote author=BreW link=topic=16344.msg165112#msg165112 date=1171829402]its sad how immature some people could be though -_-[/quote]

Ease up. The same can be said for you. While I understand that provocation was the case here, as I have said several times before; if someone annoys you, make no mention of it and ignore it. If you feel the need, PM one of the moderators. By focusing on the annoyance, you become an annoyance yourself since you'll be disrupting the forums just as much as the others are. This is why you're having problems; you're an easy target to annoy. So don't let yourself get annoyed so easily, and disregard any annoyances. Recommendation, just take the advice, and focus on your BNLS problem rather than talking about annoyances. :)

Secondly, as for your BNLS problem; got a packet log?
[/quote]

Uhhh sure h/o anyways I originally made this post in the "insults" topic and it got moved

Allright heres the packetlog-
I send to bnls.....
[code]
1C 00 09 00 00 00 00 11 00 00 00 75 D6 47 8D 23  ...........u.G.#
15 AD 51 DB A6 6C 01 ED 99 02 BE 00              ..Q..l......   
[/code]

And i get back from bnls.....

[code]

[/code]

nothing! It disconnects me after that. Heres a packetlog of me using the 0x1a instead:
Weird, i send this before or while (not sure) attempting to create a connection
[code]
02 04 05 B4 01 01 04 02                          ........     
[/code]

then i get sent back

[code]
02 04 05 AC 01 01 04 02                          ........   
[/code]

here's the acual packet I send to bnls
[code]
3C 00 1A 00 00 00 00 00 00 00 00 13 37 00 00 00  <...........7...
60 95 D7 72 FC C6 01 6C 6F 63 6B 64 6F 77 6E 2D  `..r...lockdown-
49 58 38 36 2D 31 32 2E 6D 70 71 47 1E 1A 0F F6  IX86-12.mpqG....
70 A0 6B B4 DC 5F 2E 96 1F 6F 9C 00              p.k.._...o..   
[/code]

It disconnects me after that :(
Also i've noticed bnet sends ME a weird TCP packet when I send the 0x50 & 0x25...
[code]
05 00 00 00 74 65 6E 62                          ....tenb   
[/code]
February 18, 2007, 8:39 PM
LockesRabb
Can you post your DataArrival event? What about the parser? Don't need to post the whole parser, just the header part for the part. Also what are you using for a packet debuffer?

For example (posting partial parser):

[code]Public Sub ParseBNLSPacket(ByVal PacketData As String)
    Dim PacketID As Byte
    Dim PacketLen As Long
    Dim Results As Boolean
    PktDeBuf.SetData (PacketData)
    PacketLen = PktDeBuf.rWORD()
    PacketID = PktDeBuf.rBYTE()
    RaiseEvent DebugOutput("Received Packet: 0x" & Hex$(PacketID) & " (" & GetBNLSPacketName(PacketID) & ")")
    Select Case PacketID[/code]

So what does your parser header look like?

[Edit] BreW, might want to change the title of the thread to a better one to grab more attention so more people will help.
February 18, 2007, 8:48 PM
BreW
I don't get any data back TO parse... that's the problem heh Anyways if I do get it here's my code for it:

[code]
Private Sub BNLSWS_DataArrival(ByVal bytesTotal As Long)
    Dim Data As String
    AddChat vbGreen, "[BNLS] Recieved 0x09!"
    BNLSWS.GetData Data
    AddChat vbGreen, StrToHex(Data)
    BNLSParse0x09 Data
    BNLSWS.Close
End Sub
[/code]

[code]
Public Sub BNLSParse0x09(Data As String)
    EXEVersion = pbuffer.GetDWORD(Mid(Data, 8, 4))
    Checksum = pbuffer.GetDWORD(Mid(Data, 12, 4))
    EXEInfo = KillNull(Mid$(Data, 16))
    frmMain.BNLSWS.Close
    Send0x51
End Sub
[/code]

Edit* lol i just noticed i close it twice -.- oh well haha, just to be safe i guess
February 18, 2007, 8:50 PM
LockesRabb
BNLS automatically disconnects when they get no further packets from you. BNLS also automatically disconnects if they get an invalid packet. So either one of those is the case.

But the real problem here is your DataArrival sub. Your sub isn't waiting until the end of a packet before parsing it.

[Edit]

I have a few recommendations for you. Get a packet buffer class and a packet debuffer class. Fix your DataArrival sub so it waits until the end of a packet before sending the packet along to your parser. And your parser shouldn't handle only one packet, it should be coded so it can handle more than one packet.

If you like, I can provide you with links to a packet buffer class by either DarkMinion or Hdx, and also a packet debuffer class by Hdx. Both classes were released into the public domain, AFAIK. I currently use DarkMinion's for packet buffering, and Hdx's for packet debuffering.
February 18, 2007, 8:56 PM
MysT_DooM
[quote author=BreW link=topic=16346.msg165122#msg165122 date=1171831153]

Also i've noticed bnet sends ME a weird TCP packet when I send the 0x50 & 0x25...
[code]
05 00 00 00 74 65 6E 62                          ....tenb   
[/code]
[/quote]

that deals with the games udp ports, use the search button if you want more info on it
February 18, 2007, 9:05 PM
LockesRabb
[quote author=MysT_DooM link=topic=16346.msg165126#msg165126 date=1171832700]
[quote author=BreW link=topic=16346.msg165122#msg165122 date=1171831153]

Also i've noticed bnet sends ME a weird TCP packet when I send the 0x50 & 0x25...
[code]
05 00 00 00 74 65 6E 62                          ....tenb   
[/code]
[/quote]

that deals with the games udp ports, use the search button if you want more info on it
[/quote]

That deals with this: http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=31

It can be safely ignored. Worst that happens is your bot will get a lag plug icon.

Don't worry about that yet. Just focus on getting your BNLS working.
February 18, 2007, 9:10 PM
rabbit
Giving logs with the packet headers would help a lot more.

[edit]
.....your mother.
February 18, 2007, 9:31 PM
BreW
Noooo guys, I was going to point it out but i thought it was obvious enough. First of all it should begin with the header, of an 0xFF, 0x14, then the packet length. Second, it's a TCP packet. Notice how it's a "UDP" ping response. Then third, you are supposed to only get that AFTER you pass the 0x51 (we're talking way before that). And kyro, I know for SURE it's not my coding because it worked with the same exact code two, three days ago. Yesterday I heard that BNLS had an error where it would treat all users as ipbanned. Spht was supposed to have fixed this. Also notice how I don't have a packetbuffer/debuffer class for BNLS at all. It's only because I send ONE packet, and nothing more. The only reason why I split the send bnls function into a different sub is because I thought I'd try sending an 0x1a instead of the 0x09, like everyone bugs me about constantly. And maybe BNLS had the 0x09 packet disabled. I have no idea. But, trust me people have been having problems with this since yesterday, and all of a sudden it started working last night and this morning, then supposedly it "broke" again. Hope this clears it up. What I really want to know is what's wrong with BNLS? I'm just about to switch to a checkrevision catche function.
February 18, 2007, 9:33 PM
Barabajagal
Try using JBLS and see if that works?
February 18, 2007, 10:00 PM
BreW
JBLS acually works with the lockdown mpqs? Since when? Damn you, hdx. Stop holding out on us like that -.-
February 18, 2007, 10:05 PM
LockesRabb
[quote author=rabbit link=topic=16346.msg165129#msg165129 date=1171834301]
Giving logs with the packet headers would help a lot more.

[edit]
.....your mother.
[/quote]

Ease up, rabbit. Spht says the ultimatium applies to everyone including me, you, and BreW.

[quote author=BreW link=topic=16346.msg165130#msg165130 date=1171834402]
Noooo guys, I was going to point it out but i thought it was obvious enough. First of all it should begin with the header, of an 0xFF, 0x14, then the packet length. Second, it's a TCP packet. Notice how it's a "UDP" ping response. Then third, you are supposed to only get that AFTER you pass the 0x51 (we're talking way before that). And kyro, I know for SURE it's not my coding because it worked with the same exact code two, three days ago. Yesterday I heard that BNLS had an error where it would treat all users as ipbanned. Spht was supposed to have fixed this. Also notice how I don't have a packetbuffer/debuffer class for BNLS at all. It's only because I send ONE packet, and nothing more. The only reason why I split the send bnls function into a different sub is because I thought I'd try sending an 0x1a instead of the 0x09, like everyone bugs me about constantly. And maybe BNLS had the 0x09 packet disabled. I have no idea. But, trust me people have been having problems with this since yesterday, and all of a sudden it started working last night and this morning, then supposedly it "broke" again. Hope this clears it up. What I really want to know is what's wrong with BNLS? I'm just about to switch to a checkrevision catche function.[/quote]

There's nothing wrong with BNLS. It's your DataArrival code.

Just use this for your BNLS socket DataArrival:

[code]Private Sub BNLSWS_DataArrival(ByVal bytesTotal As Long)
    Static PktBuff As String 'Packet Buffer
    Dim Incoming As String
    BNLSWS.GetData Incoming, vbString, bytesTotal
    PktBuff = PktBuff & Incoming
    Dim Pkt As BNCSPKT
    While Len(PktBuff) > 3
        Pkt.intPktLen = GetWord(Left$(PktBuff, 2))
        If Len(PktBuff) < Pkt.intPktLen Then Exit Sub
        ParseBNLSPacket (Left(PktBuff, Pkt.intPktLen))
        PktBuff = Mid(PktBuff, Pkt.intPktLen + 1)
    Wend
End Sub[/code]

Here's the additional code you'll need to be able to run the DataArrival code-- I think you'll know where to put them:

[code]Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)

'Type coded by Lord[nK]
Public Type BNCSPKT
    bytPktHdr  As Byte
    bytPktID  As Byte
    intPktLen  As Integer
    strPktData As String
End Type

Dim HashedKeyData(4) as Long

Public Function GetWord(Data As String) As Long
    Dim lReturn As Long
    Call CopyMemory(lReturn, ByVal Data, 2)
    GetWord = lReturn
End Function[/code]

For your BNLS Parser, you can use:

[code]Public Sub ParseBNLSPacket(ByVal PacketData As String)
    Dim PacketID As Byte
    Dim PacketLen As Long
    Dim Results As Boolean
    PktDeBuf.SetData (PacketData)
    PacketLen = PktDeBuf.rWORD() 'Get WORD using whatever method you're using
    PacketID = PktDeBuf.rBYTE() 'Get BYTE using whatever method you're using
    AddChat vbGreen, "Received Packet: 0x" & Hex$(PacketID)
    Select Case PacketID
        Case &H1    'BNLS_CDKEY
            Results = CBool(PktDeBuf.rDWORD)
            If Results = False Then
                AddChat vbRed, "BNLS reported failure with 0x01 (BNLS_CDKEY). Disconnecting."
                Disconnect
            End If
ClientToken = PktDeBuf.rDWORD 'Get DWORDs using whatever method you're using
            KeyLength = PktDeBuf.rDWORD
            CDKeyProdValue = PktDeBuf.rDWORD
            CDKeyPubValue = PktDeBuf.rDWORD
            Unknown = PktDeBuf.rDWORD
            HashedKeyData(0) = PktDeBuf.rDWORD
            HashedKeyData(1) = PktDeBuf.rDWORD
            HashedKeyData(2) = PktDeBuf.rDWORD
            HashedKeyData(3) = PktDeBuf.rDWORD
            HashedKeyData(4) = PktDeBuf.rDWORD
            Call BNLS_VERSIONCHECKEX2
    End Select
    PktDeBuf.ClearData        'Clear packet
    'finished parsing.
End Sub[/code]

Hope that solves your problem. I included the 0x01 BNLS_CDKEY packet in the parser so you'd have an idea of how to add packets to the parser, such as 0x1A or 0x09
February 18, 2007, 10:08 PM
BreW
It doesn't.... If it was then there'd be a few problems with that:
  1. I never even GET any data back, look at my packetlogs.
  2. It was working perfectly, literally 2 days ago.
  3. It was acually working last night, too.
  4. A popular chatbot that I use, called Alpha & Omega seemed to be having trouble connecting also.
  5. How would it be my DataArrival sub? The DataArrival event isn't even being raised first of all. (proven)
So skywing or yoni, care to explain ? Lol :/
February 18, 2007, 10:12 PM
LockesRabb
[quote author=BreW link=topic=16346.msg165134#msg165134 date=1171836729]
It doesn't.... If it was then there'd be a few problems with that:
  1. I never even GET any data back, look at my packetlogs.
  2. It was working perfectly, literally 2 days ago.
  3. It was acually working last night, too.
  4. A popular chatbot that I use, called Alpha & Omega seemed to be having trouble connecting also.
  5. How would it be my DataArrival sub? The DataArrival event isn't even being raised first of all. (proven)
So skywing or yoni, care to explain ? Lol :/
[/quote]

Sure. For one, I tested BNLS with my bot, with Stealth, and with Ruthless. I've experienced no problems.

For two, I've had other programmers confirm they were not having problems with BNLS.

For three, I've had two friends of mine who were not programmers use their own bots to test BNLS, again, they experienced no problems with BNLS.

I'll demonstrate with my bot (which I *just* coded); here's logs:

[quote][2:18:03 PM] Username set.
[2:18:03 PM] Password set.
[2:18:03 PM] GameCode set to SEXP.
[2:18:03 PM] CDKey set.
[2:18:03 PM] Default Home channel set to Op xDMx.
[2:18:03 PM] UseLagPlug set.
[2:18:07 PM] Connecting to BNLS...
[2:18:07 PM] Connected to BNLS.
[2:18:07 PM] Connecting to BNET...
[2:18:07 PM] Connected to BNET.
[2:18:07 PM] 0x01 SID_EmuByte sent.
[2:18:07 PM] 0x50 SID_AUTH_INFO packet sent.
[2:18:07 PM] Received Packet: 0x25 (SID_PING)
[2:18:07 PM] 0x25 SID_PING packet sent.
[2:18:07 PM] Received Packet: 0x50 (SID_AUTH_INFO)
[2:18:07 PM] 0x01 BNLS_CDKEY packet sent.
[2:18:07 PM] Received Packet: 0x1 (BNLS_CDKEY)
[2:18:07 PM] 0x1A BNLS_VERSIONCHECKEX2 packet sent.
[2:18:10 PM] Received Packet: 0x1A (BNLS_VERSIONCHECKEX2)
[2:18:10 PM] 0x51 SID_AUTH_CHECK packet sent.
[2:18:10 PM] Received Packet: 0x51 (SID_AUTH_CHECK)
[2:18:10 PM] 0x51 Response: Authentication information accepted.
[2:18:10 PM] 0x0B BNLS_HASHDATA packet sent.
[2:18:10 PM] Received Packet: 0x4C (SID_REQUIREDWORK)
[2:18:10 PM] 0x4C (SID_REQUIREDWORK) disregarded.
[2:18:10 PM] Received Packet: 0xB (BNLS_HASHDATA)
[2:18:10 PM] 0x3A SID_LOGONRESPONSE2 packet sent.
[2:18:10 PM] Received Packet: 0x3A (SID_LOGONRESPONSE2)
[2:18:10 PM] 0x3A Response: Successfully logged on Battle.net!
[2:18:10 PM] 0x14 SID_UDPPINGRESPONSE packet sent.
[2:18:10 PM] 0x0A SID_ENTERCHAT packet sent.
[2:18:10 PM] 0x0C SID_JOINCHANNEL packet sent.
[2:18:10 PM] Received Packet: 0xA (SID_ENTERCHAT)
[2:18:10 PM] Received Packet: 0xF (SID_CHATEVENT)
[2:18:10 PM] Received Packet: 0xF (SID_CHATEVENT)
[2:18:14 PM] Sockets closed.[/quote]

That was the debug log, this is the bnet chat window data:

[quote][2:18:07 PM] Connecting to Battle.net...
[2:18:07 PM] Connected to Battle.net.
[2:18:10 PM] Logged in.
[2:18:10 PM] Joined Channel Op xDMx.
[2:18:14 PM] Disconnected.[/quote]

Keep in mind, my bot is using pure BNLS; no local hashing, no BNCSUtil, no nothing. So if there was a problem with BNLS, my bot would break, period. And as clearly shown in the results from my testing two minutes ago, there's nothing wrong with BNLS.
February 18, 2007, 10:20 PM
BreW
Maybe I myself could be ipbanned from BNLS. Let me try reconnecting my router for a second.

EDIT** SOLVED

DAMMIT I feel like an idiot. It's all because I forgot an "Exit Function" before the error in my GetClient function. Someone please shoot me.

[code]
Public Function GetClient(Client As String) As Long
    On Error GoTo Err
    Select Case Client
        Case "STAR": GetClient = 1
        Case "SEXP": GetClient = 2
        Case "W2BN": GetClient = 3
        Case "D2DV": GetClient = 4
        Case "D2XP": GetClient = 5
        Case "JSTR": GetClient = 6
        Case "WAR3": GetClient = 7
        Case "W3XP": GetClient = 8
        Case Else: GetClient = 0
    End Select
    Exit Function <------ the line I forgot to put in :( BreW = Dumbass much? Yes.
Err:
    GetClient = 0
End Function
[/code]
Lol, I must've been drunk when I wrote this.

*sigh*

This is something I would have caught if I had only looked at my own packetlogs...
I feel like shit now. Putting you guys through so much trouble...
Topic is now... *locked* to prevent future flaming and/or namecalling -.-
February 18, 2007, 10:22 PM
Barabajagal
JBLS does not support Lockdown. It connects to BNLS if it doesn't have a result.
February 18, 2007, 10:36 PM
LockesRabb
It isn't locked. ;)

[Edit]

Strange. I got an email from vL saying Spht responded to this thread just now. I don't see it. Probably deleted his own post. I think I'm going to turn on 'include post in emails' option now, just so people can't take back what they said. :)
February 18, 2007, 10:48 PM
rabbit
[quote author=Kyro link=topic=16346.msg165133#msg165133 date=1171836518]
[quote author=rabbit link=topic=16346.msg165129#msg165129 date=1171834301]
Giving logs with the packet headers would help a lot more.

[edit]
.....your mother.
[/quote]

Ease up, rabbit. Spht says the ultimatium applies to everyone including me, you, and BreW.
[/quote]
I know.  Someone helping someone else here usually starts with
1. "You're an idiot, go away"
2. "Stop ripping code"
3. "Give more information"

I went with 3, and then I added in "your mother" as a bit of fun.
February 18, 2007, 10:54 PM
Spht
[quote author=Kyro link=topic=16346.msg165143#msg165143 date=1171838900]
It isn't locked. ;)

[Edit]

Strange. I got an email from vL saying Spht responded to this thread just now. I don't see it. Probably deleted his own post. I think I'm going to turn on 'include post in emails' option now, just so people can't take back what they said. :)
[/quote]

I was going to say that today BNLS has not been replying to some of my messages at times, but then I noticed that that's not related to the problem he had.
February 18, 2007, 10:55 PM
LockesRabb
[quote author=rabbit link=topic=16346.msg165145#msg165145 date=1171839252]
[quote author=Kyro link=topic=16346.msg165133#msg165133 date=1171836518]
[quote author=rabbit link=topic=16346.msg165129#msg165129 date=1171834301]
Giving logs with the packet headers would help a lot more.

[edit]
.....your mother.
[/quote]

Ease up, rabbit. Spht says the ultimatium applies to everyone including me, you, and BreW.
[/quote]
I know.  Someone helping someone else here usually starts with
1. "You're an idiot, go away"
2. "Stop ripping code"
3. "Give more information"

I went with 3, and then I added in "your mother" as a bit of fun.
[/quote]

Granted, but it could be viewed provocative and only serve to disrupt the thread, even if your intention was only to be playful.
February 18, 2007, 10:56 PM
LockesRabb
[quote author=Spht link=topic=16346.msg165146#msg165146 date=1171839310]
[quote author=Kyro link=topic=16346.msg165143#msg165143 date=1171838900]
It isn't locked. ;)

[Edit]

Strange. I got an email from vL saying Spht responded to this thread just now. I don't see it. Probably deleted his own post. I think I'm going to turn on 'include post in emails' option now, just so people can't take back what they said. :)
[/quote]

I was going to say that today BNLS has not been replying to some of my messages at times, but then I noticed that that's not related to the problem he had.[/quote]

Think BNLS is experiencing an overflow? In that case, they should consider de-centralizing and diverting the flow (as a way of traffic control). Or perhaps BNLS isn't completely debugged...

[Edit 2] Just realized this is a double post. I really need to pay more attention. I apologize.
February 18, 2007, 10:57 PM
BreW
Hold up! How'd this topic get un-locked? Oh well I'll leave it open this time -.-
February 18, 2007, 11:08 PM

Search