• Welcome to Valhalla Legends Archive.
 

BNLS_VERSIONCHECKEX, BNLS_VERSIONCHECKEX2: What's the difference?

Started by Don Cullen, February 12, 2007, 01:21 PM

Previous topic - Next topic

Don Cullen

I'm working on moving from local hashing towards BNLS. I was coding the 0x51 local hashing to BNLS substitute, when I ran across something that confused me.

The BNLS documentation said I should use BNLS_CDKEY and BNLS_VERSIONCHECK.

So I went to BNETDocs and searched for BNLS_VERSIONCHECK. I saw that there was no packet by that exact name, but two with similar names. So I assumed that those were the new packets to use.

Those packets were:

BNLS_VERSIONCHECKEX
BNLS_VERSIONCHECKEX2

I've been looking at each packet, and only saw slight differences. So what's the difference between those two in regards for purposes?

Also, for BNLS_VERSIONCHECKEX2, you'll see this:

Quote(DWORD) Product ID.*
(DWORD) Flags.**
(DWORD) Cookie.
(ULONGLONG) Timestamp for version check archive.
(STRING) Version check archive filename.
(STRING) Checksum formula.

What exactly is ULONGLONG?

Thanks in advance for any assistance given. :-)
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.


Barabajagal

Easiest way to do it is using the FILETIME struct which is two Long values. it's basically two DWords (A QWord, I think?). Just remember not to flip the high and low values.

UserLoser

IIRC, BNLS treats the number as an unsigned 64-bit integer, so you should handle it accordingly

Barabajagal


Private Sub BNLS_Send_VERSIONCHECKEX2()
Dim Client As Long
    On Error GoTo Erred
    Client = GetLSClient(Config.Game, Config.BNLS.Host)
    If Client = 0 Then
        RaiseEvent ConnectionError("BNLS does not support " & GameToName(Config.Game) & ".")
        Checksum = -1
        Exit Sub
    End If
    Packet.InsertDWORD Client
    Packet.InsertDWORD &H0
    Packet.InsertDWORD &H1
    Packet.InsertDWORD MPQTime.dwLowDateTime
    Packet.InsertDWORD MPQTime.dwHighDateTime
    Packet.InsertNTString mpqName
    Packet.InsertNTString CRevRequest
    wsBNLS.SendData Packet.SendBNLSPacket(BNLS_VERSIONCHECKEX2)
Exit Sub
Erred:
    RaiseEvent CritError(Err.Description, Err.Number, Err.Source, "BNLS_Send_VERSIONCHECKEX2")
End Sub

Works fine for me. One DWord = Unsigned 32 bit integer. Two DWords = Unsigned 64 bit integer.

Don Cullen

Alright, but what's the difference between those two packets?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Barabajagal


Don Cullen

So it'd be better to use EX2 for all game clients? Or are there certain game clients that I must use EX with?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Barabajagal

everything works with ex2. well, right now war3 doesn't work on bnls... but it does with jbls, so ya.

Hdx

EX was made when BNet changed to a diffrent CRev function.
EX2 was made cuz Bnet made some MORE changes, and it pissed off Sky.
So he was like 'Screw it I'll just have everyone send me EVERYTHING they have'
Basically you are providing BNLS with everything from 0x50 S->C
So use EX2.
All CRev functions are supported by all of BNLS's packets.
Its jsut a matter of which one to use.
Just use EX2 it works for all games (save WC3 on the real BNLS)
And it *should* continue to work for all future mods Bnet makes.

~-~(HDX)~-~

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

Don Cullen

Think there're any plans on implementing WAR3 BNLS for EX2?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Hdx

its already implmented.
Its just the new patch for wc3 effed over bnls's opatching program.
So the following servers return invalid results:
bnls.valhallalegends.com   
63.161.183.91   
63.161.183.200   
63.161.183.201   
63.161.183.202   
63.161.183.203   
63.161.183.206   
63.161.183.207   
63.161.183.208   

Whereis jbls.org and hdx.jbls.org are fine, but they dont support lockdown. So wc2/sc dont work on those servers.
~-~(HDX)~-~

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

brew

To be honest, why would anyone waste their time setting up a filetime strut? The simpler the better, and I would go with the BNLS 0x09 (not sure what it's official name is) which is nothing more then what you acually NEED from bnls. My method involves sandwiching a connection to bnls and sending the 0x09 in between the S > C 0x50 and the C > S 0x51, like so:
    {
        1. Receive 0x50.
        2. Connect to BNLS.
        3. On BNLS connect, send the 0x09.
        4. On data arrival, parse the 0x09.
        5. On parse 0x09, the BNLS winsock is closed and the values of checksum, exeinfo, and exeversion are passed to Send0x51.
        6. Send0x51 is sent to Battle.net.
    }

So, in VB6 it's like:
Public Sub BNLSSend0x09()
    Dim Buf$
    Dim i As Long
    Select Case Client
        Case "STAR": i = 1
        Case "SEXP": i = 2
        Case "W2BN": i = 3
    End Select
    Buf = pbuffer.MakeDWORD(i) & pbuffer.MakeDWORD(mpqNumber) & ChecksumFormula
    frmMain.BNLSWS.SendData pbuffer.MakeWORD(Len(Buf) + 3) & Chr(&H9) & Buf
    AddChat vbYellow, "[BNLS] Sending 0x09..."
End Sub

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 Checksum, EXEVersion, EXEInfo
End Sub

And another thing: The 0x09 works with all clients.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

l2k-Shadow

However 0x09 only supports the digit of the library name... Therefore if Battle.net patched the library to not use digits, or patched lockdown libraries but kept the same name, you would have neither the file name nor the filetime of when the file was last updated to send to BNLS, therefore BNLS would hash your request with the files that it currently has, resulting in a wrong result.
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.

brew

<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P