• Welcome to Valhalla Legends Archive.
 

BNLS 0x09 Won't Respond to Me

Started by R.a.B.B.i.T, December 06, 2004, 08:52 PM

Previous topic - Next topic

R.a.B.B.i.T

For a while now I have been unable to get a response from BNLS (or JBLS, for that matter) from 0x09.  I have checked my code time and again, but I don't see anything wrong with it (below).  Anyone know why this might be happening?

    MPQName = Mid(szData, 25, 12)
    MPQNumber = Val(Mid(MPQName, 8, 1))
    InsertDWORD GetBNLSByte()
    InsertDWORD CLng(MPQNumber)
    InsertNTString HashVals
    SendPacket BNLS, &H9

The-FooL

Thats the right info to send, check for dumb things such as if the packet is actually sent, or if there is information in the variables.

Mephisto

Paste packet log please; not a lot we can do without it.

R.a.B.B.i.T

Quote15  192.168.***.***:2312  63.241.83.109:6112  1  Send 
0000  01                                                 .

16  192.168.***.***:2312  63.241.83.109:6112  58  Send 
0000  FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 45 53    .P:.....68XIPXES
0010  C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0020  00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69 74    ........USA.Unit
0030  65 64 20 53 74 61 74 65 73 00                      ed States.

17  192.168.***.***:2312  63.241.83.109:6112  8  Send 
0000  FF 25 08 00 00 00 00 00                            .%......

18  63.241.83.109:6112  192.168.***.***:2312  107  Recv 
0000  FF 25 08 00 1C 1C 2F 57 FF 50 63 00 00 00 00 00    .%..../W.Pc.....
0010  93 13 1A A4 5E 9B 12 00 00 A0 99 7D 91 E7 C3 01    ....^......}....
0020  49 58 38 36 76 65 72 34 2E 6D 70 71 00 41 3D 36    IX86ver4.mpq.A=6
0030  30 37 31 30 33 35 36 35 20 42 3D 38 39 32 37 34    07103565 B=89274
0040  30 39 33 39 20 43 3D 31 34 36 33 36 35 30 32 35    0939 C=146365025
0050  20 34 20 41 3D 41 2B 53 20 42 3D 42 2B 43 20 43     4 A=A+S B=B+C C
0060  3D 43 2B 41 20 41 3D 41 2B 42 00                   =C+A A=A+B.

19  192.168.***.***:2311  63.161.183.202:9367  74  Send 
0000  4A 00 09 02 00 00 00 04 00 00 00 41 3D 36 30 37    J..........A=607
0010  31 30 33 35 36 35 20 42 3D 38 39 32 37 34 30 39    103565 B=8927409
0020  33 39 20 43 3D 31 34 36 33 36 35 30 32 35 20 34    39 C=146365025 4
0030  20 41 3D 41 2B 53 20 42 3D 42 2B 43 20 43 3D 43     A=A+S B=B+C C=C
0040  2B 41 20 41 3D 41 2B 42 00 00                      +A A=A+B..

Newby

We're not concerned with your local IP eh?
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

UserLoser.

Quote from: R.a.B.B.i.T on December 06, 2004, 09:26 PM
19  192.168.***.***:2311  63.161.183.202:9367  74  Send 
0000  4A 00 09 02 00 00 00 04 00 00 00 41 3D 36 30 37    J..........A=607
0010  31 30 33 35 36 35 20 42 3D 38 39 32 37 34 30 39    103565 B=8927409
0020  33 39 20 43 3D 31 34 36 33 36 35 30 32 35 20 34    39 C=146365025 4
0030  20 41 3D 41 2B 53 20 42 3D 42 2B 43 20 43 3D 43     A=A+S B=B+C C=C
0040  2B 41 20 41 3D 41 2B 42 00 00                      +A A=A+B..
Quote

You're supplying an extra-unneeded byte at the end

Cyberpenguin

Quote from: R.a.B.B.i.T on December 06, 2004, 08:52 PM
For a while now I have been unable to get a response from BNLS (or JBLS, for that matter) from 0x09.  I have checked my code time and again, but I don't see anything wrong with it (below).  Anyone know why this might be happening?

    MPQName = Mid(szData, 25, 12)
    MPQNumber = Val(Mid(MPQName, 8, 1))
    InsertDWORD GetBNLSByte()
    InsertDWORD CLng(MPQNumber)
    InsertNTString HashVals
    SendPacket BNLS, &H9


hmm
With PBuffer
                    .InsertDWORD GetBNLSByte()
                    .InsertDWORD CLng(Val(Mid(Mid(data, 25, 12), 8, 1)))
                    .InsertNTString Mid(data, 38, Len(data) - 2)
                    .SendBNLSPacket &H9
                End With

UserLoser.

#7
Quote from: Cyberpenguin on December 06, 2004, 10:43 PM
Quote from: R.a.B.B.i.T on December 06, 2004, 08:52 PM
For a while now I have been unable to get a response from BNLS (or JBLS, for that matter) from 0x09.  I have checked my code time and again, but I don't see anything wrong with it (below).  Anyone know why this might be happening?

    MPQName = Mid(szData, 25, 12)
    MPQNumber = Val(Mid(MPQName, 8, 1))
    InsertDWORD GetBNLSByte()
    InsertDWORD CLng(MPQNumber)
    InsertNTString HashVals
    SendPacket BNLS, &H9


hmm
With PBuffer
                    .InsertDWORD GetBNLSByte()
                    .InsertDWORD CLng(Val(Mid(Mid(data, 25, 12), 8, 1)))
                    .InsertNTString Mid(data, 38, Len(data) - 2)
                    .SendBNLSPacket &H9
                End With


What happens if the server requires the use of an MPQ with a name such as "IX86versioning1.mpq"?  Your code will no longer work and probably break.  That's a bad way to do things (hardcoding values which may change)

Cyberpenguin

i only login with D2Lod/classic, and it hasent "broken" for me once. But if you would like to post a suggestion, i would be glad to hear it. This is just the way ive always done it, ive never had problems so i dont see any need to change it :P

Zakath

Consider the way I do it, which makes no assumptions about the length of the strings:

strcpy( MPQName, (LPTSTR)(data + 24));
strcpy( ChecksumFormula, (LPTSTR)(data + strlen(MPQName) + 25));


Not only will it not break if the MPQ archive has a different sort of name, it also is shorter and cleaner.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Kp

Quote from: Zakath on December 07, 2004, 12:59 AM
Consider the way I do it, which makes no assumptions about the length of the strings:

strcpy( MPQName, (LPTSTR)(data + 24));
strcpy( ChecksumFormula, (LPTSTR)(data + strlen(MPQName) + 25));


Not only will it not break if the MPQ archive has a different sort of name, it also is shorter and cleaner.

What happens when BNCS sends you an extremely long MPQname?  IIRC, real clients allow some absurd length like 256 just for the MPQname field.  From your code, it's hard to tell if you're doing any validation on the string length.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Zakath

I have space buffered up (not shown, above what I pasted).
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

R.a.B.B.i.T

Thanks for the info, removing the extra byte gets me a response, but troubles are further down the line :\