Valhalla Legends Forums Archive | Battle.net Bot Development | [Resolved]0x51 Help Needed (its driving me bonkers)

AuthorMessageTime
MysT_DooM
Firstly, i did lots of searching through this forum yet my problem was still a problem :\
I set up break points and all that mumbo jumbo and included error handlers to see wat was goin on. yet couldnt figure it out :(
Alright the situation is, that once 0x51 is sent I get Ip Banned. Even though the setup is correct and all the data is there including checksum etc.. Also im sending 0x51 after 0x50 gets parsed.  So do you guys see why I am getting Ip Banned after sending it? or is there something wrong ( I have a feeling it has to do with the Hashed Key Data but maybe not).

[code]
Public Sub Send0x51(tmpFormula As String, tmpFileName As String)
Dim Product, PublicValue, PrivateValue As String
Product = frmScan.txtProduct.Text
PublicValue = frmScan.txtPublic.Text
PrivateValue = frmScan.txtPrivate.Text
Dim ClientToken As Long
ClientToken = GetTickCount 'any old number (cant be 0)
Dim MPQNumber As Long
MPQNumber = extractMPQNumber(tmpFileName)
Dim checksum As Long
Dim Check As Long
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
Dim KeyHash As String
KeyHash = ClientToken & ServerToken & frmScan.txtProduct & frmScan.txtPublic & vbNullChar & frmScan.txtPrivate
If Dir$("C:\Program Files\Starcraft\Starcraft.exe") = "" Then
MsgBox "hash files not found, aborting check revision"
  Exit Sub
End If
If Check_Revision(tmpFormula, tmpFileName, checksum) = False Then
MsgBox "Check FAILED"
Exit Sub
End If



With buf
.InsertDWORD ClientToken 'GetTickCount()
.InsertDWORD &H101030B 'version of the exe file
.InsertDWORD checksum  'EXE hash
.InsertDWORD &H1 '1 cdkey
.InsertDWORD &H0 'no spawning
.InsertDWORD 13 'length of key
.InsertDWORD Product  'Product Value of Key i.e 01 or 02
.InsertDWORD PublicValue  'Public Value of Cd Key 7digit number
.InsertDWORD &H0 'Null
.InsertNonNTString KeyHash  'Hashed Key Data
.InsertNTString "Day of Destruction" 'Exe Info
.InsertNTString "Thieves" 'Owner Name
.InsertHEADER &H51
.sendPacket frmScan.sckBnet
End With
End Sub
[/code]

Packet Log of my Program
[code]
SEND-> 0000   01                                                 .
SEND-> 0000   FF 50 3B 00 00 00 00 00 36 38 58 49 52 41 54 53    .P;.....68XIRATS
SEND-> 0010   CD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
SEND-> 0020   00 00 00 00 00 00 00 00 47 42 52 00 55 6E 69 74    ........GBR.Unit
SEND-> 0030   65 64 20 4B 69 6E 67 64 6F 6D 00                   ed Kingdom.
RECV-> 0000   FF 25 08 00 1E D8 11 70 FF 50 63 00 00 00 00 00    .%.....p.Pc.....
RECV-> 0010   25 2C 53 6A B1 61 19 00 00 AC 41 43 25 0B C5 01    %,Sj.a....AC%...
RECV-> 0020   49 58 38 36 76 65 72 35 2E 6D 70 71 00 41 3D 39    IX86ver5.mpq.A=9
RECV-> 0030   37 34 39 39 30 37 32 39 20 42 3D 33 32 36 38 31    74990729 B=32681
RECV-> 0040   38 30 33 32 20 43 3D 35 35 30 32 39 30 31 37 33    8032 C=550290173
RECV-> 0050   20 34 20 41 3D 41 5E 53 20 42 3D 42 5E 43 20 43     4 A=A^S B=B^C C
RECV-> 0060   3D 43 5E 41                                        =C^A
SEND-> 0000   FF 25 08 00 1E D8 11 70                            .%.....p
SEND-> 0000   FF 51 62 00 2B 6B B2 01 0B 03 01 01 08 FF 58 CE    .Qb.+k........X.
SEND-> 0010   01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00    ................
SEND-> 0020   90 28 1F 00 00 00 00 00 32 38 34 37 30 30 35 39    .(......28470059
SEND-> 0030   31 37 38 33 38 33 35 36 38 35 30 31 32 30 34 32    1783835685012042
SEND-> 0040   30 30 30 00 30 30 30 44 61 79 20 6F 66 20 44 65    000.000Day of De
SEND-> 0050   73 74 72 75 63 74 69 6F 6E 00 54 68 69 65 76 65    struction.Thieve
SEND-> 0060   73 00                                              s.
[/code]
February 24, 2006, 4:01 AM
MysT_DooM
Resolved By Me :P
You guys can delete this

I fixed the key hash data, i dont know why i put vbNullChar
so i switched it to &H0 and boom it worked :)
February 24, 2006, 4:07 AM
iago
Inicidentally, a comment on your code. 

All your variable definitions should occur together, at the top.  And there should be at least one blank line to separate the variable declarations from your executable code.  That makes things much easier to read. 

February 24, 2006, 4:41 AM
UserLoser
[quote="Crappy Code"]
[code]
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
[/code]
[/quote]

I don't get how that works out...
February 24, 2006, 7:58 AM
MysT_DooM
yeah it might be hard to read all bunched up like that, ill make it nicer when i get back home, but at least it works perfectly now :)
[code]
Public Declare Function checkRevisionFlat Lib "bncsutil.dll" (ByVal ValueString As String, ByVal File1 As String, ByVal File2 As String, ByVal File3 As String, ByVal MPQNumber As Long, ByRef checksum As Long) As Long
[/code]
[code]
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
[/code]
that is the check revesion tmpFormula aka MPQFormula and the app paths all point to where the specific hash is. and tmpFileName is the MPQFileName.
February 24, 2006, 11:57 AM
PaiD
Userloser is talking about the locations for the hash files and doesnt see how that would work for your function

