• Welcome to Valhalla Legends Archive.
 

Seems as if Bnet's up to it again

Started by IdIm, September 12, 2006, 02:34 PM

Previous topic - Next topic
|

Joe[x86]

#75
Seeing as how you're all confused beyond belief (except MyndFyre -- apparently he's got it), don't rely on your library to extract the MPQ number for you. It's so ridiculously easy to do that you should be able to program your own method for it with your eyes blindfolded and your hands tied behind your back, as well as having your toes chopped off. For those who aren't as good at typing with their nose, here you go:

'---------------------------------------------------------------------------------------
' Procedure : ExtractMPQNumber
' Author    : Joe[x86]
' Purpose   : Allows extraction of the MPQ number from both types of CheckRevision
'               MPQ filenames, as of 9/14/06.
'---------------------------------------------------------------------------------------
'
Public Function ExtractMPQNumber(s As String) As Integer
    ' Note that there are now two name formats for MPQs:
    'IX86ver1.mpq
    'ver-IX86-1.mpq
   
    ' First, handle the old type:
    If Left(s, 4) = "IX86" Then
        ExtractMPQNumber = Asc(Mid(s, 8)) - &H30
    ElseIf Left(s, 3) = "ver" Then
    ' Handle the new type:
        ExtractMPQNumber = Asc(Mid(s, 10)) - &H30
    Else
    ' Future stunts blizzard pulls
        ExtractMPQNumber = -1
    End If
End Function


Untested, but it compiles. Hold on a bit, I'm going to try it out now.

EDIT -
After using an ugly method of converting a single-byte string representing a number into an integer, I've fixed a type mismatch and tested it using both a variable MPQ name sent from Battle.net as well as a hardcoded old-style name. It worked with both. Also, Debug.Print (ExtractMPQNumber("booblah1lollol")) produced the resired desult of -1.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Rob

For those of you using bnetauth which accepts the filename and not the number this is the easiest fix for your bot

MPQName = Mid(data, InStr(LCase(data), "mpq") - 2, 5)
ServerHash = Mid(data, InStr(data, "mpq") + 4, Len(data) - 2)

This will work no matter which of the 2 current formats is used

for those of you using a library that accepts a number, or BNLS

MPQNum = CLng(Mid(MPQName, 1, 1))

I have also verified that my update to bnetauth.dll is still functional
Rob@USEast

Joe[x86]

I swear you people who don't use debuffers are going to give me a fucking stroke. :P

            sMPQ = debuff.RemoveNTString            ' MPQ filename
            sFormula = debuff.RemoveNTString        ' Checksum Formula
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

MyndFyre

Quote from: Joex86] link=topic=15671.msg158007#msg158007 date=1158269355]
I swear you people who don't use debuffers are going to give me a fucking stroke. :P

            sMPQ = debuff.RemoveNTString            ' MPQ filename
            sFormula = debuff.RemoveNTString        ' Checksum Formula

Agreed.  Now if we can just get you people who call them "debuffers" to stop sounding like jackasses, we can get something done.  :P
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.

Joe[x86]

Are you at work at the moment? If not, get on AIM. :).
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Ersan

Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

