• Welcome to Valhalla Legends Archive.
 

Incorrect Format For Receiving 50

Started by CrAz3D, February 29, 2004, 11:13 PM

Previous topic - Next topic

CrAz3D

vb6, I find that the Revision Check is incorrect when using this for receiving x50


               servers = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))
               MPQName = Mid(Data, 25, 12)
               HASH = Mid(Data, 38, Len(Data) - 2)
               MPQName = Val(Mid(MPQName, 8, 1))
               InsertDWORD GetBNLSByte()
               InsertDWORD CLng(MPQName)
               InsertNTString HASH
       exeinfo = SPACE(256)
         If varProduct = "VD2D" Then
            Result = CheckRevision(varFiles & exeN & ".exe", varFiles & "bnclient.dll", varFiles & "d2client.dll", HASH, version, CheckSum, exeinfo, MPQName)
         Else
            Result = CheckRevision(varFiles & exeN & ".exe", varFiles & "storm.dll", varFiles & "battle.snp", HASH, version, CheckSum, exeinfo, MPQName)
         End If
   
   
   InsertDWORD GetTickCount()      'Client Token..
   InsertDWORD version 'Exe ver
   InsertDWORD CheckSum 'Exe hash
   If varProduct = "PX2D" Then
       InsertDWORD &H2 'key count
   Else
       InsertDWORD &H1 'key count
   End If
   InsertDWORD &H0 'False (Spawn)
   'InsertNonNTString cdkeyhash 'Key Hash
   InsertNTString varCDkey
   If varProduct = "PX2D" Or varProduct = "PX3W" Then
       'InsertNonNTString Cdkey2Hash 'second key hash
       InsertNTString varCDKey2
   End If
   InsertNTString exeinfo 'Exe info
   InsertNTString varUser 'Key Owner
   sendPacket &H51
   
       
           If exeinfo = SPACE(256) Then
               Clear
               AddChat vbRed, "BNET: Check Revision Failed"
               Form1.sckBNET.Close
               Exit Sub
           End If


Any help would be apreciated, yes I have searched already.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Eric

#1
Quote from: o.OV on February 29, 2004, 11:20 PM
Use BnetAuth.dll

BnetAuth.dll and CheckRevision.dll have the same CheckRevision functions.

Quote from: CrAz3D on February 29, 2004, 11:13 PM
vb6, I find that the Revision Check is incorrect when using this for receiving x50


               servers = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))
               MPQName = Mid(Data, 25, 12)
               HASH = Mid(Data, 38, Len(Data) - 2)
               MPQName = Val(Mid(MPQName, 8, 1))
               InsertDWORD GetBNLSByte()
               InsertDWORD CLng(MPQName)
               InsertNTString HASH
       exeinfo = SPACE(256)
         If varProduct = "VD2D" Then
            Result = CheckRevision(varFiles & exeN & ".exe", varFiles & "bnclient.dll", varFiles & "d2client.dll", HASH, version, CheckSum, exeinfo, MPQName)
         Else
            Result = CheckRevision(varFiles & exeN & ".exe", varFiles & "storm.dll", varFiles & "battle.snp", HASH, version, CheckSum, exeinfo, MPQName)
         End If
   
   
   InsertDWORD GetTickCount()      'Client Token..
   InsertDWORD version 'Exe ver
   InsertDWORD CheckSum 'Exe hash
   If varProduct = "PX2D" Then
       InsertDWORD &H2 'key count
   Else
       InsertDWORD &H1 'key count
   End If
   InsertDWORD &H0 'False (Spawn)
   'InsertNonNTString cdkeyhash 'Key Hash
   InsertNTString varCDkey
   If varProduct = "PX2D" Or varProduct = "PX3W" Then
       'InsertNonNTString Cdkey2Hash 'second key hash
       InsertNTString varCDKey2
   End If
   InsertNTString exeinfo 'Exe info
   InsertNTString varUser 'Key Owner
   sendPacket &H51
   
       
           If exeinfo = SPACE(256) Then
               Clear
               AddChat vbRed, "BNET: Check Revision Failed"
               Form1.sckBNET.Close
               Exit Sub
           End If


Any help would be apreciated, yes I have searched already.

By the looks of it, you're not decoding your CDKey (you have it commented out as a key hash) among a few other things.  Try comparing what you're sending to BnetDocs.

And as a tip: It looks like your PacketBuffer is in a module, it's much more RAM efficient and easier to use within a class module. Also, the "If exeinfo = SPACE(256) Then" part should be right after you check the executables (before the sending of 0x51) and the message should be something along the lines of "Hashes not found" or something of that sort; trying to connect without hashes will result in an IPBan.

o.OV

Quote from: LoRd[nK] on February 29, 2004, 11:32 PM
Quote from: o.OV on February 29, 2004, 11:20 PM
Use BnetAuth.dll

BnetAuth.dll and CheckRevision.dll have the same CheckRevision functions.
That is nice..
It was merely a suggestion to use a 2 in 1 dll.  :P

Add-On:

I'm beginning to think
craz3d and chr0nic are good friends.
If the facts don't fit the theory, change the facts. - Albert Einstein

CrAz3D

I don't know Chr0nic.
I'll go check about the decoding of the cdkey, thnx
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

UserLoser.

#4
Quote
servers = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))

There's a lot easier, better, and most likely faster method to get that using RtlMoveMemory (CopyMemory)

ChR0NiC

Quote from: o.OV on March 01, 2004, 12:57 AM
That is nice..
It was merely a suggestion to use a 2 in 1 dll.  :P

Add-On:

I'm beginning to think
craz3d and chr0nic are good friends.

Don't beat around the bush slut, come out and say it????

Sidoh

Quote from: o.OV on March 01, 2004, 12:57 AM
Quote from: LoRd[nK] on February 29, 2004, 11:32 PM
Quote from: o.OV on February 29, 2004, 11:20 PM
Use BnetAuth.dll

BnetAuth.dll and CheckRevision.dll have the same CheckRevision functions.
That is nice..
It was merely a suggestion to use a 2 in 1 dll.  :P

Add-On:

I'm beginning to think
craz3d and chr0nic are good friends.

Are you so godly?

o.OV

Quote from: UserLoser. on March 01, 2004, 08:05 PM
Quote
servers = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))

There's a lot easier, better, and most likely faster method to get that using RtlMoveMemory (CopyMemory)
Example please..

Quote from: Sidoh on March 01, 2004, 10:55 PM
Are you so godly?
I dunno.. Am I?
And I bet you know one of them.. or both even.. lol

Quote from: ChR0NiC on March 01, 2004, 10:45 PM
Don't beat around the bush slut, come out and say it????
BullsEye!! :D
If the facts don't fit the theory, change the facts. - Albert Einstein

Kp

Quote from: LoRd[nK] on February 29, 2004, 11:32 PMtrying to connect without hashes will result in an IPBan.

hmm, unless the code is very poorly written, connecting without the appropriate hash files would probably just send uninitialized variables for the version checksum data.  You'd get a version mismatch, but you wouldn't get IP banned.  Of course, bad code might entirely forget to insert the variables if the checkrevision failed, which would probably cause a ban as you say.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!