• Welcome to Valhalla Legends Archive.
 

MCP/0x34/No Connection Detected (Tass Sucks at Topics)

Started by Tass, November 22, 2005, 04:30 PM

Previous topic - Next topic

Tass

#15
[4:29:14 PM] Connecting..
[4:29:14 PM] Connected.
[4:29:15 PM] Checking version...
[4:29:15 PM] Passed Key/Version Check!
[4:29:15 PM] Sending login information...
[4:29:16 PM] Battle.net login accepted!
[4:29:16 PM] MCP: Connecting to 63.240.202.148...
[4:29:16 PM] MCP: Connected, sending startup!
[4:29:16 PM] MCP: No Battle.net connection detected

I keep getting no battle.net connection detected here's my code...


Private Sub Parse0x3A(Data As String)
Select Case PBuffer.GetDWORD(Mid$(Data, 5, 4))
   Case &H0 ' Login Accecpted
   AddC vbGreen, "Battle.net login accepted!"
    With PBuffer
      .InsertNonNTString "tenb"
      .SendPacket &H14
    End With
    If frmRegister.Visible <> True Then: SendABCs
   Case &H1 ' Account Doesn't Exist
      SendAccountCreation BNCS.Username, BNCS.Password
   Case &H2 ' Wrong Password
      AddC vbRed, "Invalid Password.": frmMain.sckBNCS_Close
End Select
End Sub

Public Sub SendABCs()
If LCase(GetStuff("Main", "RealmLogin")) = "t" Then
    PBuffer.SendPacket &H40
Else
With PBuffer
    .InsertNTString BNCS.Username
    .InsertBYTE &H0
    .SendPacket &HA
    .InsertDWORD &H2
    .InsertNTString BNCS.HomeChannel
    .SendPacket &HC
End With
End If
End Sub

Private Sub Parse0x40(Data As String)
MCP.Realm = Mid(Data, 17, 6)
Dim RealmHash As String
RealmHash = String(5 * 4, vbNullChar)
A2 RealmHash, ServerToken
With PBuffer
   .InsertDWORD &H1
   .InsertNonNTString RealmHash
   .InsertNTString MCP.Realm
   .SendPacket &H3E
End With
End Sub

Private Sub Parse0x3E(Data As String)
AddC vbrealm, Len(Data)
MCP.Chunk1 = Mid$(Data, 5, 16)
MCP.Ip = Mid$(Data, 21, 4)
MCP.Ip = PBuffer.ConvertToServer(MCP.Ip)
MCP.Port = Mid$(Data, 25, 4)
MCP.Chunk2 = Mid$(Data, 21, 48)
MCP.Unique = Mid(Data, 77, Len(Data) - 79)
frmMain.sckMCP.Connect MCP.Ip, 6112
AddC vbrealm, "MCP: Connecting to " & MCP.Ip & "..."
End Sub


[MF edit: added code tags]

MyndFyre

Well it looks like you're not checking your realm logon status inside Parse0x3e, you're just kind of assuming it's okay.
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.

Tass

I fixed this but I do not see how it would give me no connection to bnet error message in 0x01?

l2k-Shadow

Your port parsing is incorrect... it's a DWORD not a string as you are assuming in your code. However, you do not need to parse the port, since it will always be 6112, so you can just assume it being that.
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.

Tass

I'm not even using the port I'v pharsed incorrectly. Still, I have this problem, any suggestions anyone?

l2k-Shadow

In that case there is an error in your ConvertToServer() function. Perhaps show us that.
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.

Tass

Public Function ConvertToServer(Data As String) As String
ConvertToServer = CLng("&H" & ToHex(Mid$(Data, 1, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 2, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 3, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 4, 1)))
End Function

UserLoser.

Quote from: Tass on November 25, 2005, 05:39 PM
Public Function ConvertToServer(Data As String) As String
ConvertToServer = CLng("&H" & ToHex(Mid$(Data, 1, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 2, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 3, 1))) & "." & CLng("&H" & ToHex(Mid$(Data, 4, 1)))
End Function

wtf.  use inet_addr or inet_ntoa.. Or whatever that other thing is that Kp will say to use

Tass


Kp

Quote from: UserLoser on November 25, 2005, 05:41 PMwtf.  use inet_addr or inet_ntoa.. Or whatever that other thing is that Kp will say to use

inet_pton(3) / inet_ntop(3)

I'm tired of explaining why the other options are inferior.  Search for prior posts by me with those words if you want to see how wrong you are in continuing to use inet_addr.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Tass

everything I have found about inet_pton is in C++...

l2k-Shadow

inet_ functions are besides the point though, in your previous posts it looks like you do get connected to MCP but then the server closes connection.. perhaps you are sending your MCP 0x01 incorrectly?
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.

