Ok, for my bot which i've setup to use TCP, im pretty sure everything is setup up CORRECTLY, but when i try to connect i get the Check Revision Failed error. Does ne1 know a common reason why this error is recerived, or is there a newer version of checkrevision.dll i should have?
Quote from: Yegg on October 26, 2004, 06:00 PM
Ok, for my bot which i've setup to use TCP, im pretty sure everything is setup up CORRECTLY, but when i try to connect i get the Check Revision Failed error. Does ne1 know a common reason why this error is recerived, or is there a newer version of checkrevision.dll i should have?
It's recieved because you didn't send what the server thinks you should have sent. Additionally, you may have set a record for "Least amount of information to help someone posted" :P
Ok im not sure wut info i should giv u but heres a few things that may help.
AddChat "Connecting..." & vbNewLine, vbYellow
sckBnet.Close
Set chatbot = New bnetchat
sckBnet.Connect varServer, 6112
Private Sub sckBnet_connect()
SendHeader
Send1E
AddChat "BNET: 1E Sent!" & vbNewLine, vbGreen
End Sub
Private Sub sckbnet_DataArrival(ByVal bytesTotal As Long)
Static strBuffer As String
Dim strTemp As String, lngLen As Long
sckBnet.GetData strTemp, vbString
strBuffer = strBuffer & strTemp
While Len(strBuffer) > 4
lngLen = Val("&H" & StrToHex(StrReverse(Mid(strBuffer, 3, 2))))
If Len(strBuffer) < lngLen Then Exit Sub
parsep (Left(strBuffer, lngLen))
strBuffer = Mid(strBuffer, lngLen + 1)
Wend
End Sub
Public Sub SendHeader()
Form1.sckBnet.SendData Chr(1)
End Sub
Public Function Send1E()
pbuffer.InsertDWORD 1
pbuffer.InsertDWORD 0
pbuffer.InsertDWORD 0
pbuffer.InsertDWORD 0
pbuffer.InsertDWORD 1
pbuffer.InsertNTString "123"
pbuffer.InsertNTString "123"
pbuffer.sendPacket &H1E
pbuffer.InsertNonNTString "68XI" & varProduct
pbuffer.InsertDWORD "&H" & "C7"
pbuffer.InsertDWORD 0
pbuffer.sendPacket &H6
pbuffer.InsertDWORD 0
pbuffer.sendPacket &H25
End Function
Public Sub SendCDKey(cdkey As String)
On Error Resume Next
If varProduct = "RTSJ" Then
pbuffer.InsertDWORD &H0
pbuffer.InsertNTString Mid(varCDKey, 5, Len(varCDKey) - 4)
pbuffer.InsertNTString "123"
pbuffer.sendPacket &H30
Else
Dim lngSeed As Long, lngKey As Long, lngProdID As Long, lngValue1 As Long, lngValue2 As Long, lngValue3 As Long
Dim dblProdID As Double, dblValue1 As Double, dblValue2 As Double, dblSeed As Double, dblkey As Double
dblSeed = Val("&h" & StrToHex(StrReverse(serverhash)))
dblkey = GetTickCount()
lngSeed = CLng(dblSeed)
lngKey = CLng(dblkey)
Call DecodeCDKey(cdkey, dblProdID, dblValue1, dblValue2)
lngProdID = CLng(dblProdID)
lngValue1 = CLng(dblValue1)
lngValue2 = CLng(dblValue2)
Call HashCDKey(lngKey, lngSeed, lngProdID, lngValue1, lngValue2)
pbuffer.InsertDWORD &H0
pbuffer.InsertDWORD Len(cdkey)
pbuffer.InsertDWORD CLng(dblProdID)
pbuffer.InsertDWORD CLng(dblValue1)
pbuffer.InsertDWORD CLng(dblSeed)
pbuffer.InsertDWORD CLng(dblkey)
pbuffer.InsertDWORD lngKey
pbuffer.InsertDWORD lngSeed
pbuffer.InsertDWORD lngProdID
pbuffer.InsertDWORD lngValue1
pbuffer.InsertDWORD lngValue2
pbuffer.InsertNTString "123"
pbuffer.sendPacket &H36
End If
End Sub
Public Sub SendUsernamePassword()
On Error Resume Next
Dim dbseed As Double
Dim dblkey As Double
Dim dblSeed As Double
Dim lngSeed As Long
Dim lngKey As Long
Dim lngValue1 As Long
Dim lngValue2 As Long
Dim lngValue3 As Long
'Name = varUser
'pass = varPass
dblSeed = Val("&h" & StrToHex(StrReverse(serverhash)))
dblkey = GetTickCount
lngSeed = CLng(dblSeed)
lngKey = CLng(dblkey)
HashPass varPass, Len(varPass), lngKey, lngSeed, lngValue1, lngValue2, lngValue3
pbuffer.InsertDWORD CLng(dblkey)
pbuffer.InsertDWORD CLng(dblSeed)
pbuffer.InsertDWORD lngKey
pbuffer.InsertDWORD lngSeed
pbuffer.InsertDWORD lngValue1
pbuffer.InsertDWORD lngValue2
pbuffer.InsertDWORD lngValue3
pbuffer.InsertNTString varUser
pbuffer.sendPacket &H29
End Sub[\code]
Now obviously this isn't the code that is put in modules or class mods.
If ttheres no problem with ne of this code tel me and i'll giv u the code from the modules, but im sure those r done correctly.
Do you have the hash files in the correct directory?... ;)
yes, my hash files r in the correct directory. also, my checkrevision.dll wus modified in 2001, should i have a newer version?
Hmm, *reminisces on the coding of Feanor's bot. Finds amazing similarities between the posted code and Feanor's*. Also, 2001? I don't know if the CheckRevision function used in the DLL is "outdated". I didn't think the CheckRevision function changed at all.
Im pretty sure Feanors TCP Connection uses Bnetauth.dll
Quote from: Warrior on October 27, 2004, 05:52 PM
Im pretty sure Feanors TCP Connection uses Bnetauth.dll
Quite a few do...is there a problem with that?
ok, well now that i know checkrevision.dll's date doesn't matter. just in case, i found a version of bnetauth.dll from 2004. but i stil have the check revision error. does ne1 think that they need to see more code in order 2 help me?
You have the updated hashes?
is it me or the verbyte is c7 when it should be c9
yesi hav updated hashed and i changed "c7" to verByte and all that is setup correctly, but mayb ur right, mayb starcraft is c9 and not c7, i'll try it out.
Quote from: Twix on October 27, 2004, 08:02 PM
is it me or the verbyte is c7 when it should be c9
Your right, he has a bad VerByte.
Quote from: Yegg on October 27, 2004, 05:10 PM
pbuffer.InsertDWORD "&H" & "C7"
It needs to be C9, assuming you're trying to logon STAR/SEXP.
Well yea, I figured since hes trying to use CheckRevision.dll...
well, i tried it with C9 and it stil fails, i think theres something missing but i hav no clu wut.
Quotepbuffer.InsertDWORD "&H" & "C7"
If I'm not mistaken, the above does the following:
1. Creates a DWORD value from given data.
2. Suggests that the data given is a string.
Would this code not ultimately send "&HC7" and not &HC7? Please, correct me if I'm wrong.
You are correct you dont send it in quotes I also dont see the point in sending "&H"&"C7" (which is the wrong Version Byte btw) Id do
PBuffer.InsertDWORD &HC9
Why not just put
pbuffer.InsertDWORD "&HC9"
Try that and maybe it'll work (sum1 correct me if im wrong plz)
Read at my post you wont be sending a verbyte more like a string to Battle.net by putting quotes around it .
Let's take a look for a second at what we're actually sending here, a verbyte. The short-hand verbyte stands for Version Byte. So, it would seem the data type we're dealing with here is a Byte. We're sending 1 small piece of data inside the packet to identify the client's version. If we were to send it as a string, I believe the DWORD function would create something that is around ?16? bytes long? This is obviously 15 bytes over the size of the supposed "verbyte". Does that clear things up?
Ok i know have:
pbuffer.InsertDWORD &HC9
and i still get the chech revision error, so im assuming that this isn't the problem ne more. mayb the bot is trying to get the wrong verByte somewhere else? For instance, the code in my TCPConnection.cls contains:
Private Function GetVerByte() As Integer
On Error Resume Next
Select Case varProduct
Case "RATS", "PXES"
GetVerByte = 199
Case "NB2W"
GetVerByte = 79
Case "VD2D", "PX2D"
GetVerByte = 9
Case "3RAW", "PX3W"
GetVerByte = 12
End Select
End Function[\code]
Is this code correct?
Also, the pbuffer.InsertDWORD &HC9 line of code is under my Public Function Send1E(), and b4 i get the check revision error, it says that IE was sent. so this should cancel out a problem with the verbytes right?
You didn't read Warriors post.
Try InsertBYTE.
No, that's wrong. The data type required for the version byte is DWORD.
Yes its a DWORD and thats a function called to get the Verbyte if you look closely.
ok ty for all ur help guys, i no longer hav the check revision error, now after it says 1E Sent, it goes to disconnected. so im going to work on trying to find out why and see wut happens.
Edit: I found another spot in the code that used InsertDWORD &HC9 so i changed that to InsertBYTE &HC9, I know get the following error:
Bnet error 10053 - Connection is aborted due to timeout or other failure
does this mean a hav yet another error to find? or insertbyte is wrong, or my hashed r outdated?
Well if I may give a few pointers...
First, using 0x1E is not the best idea. 0x50 is the way to go. Second, Instead of using CheckRevision.dll and Hash.dll, BnetAuth.dll does more than those 2 combined.
Now http://bnetdocs.valhallalegends.com is excellent for Battle.net packet reference. Let me remind you that each packet you receive, the actual packet starts on the 5th character. Now I know that noone will post the code for you... so check out bnetdocs. If you can't use that, then you might want to stay with CSB for awhile until you learn more.
Why is 1E not a good logon method? Second, I see nothing wrong with CheckRevision.dll or Hash.dll.
Anyway, when he said the packet starts on the 5th character, he's wrong.
The packet starts on the first character. What he meant to say was the actual packet's "information data" starts on the 5th character (most of the time). Typically, if using VB, most people will do something like the following: pData = Mid(packet, 5).
Id rather have one BnetAuth.dll then a CheckRevision.dll and a Hash.dll, also I perfer 1E because it can load WC2 so it kills two birds with one stone .
Quote from: LivedKrad on October 28, 2004, 04:50 PM
Let's take a look for a second at what we're actually sending here, a verbyte. The short-hand verbyte stands for Version Byte. So, it would seem the data type we're dealing with here is a Byte. We're sending 1 small piece of data inside the packet to identify the client's version. If we were to send it as a string, I believe the DWORD function would create something that is around ?16? bytes long? This is obviously 15 bytes over the size of the supposed "verbyte". Does that clear things up?
Note that a DWORD is typically an unsigned long which is 4 bytes (32 bits) in size
Quote from: UserLoser on October 30, 2004, 01:46 AM
Quote from: LivedKrad on October 28, 2004, 04:50 PM
Let's take a look for a second at what we're actually sending here, a verbyte. The short-hand verbyte stands for Version Byte. So, it would seem the data type we're dealing with here is a Byte. We're sending 1 small piece of data inside the packet to identify the client's version. If we were to send it as a string, I believe the DWORD function would create something that is around ?16? bytes long? This is obviously 15 bytes over the size of the supposed "verbyte". Does that clear things up?
Note that a DWORD is typically an unsigned long which is 4 bytes (32 bits) in size
Yes, a DWORD is 4 bytes. However, what I was saying was that the function would create a DWORD out of a string, instead of a singular byte.
Quote from: Warrior on October 29, 2004, 07:24 PM
Id rather have one BnetAuth.dll then a CheckRevision.dll and a Hash.dll, also I perfer 1E because it can load WC2 so it kills two birds with one stone .
0x50 loads WC2 also. i think only some mac version of w2 still uses 1E
Hmm never knew.