I'm not relying on my library to extract an MPQ number, and I don't think anyone is... There was a second change that b.net made on this update, they use 64-bit integers for A, B, and C for checkrevision - BNCSUtil (and BNLS prior to skywing's post) uses 32-bit variables for these numbers and thus it doesn't work.

Joe[x86]

Quote from: Ersan on September 14, 2006, 05:53 PM
Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

I'm not relying on my library to extract an MPQ number, and I don't think anyone is... There was a second change that b.net made on this update, they use 64-bit integers for A, B, and C for checkrevision - BNCSUtil (and BNLS prior to skywing's post) uses 32-bit variables for these numbers and thus it doesn't work.

I know. Use K (or Kp, who knows?) recompiled it.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Spilled

Quote from: Ersan on September 14, 2006, 05:53 PM
Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

lmao.

MyndFyre

Quote from: Ersan on September 14, 2006, 05:53 PM
Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

I'm not relying on my library to extract an MPQ number, and I don't think anyone is... There was a second change that b.net made on this update, they use 64-bit integers for A, B, and C for checkrevision - BNCSUtil (and BNLS prior to skywing's post) uses 32-bit variables for these numbers and thus it doesn't work.
I'm not 100% sure they're using 64-bit integers; converting to 32-bit unsigned integers worked for me in tests.

As to get-the-number-to-the-left-of-the-dot method, who's to say they're not going to start with ver-1-IX86.mpq?  So before you discount Joe too much, give him a break.
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.

Hdx

#84
Quote from: Ersan on September 13, 2006, 09:50 PMBNCSUtil seems to have the same problem?
Confermed, over all clients.

Quoteanyways, it seems that HDX fixed his password hash problem, but forgot wc3
Ya, I fixed 0x0B BNLS_HASHDATA last night, just a little data type conversion misshap. And could you please explain what you mean by 'but forgot wc3'.
And please submit a packet log of your connection to JBLS when you encounter the error.
Supplying me with the data to reproduce the error will help with fixing it.

Also! All of you who are dismissing useing an external library to grab the dll number.
Let me give you an example case:
Stealthbot, Manually grabbed the digit itself.
Blizzard changed the format.
We now have to recompile the closed source application itself, and the only one who can do that is Stealth himself.
But if he had used BNCSutil we could of jsut updated the dll and there would be no need for a new exe!

meh oh well. I like modular programs.
~-~(HDX)~-~

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

vuther.de

Quote from: rob on September 14, 2006, 04:26 PM
For those of you using bnetauth which accepts the filename and not the number this is the easiest fix for your bot

MPQName = Mid(data, InStr(LCase(data), "mpq") - 2, 5)
ServerHash = Mid(data, InStr(data, "mpq") + 4, Len(data) - 2)

This will work no matter which of the 2 current formats is used

for those of you using a library that accepts a number, or BNLS

MPQNum = CLng(Mid(MPQName, 1, 1))

I have also verified that my update to bnetauth.dll is still functional
Thanks. I appreciate it.

Yegg

Quote from: MyndFyre[vL] on September 14, 2006, 06:18 PM
Quote from: Ersan on September 14, 2006, 05:53 PM
Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

I'm not relying on my library to extract an MPQ number, and I don't think anyone is... There was a second change that b.net made on this update, they use 64-bit integers for A, B, and C for checkrevision - BNCSUtil (and BNLS prior to skywing's post) uses 32-bit variables for these numbers and thus it doesn't work.
I'm not 100% sure they're using 64-bit integers; converting to 32-bit unsigned integers worked for me in tests.

As to get-the-number-to-the-left-of-the-dot method, who's to say they're not going to start with ver-1-IX86.mpq?  So before you discount Joe too much, give him a break.

So the best method was to remove the 'ix86', loop through the string and return whatever digit is found. Atleast, this idea sounds practical to me. Or is there a better method?

MyndFyre

Quote from: Yegg on September 14, 2006, 06:53 PM
Quote from: MyndFyre[vL] on September 14, 2006, 06:18 PM
Quote from: Ersan on September 14, 2006, 05:53 PM
Joe what the hell, nobody's talking about your 26 line code to parse a damn string, I like Eric's get-the-number-to-the-left-of-the-dot method.

I'm not relying on my library to extract an MPQ number, and I don't think anyone is... There was a second change that b.net made on this update, they use 64-bit integers for A, B, and C for checkrevision - BNCSUtil (and BNLS prior to skywing's post) uses 32-bit variables for these numbers and thus it doesn't work.
I'm not 100% sure they're using 64-bit integers; converting to 32-bit unsigned integers worked for me in tests.

As to get-the-number-to-the-left-of-the-dot method, who's to say they're not going to start with ver-1-IX86.mpq?  So before you discount Joe too much, give him a break.

So the best method was to remove the 'ix86', loop through the string and return whatever digit is found. Atleast, this idea sounds practical to me. Or is there a better method?
That sounds like the most practical to me at this point.
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.

Fr3DBr

lol you guys want only to get the number ?

Yegg

Quote from: Fr3DBr on September 14, 2006, 07:12 PM
lol you guys want only to get the number ?

Is there a problem with that?

|