App.Path & "C:\Program Files\Starcraft\Starcraft.exe"
App.Path & "C:\Program Files\Starcraft\Battle.snp"
App.Path & "C:\Program Files\Starcraft\Storm.dll"
February 24, 2006, 2:04 PM
iago
[quote author=MysT_DooM link=topic=14356.msg147014#msg147014 date=1140782222]
yeah it might be hard to read all bunched up like that, ill make it nicer when i get back home, but at least it works perfectly now :)
[/quote]
Keeping code clean should be an ongoing process, not an afterthought. 
February 24, 2006, 3:59 PM
rabbit
[quote author=iago link=topic=14356.msg146992#msg146992 date=1140756065]
Inicidentally, a comment on your code. 

All your variable definitions should occur together, at the top.  And there should be at least one blank line to separate the variable declarations from your executable code.  That makes things much easier to read. 


[/quote]Don't forget the tab button!
February 25, 2006, 5:51 PM
MysT_DooM
thx for the input, will do cleaner code on future code
February 25, 2006, 11:01 PM
JoeTheOdd
[quote author=UserLoser link=topic=14356.msg147006#msg147006 date=1140767916]
[quote="Crappy Code"]
[code]
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
[/code]
[/quote]

I don't get how that works out...
[/quote]

When you specify a drive, the path before that drive is nullified (for lack of a better word). Think of the DOS cd command. You can do cd .., because .. is relative of pwd, or you can do cd C:, and have it not be relative.
February 26, 2006, 12:10 AM
iago
[quote author=Joe link=topic=14356.msg147069#msg147069 date=1140912641]
[quote author=UserLoser link=topic=14356.msg147006#msg147006 date=1140767916]
[quote="Crappy Code"]
[code]
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
[/code]
[/quote]

I don't get how that works out...
[/quote]

When you specify a drive, the path before that drive is nullified (for lack of a better word). Think of the DOS cd command. You can do cd .., because .. is relative of pwd, or you can do cd C:, and have it not be relative.
[/quote]

it's relative of the "print working directory"?

I think you probably meant cwd, "current working directory"
February 26, 2006, 1:42 AM
UserLoser
[quote author=Joe link=topic=14356.msg147069#msg147069 date=1140912641]
[quote author=UserLoser link=topic=14356.msg147006#msg147006 date=1140767916]
[quote="Crappy Code"]
[code]
Check = checkRevisionFlat(tmpFormula, App.Path & "C:\Program Files\Starcraft\Starcraft.exe", App.Path & "C:\Program Files\Starcraft\Battle.snp", App.Path & "C:\Program Files\Starcraft\Storm.dll", extractMPQNumber(tmpFileName), checksum)
[/code]
[/quote]

I don't get how that works out...
[/quote]

When you specify a drive, the path before that drive is nullified (for lack of a better word). Think of the DOS cd command. You can do cd .., because .. is relative of pwd, or you can do cd C:, and have it not be relative.
[/quote]

?

That code is llike saying: "C:\Blah\WhateverProject\C:\Program Files\Starcraft\Starcraft.exe"
February 26, 2006, 8:45 AM
MyStiCaL
I see a comma in there...

still looks all kinda konfuzzed up..
February 26, 2006, 10:53 AM
MysT_DooM
[code]
Public Declare Function checkRevisionFlat Lib "bncsutil.dll" (ByVal ValueString As String, ByVal File1 As String, ByVal File2 As String, ByVal File3 As String, ByVal MPQNumber As Long, ByRef checksum As Long) As Long
[/code]
[code]
App.Path & "C:\Program Files\Starcraft\Starcraft.exe"
[/code]
That would be the direct location of the Hash File, which the check revision needs. so in this case   App.Path & "C:\Program Files\Starcraft\Starcraft.exe" would be File1. file2 and 3 would be the battle and storm files.  and the commas are there to seperate each string.
February 26, 2006, 3:19 PM
l2k-Shadow
[quote author=MysT_DooM link=topic=14356.msg147119#msg147119 date=1140967180]
[code]
Public Declare Function checkRevisionFlat Lib "bncsutil.dll" (ByVal ValueString As String, ByVal File1 As String, ByVal File2 As String, ByVal File3 As String, ByVal MPQNumber As Long, ByRef checksum As Long) As Long
[/code]
[code]
App.Path & "C:\Program Files\Starcraft\Starcraft.exe"
[/code]
That would be the direct location of the Hash File, which the check revision needs. so in this case  App.Path & "C:\Program Files\Starcraft\Starcraft.exe" would be File1. file2 and 3 would be the battle and storm files.  and the commas are there to seperate each string.
[/quote]

I hope that you do realize that App.Path is the directory where you application is. So if my application was in "C:\Projects\Bot", App.Path & "C:\Program Files\Starcraft\Starcraft.exe", would be "C:\Projects\BotC:\Program Files\Starcraft\Starcraft.exe". I doubt that's a valid path to the hash files.
February 26, 2006, 4:13 PM
MysT_DooM
hmm but the function does pick up the hash files anyway.
Maybe because i dont have app.path = to nothing
so maybe thats why it still works.  and since it = to nothing it puts Dir$( <~ in front of the "C:\Program Files\Starcraft\Starcraft.exe"
February 26, 2006, 4:29 PM

Search