Tass

yes, I had my parse 0x3E wrong so when I send the data from 0x3e in packet 0x01 mCp. it was wrong so it woulden't let me connect >.<
Anyways about this inet stuff where can I find some info about it on vb6?

Ringo

Quote from: Tass on November 26, 2005, 11:34 AM
yes, I had my parse 0x3E wrong so when I send the data from 0x3e in packet 0x01 mCp. it was wrong so it woulden't let me connect >.<
Anyways about this inet stuff where can I find some info about it on vb6?

Public Declare Function htons Lib "ws2_32.dll" (ByVal hostshort As Integer) As Integer
Public Declare Function htonl Lib "ws2_32.dll" (ByVal hostlong As Long) As Long

Public Declare Function ntohl Lib "ws2_32.dll" (ByVal netlong As Long) As Long
Public Declare Function ntohs Lib "ws2_32.dll" (ByVal netshort As Integer) As Integer


Or you could do it your self by doing somthing like this:

CopyMemory MCP.Port, ByVal StrReverse(Mid$(Data, 25, 2)), 2
'or
MCP.Port = htons(GetWORD(Mid$(Data, 25, 2)))

And convert it back to a string with somthing like this:

Dim strBuf As String * 2
CopyMemory ByVal strBuf, 6112, 2
strBuf = StrReverse(strBuf)


Also, the realm is probly saying you dont have a active BNCS connection, because of the data chunks are wrong (thats what the problem was when i had that problem)

Hope this helps

Tass

Have the flags for each char in 0x17 MCP packet changed because I do not see them inside the packets I'm receiving.

Here's the packet log..

16  63.240.202.148  172.169.118.249  361  Recv 
0000  69 01 17 08 00 08 00 00 00 08 00 54 61 73 73 00    i..........Tass.
0010  84 80 3A 01 01 01 01 05 FF 4F 02 02 FF 02 FF F0    ..:......O......
0020  F0 F0 F0 FF FF 09 F0 F0 FF 11 C4 82 FF FF 03 FF    ................
0030  FF 00 54 61 73 73 69 6E 61 74 6F 72 00 84 80 3F    ..Tassinator...?
0040  02 02 02 02 FF FF 54 02 02 FF 02 25 ED ED ED ED    ......T....%....
0050  FF FF FF ED ED FF 17 E8 9A FF FF 03 FF FF 00 54    ...............T
0060  61 73 73 49 73 4E 6F 6F 62 00 84 80 FF FF FF FF    assIsNoob.......
0070  FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF    ................
0080  FF FF FF 01 E1 80 80 80 03 FF FF 00 52 75 69 73    ............Ruis
0090  6B 6F 00 84 80 3A 03 02 02 02 0E FF 54 02 02 FF    ko...:......T...
00A0  05 FF FF FF FF FF FF FF FF FF FF FF 0B C8 80 FF    ................
00B0  FF 03 FF FF 00 57 54 46 4D 61 74 65 00 84 80 FF    .....WTFMate....
00C0  FF FF FF FF FF FF FF FF FF FF 02 FF FF FF FF FF    ................
00D0  FF FF FF FF FF FF 01 C1 80 80 80 03 FF FF 00 54    ...............T
00E0  61 73 73 49 73 44 65 61 64 00 84 80 FF FF FF FF    assIsDead.......
00F0  FF FF FF FF FF FF FF 02 FF FF FF FF FF FF FF FF    ................
0100  FF FF FF 01 CC 80 FF FF 03 FF FF 00 4E 6F 6E 4C    ............NonL
0110  61 64 54 61 73 73 44 65 61 64 00 84 80 FF FF FF    adTassDead......
0120  FF FF FF FF FF FF FF FF 02 FF FF FF FF FF FF FF    ................
0130  FF FF FF FF 01 8C 80 FF FF FF FF FF 00 54 61 73    .............Tas
0140  73 4C 61 64 64 61 00 84 80 FF FF FF FF FF FF FF    sLadda..........
0150  FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF    ................
0160  01 E1 80 80 80 03 FF FF 00                         .........
                      .........

These are the flags that are posted on bnetdocs

'1. No Flags: 01 81 80 80 80
'2. Expansion: 01 A1 80 80 80
'3. Hardcore: 01 85 80 80 80
'4. Ladder: 01 C1 80 80 80 01
'5. Expansion & Ladder: 01 E1 80 80 80 01
'6. Hardcore & Expansion: 01 A5 80 80 80
'7. Hardcore & Ladder: 01 C5 80 80 80 01
'8. HardCore & Ladder & EXP: 01 E5 80 80 80 01

|