Author | Message | Time |
---|---|---|
### Teh Gnube ### | Yes, I am "Teh Gnube", and I suck at Vb6! I am tweaking a source to sort of get the feel of programming, and I want to implement BNCSUtil. Currently, it almost works (I think), but when I compile, I get the error "User-defined variable type not defined", in this code: [code]'------------------------------------------------- ' SID_AUTH_INFO (0x50) Handler '------------------------------------------------- Private Sub HandleAuthInfo(P As Packet) '<-- Highlighted during error![/code] I don't know how to define "P As Packet", I think it is the Packet part that is throwing it, but again, I am not very knowledgeable on the topic. Please point me in the correct direction. | June 25, 2005, 8:21 PM |
KkBlazekK | You are defining p as Packet. Did you declare what Packet is? btw, a battle.net bot isn't a great way to learn a programming language, try simple things and work your way up. | June 25, 2005, 8:25 PM |
Kp | [quote author=### Teh Gnube ### link=topic=11975.msg117479#msg117479 date=1119730865] Yes, I am "Teh Gnube", and I suck at Vb6![/quote] That's ok. Many of us don't know VB6 at all, and are better coders for our lack of support for such a terrible language. [quote author=### Teh Gnube ### link=topic=11975.msg117479#msg117479 date=1119730865]I am tweaking a source to sort of get the feel of programming[/quote] I'm assuming this is an anonymous source? How does he/she feel about getting "tweaked" just so you can get a feeling? Does this source have any credible documents about abuses by powerful shadowy people? | June 25, 2005, 8:29 PM |
Networks | [quote author=Kp link=topic=11975.msg117482#msg117482 date=1119731355] [quote author=### Teh Gnube ### link=topic=11975.msg117479#msg117479 date=1119730865] Yes, I am "Teh Gnube", and I suck at Vb6![/quote] That's ok. Many of us don't know VB6 at all, and are better coders for our lack of support for such a terrible language. [quote author=### Teh Gnube ### link=topic=11975.msg117479#msg117479 date=1119730865]I am tweaking a source to sort of get the feel of programming[/quote] I'm assuming this is an anonymous source? How does he/she feel about getting "tweaked" just so you can get a feeling? Does this source have any credible documents about abuses by powerful shadowy people? [/quote] Looks like Cloaked's BNCSUtil example bot to me! | June 25, 2005, 9:03 PM |
### Teh Gnube ### | It is, well at least the "Connect" module. And I am tweaking a Truimph Bot, which is pretty much already known to be stolen, and the many owners of the scripts in that bot are well aware they are there. Also, I'm not planning to release it... I am actually doing this because my StarCraft disk is broken, and my WarCraft III is MIA... I am just looking to possibly pick up a coding language, as I code for my own personal use... And I didn't define what a packet was either. Any pointers on how to do so? =\ Sorry to ask so much, but I would like to learn... | June 26, 2005, 12:00 AM |
HdxBmx27 | Dude....Don't use others sources and 'tweak' them -.- Do NOT make a Binary bot your 'learning' project. -.- If you don't know how to declair types, then you shouldn't be making a bot. [code]Public Type Packet IDontKnowShitAboutProgrammingAndShouldntBeMakingABot as string End Type[/code] If you jsut want something to connect and chaton BNet use StealthBot Check This out for some tutorials on VB. ~-~(HDX)~-~ | June 26, 2005, 1:04 AM |
R.a.B.B.i.T | Or you could not use StealthBot. And on top of that, ripping out the guts and putting in new ones is in no way "tweaking", that's full on changing. If you really want to make a Battle.Net bot, get a C++ compiler and a tutorial on telnet plaintext protocol. | June 26, 2005, 2:45 PM |
Kp | The GNU compiler collection (GCC) supports C++ if you get the g++ package. I recommend GCC 3.3.6, so grab /releases/gcc-3.3.6/gcc-core-3.3.6.tar.bz2 and /releases/gcc-3.3.6/gcc-g++-3.3.6.tar.bz2 from any of the GCC mirror sites. If you're stuck using a clunky OS like MS-Windows, check out MinGW, a Windows port of GCC. Note that because Windows is such a braindamaged OS, it requires massive patches to the GCC core to produce a Windows-capable GCC, so MinGW may not be up with the latest patches. From looking at their download page, it looks like the latest 3.3.x GCC they have available is 3.3.1. Also, see Telnet RFC to learn about telnet. | June 26, 2005, 4:23 PM |
Quarantine | On the topic of cross compilers: http://www.delorie.com/djgpp/ | June 27, 2005, 1:00 PM |
R.a.B.B.i.T | [quote author=Kp link=topic=11975.msg117594#msg117594 date=1119802991] The GNU compiler collection (GCC) supports C++ if you get the g++ package. I recommend GCC 3.3.6, so grab /releases/gcc-3.3.6/gcc-core-3.3.6.tar.bz2 and /releases/gcc-3.3.6/gcc-g++-3.3.6.tar.bz2 from any of the GCC mirror sites. If you're stuck using a clunky OS like MS-Windows, check out MinGW, a Windows port of GCC. Note that because Windows is such a braindamaged OS, it requires massive patches to the GCC core to produce a Windows-capable GCC, so MinGW may not be up with the latest patches. From looking at their download page, it looks like the latest 3.3.x GCC they have available is 3.3.1. Also, see Telnet RFC to learn about telnet. [/quote]MinGW works just fine for me, but if you realllllllllly don't want to bother, get Dev-C++ or something easy like it. | June 27, 2005, 4:18 PM |
kamakazie | [quote author=rabbit link=topic=11975.msg117745#msg117745 date=1119889082] MinGW works just fine for me, but if you realllllllllly don't want to bother, get Dev-C++ or something easy like it. [/quote] Dev-C++ is just an IDE that uses MinGW as the compiler. | June 27, 2005, 7:01 PM |
R.a.B.B.i.T | Yeah. It's good if you can't figure out MinGW or don't feel like installing all the packages. | June 27, 2005, 9:09 PM |
Networks | I don't even see the point in addressing these topics anymore..People are just going to do whatever they want to do. The easy way out is usually the path most taken. *sigh* | June 28, 2005, 2:30 AM |
### Teh Gnube ### | Errr yeah, I am just doing as I think will work, so I have my packet thing cleared up (to an extent), but now am having another issue. All right, so here it is: [code]Public Sub SendAuthInfo() Dim P As Packet, VerByte As Long, Client As Long, GetSTARByte As String Set P = New Packet 'Line of error[/code] The error is I am using the "New" keyword incorrectly. I don't understand the concept of this keyword, and can't see how I am using it incorrectly. From what I can infer, it is telling the program that this is a new packet, not linked to any other packets sent... "Set P = New Packet" works in the Sub that preceeds the one above, that being: [code]Public Sub HandleData(Data As String, Length As Long) Dim Position As Long Dim P As Packet Dim PacketID As Byte Dim PacketLength As Long 'Packet buffer initializing... Set P = New Packet P.SetData Data[/code] There, "Set P = New Packet" has no problems whatsoever... Well, I don't know much about the language, but I have picked up substantially more since my last post. Sooo let's hear the critiques and responses. | July 3, 2005, 9:37 PM |
Kp | new needs to be written in lowercase, and it is only meaningful to assign its result to pointers or references, not instances of objects. | July 3, 2005, 10:12 PM |
### Teh Gnube ### | New cannot be written in lowercase, Visual Basic overrides it every time I do... And I had Packet defined incorrectly. I wasn't thinking when I was changing this code to meet my needs, and messed it up. Sorry. | July 3, 2005, 10:26 PM |
UserLoser. | Is packet defined as a class module? If not, then it's probably not an object, therefore, cannot use new. | July 3, 2005, 11:23 PM |
### Teh Gnube ### | UserLoser, you were correct, but I beat you to figuring it out. Packet was SUPPOSE to be a class module. (Yes, I'm probably one of the worst programmers around for not seeing that to begin with), so New was to be used there, I have it all working now... Except for one thing. My bot cannot pass CheckRevision, it fails every time. I am not 100% sure what this is, but I know for a fact I have the correct hashes and verbyte... ANd I'm trying to log on VIA WarCraft III. Any knowledge as to why this would happen? O_o | July 4, 2005, 12:22 AM |
UserLoser. | [quote author=### Teh Gnube ### link=topic=11975.msg118696#msg118696 date=1120436544] My bot cannot pass CheckRevision, it fails every time. I am not 100% sure what this is, but I know for a fact I have the correct hashes and verbyte... ANd I'm trying to log on VIA WarCraft III. Any knowledge as to why this would happen? O_o [/quote] Assuming you're doing everything (as in, building/formatting the message) correctly, outdated game files and/or bad version byte | July 4, 2005, 12:30 AM |
### Teh Gnube ### | [code]With P .InsertDWORD &H0 .InsertDWORD ARCH_IX86 .InsertDWORD CLIENT_WAR3 .InsertDWORD &H12 .InsertDWORD &H0 .InsertDWORD &H0 .InsertDWORD &H0 .InsertDWORD &H0 .InsertDWORD &H0 .InsertString "USA" .InsertString "United States" .Send frmMain.wS, SID_AUTH_INFO[/code] And that is what is being sent, I assume it's all correct, it's just like the example (Exact...), unless that's incorrect somehow. | July 4, 2005, 12:43 AM |
HdxBmx27 | That is fine, (Tho I don't like having hardcoded vales...) But thats only 0x50 we need to see how you handle 0x50 S->c and build 0x51 C->S ~-~-~(HDX)~-~ | July 4, 2005, 1:47 AM |
### Teh Gnube ### | Well, since nothing was specified as to any parts you wanted to see of those things, here is how I handle 0x50: [code] Private Sub HandleAuthInfo(P As Packet) Dim mpqNumber As Long, ChecksumFormula As String Dim EXEVersion As Long, Checksum As Long, EXEInfo As String Dim HashFiles(2) As String Dim decoder As Long ' key decoder handle Dim KeyHash As String, HashLength As Long Dim ServerSignature As String * 128 Dim CDKey As String Dim KeyOwner As Long Dim O As Packet Set O = New Packet On Error GoTo LogonError dAdd "[Battle.net] Parsing login information...", vbYelow Select Case P.GetDWORD() Case 0 UseNLS = False Case 1 Disconnect dAdd "[Local Host] Bad NLS system!", vbRed Exit Sub Case 2 UseNLS = True Case Else Disconnect dAdd "[Battle.net] Bad logon sequence!", vbRed Exit Sub End Select ServerToken = P.GetDWORD() P.Skip 12 'Skip UDPvalue and MPQ filetime. mpqNumber = extractMPQNumber(P.GetString()) If (mpqNumber < 0) Then Disconnect dAdd "[Battle.net] Bad MPQ number! (Bad hashes!)", vbRed Exit Sub End If ChecksumFormula = P.GetString() If (UseNLS) Then ServerSignature = P.GetFixedString(128) If (Not nls_check_socket_signature(frmMain.wS.SocketHandle, ServerSignature)) Then Disconnect dAdd "[Battle.net] Invalid server signature!", vbRed End If End If GetHashFiles HashFiles If (checkRevision(ChecksumFormula, HashFiles(0), HashFiles(1), _ HashFiles(2), mpqNumber, Checksum) = False) Then dAdd "[Battle.net] Check Revision Failed!", vbRed Disconnect Exit Sub ElseIf (checkRevision(ChecksumFormula, HashFiles(0), HashFiles(1), _ HashFiles(2), mpqNumber, Checksum) = True) Then dAdd "[Battle.net] Check Revision passed!", vbGreen End If ' Get EXE ver information... EXEVersion = getExeInfo(HashFiles(0), EXEInfo) If (EXEVersion = 0) Then Disconnect dAdd "[Battle.net] Failed to retrive hashing/EXE information!", vbRed Exit Sub End If ' Build SID_AUTH_CHECK With O .InsertDWORD ClientToken .InsertDWORD EXEVersion .InsertDWORD Checksum .InsertDWORD 1 'CDKey .InsertDWORD 0 ' Not using spawn. ' Decode the main CD-key. decoder = kd_create(CDKey1, Len(CDKey)) If (decoder = -1) Then Disconnect dAdd "[Battle.net] Failed to decode your CD-key.", vbRed Exit Sub End If ' Calculate key hash. HashLength = kd_calculateHash(decoder, ClientToken, ServerToken) If (HashLength = 0) Then Disconnect dAdd "Failed to hash your CD-key.", vbRed Exit Sub End If ' Retrieve key hash. KeyHash = String$(HashLength, vbNullChar) ' Initialize buffer. Call kd_getHash(decoder, KeyHash) ' Adding to buffer... .InsertDWORD Len(CDKey1) .InsertDWORD kd_product(decoder) .InsertDWORD kd_val1(decoder) .InsertDWORD 0 .InsertNonNTString KeyHash ' Release the key decoder. Call kd_free(decoder) .InsertString EXEInfo .InsertString "Jeremy Fischer" .Send frmMain.wS, SID_AUTH_CHECK End With End Sub[/code] Mmm, yeah, neat isn't it? It's just about exact as BNCSU Examble bot. 0x51, let's see, shall we? Again, it's exactly BNCSU Example bot's... [code] Public Sub HandleAuthCheck(P As Packet) Dim strTmp As String Select Case P.GetDWORD() 'Result Case &H0 ' OK. Case &H100 Disconnect dAdd "[Battle.net] Outdated game version!", vbRed Exit Sub Case &H101 Disconnect dAdd "[Battle.net] Invalid game version!", vbRed Exit Sub Case &H200 Disconnect dAdd "[Battle.net] Invalid CDKey!", vbRed Exit Sub Case &H201 Disconnect strTmp = P.GetString() If LenB(strTmp) > 0 Then dAdd "[Battle.net] Key in use by " & strTmp, vbRed Else dAdd "[Battle.net] Key is in use by an unknown user!", vbRed End If Exit Sub Case &H202 Disconnect dAdd "[Battle.net] Key is banned!", vbRed Exit Sub Case &H203 Disconnect dAdd "[Battle.net] Your key is for another game.", vbRed Exit Sub Case &H210 'IMPOSSIBLE FOR MY USES! Disconnect dAdd "[Fatal Error] This isn't possible, you aren't using W2XP or D2XP...", vbRed Exit Sub Case &H211 Disconnect strTmp = P.GetString() If LenB(strTmp) > 0 Then 'Ditto Else End If Exit Sub Case &H212 'Ditto Disconnect Exit Sub Case &H213 'Ditto Disconnect Exit Sub Case Else Disconnect dAdd "[Battle.net] Authorization failed for an unknown reason!", vbRed End Select If UseNLS Then SendAuthLogon Else SendLogonResponse End If End Sub[/code] Ok, that's complete... Not original, but complete. If you need 0x53 sender as well (SendAuthLogon), I can post it, but I don't think it's necesary. | July 4, 2005, 2:25 AM |
KkBlazekK | [quote] dAdd "[Fatal Error] This isn't possible, you aren't using W2XP or D2XP...", vbRed [/quote] I didn't know w2xp was online, and that it required a second cdkey... | July 4, 2005, 3:26 AM |
### Teh Gnube ### | Thanks * 10 for finding a typo, but I seriously doubt that one string would cause my bot to fail CRevisions... =/ | July 4, 2005, 3:33 AM |
HdxBmx27 | honestly/ that thing should be broken up into atleast 3 diffrent subs. One to get the CRev() info,another to get the CDKey info, another to handel extracting from 0x50 and another to handel building 0x51. It's jsut cleaner IMO. Show us the values for your vareables, when exiting the Checkrevision() function. Also, Why are you preforming it twice... it's a waist of time. ~-~(HDX)~-~ | July 4, 2005, 3:40 AM |
### Teh Gnube ### | Hmmm, well, here is where I have pinpointed the error (as you probably have too...). [code]If (checkRevision(ChecksumFormula, HashFiles(0), HashFiles(1), _ HashFiles(2), mpqNumber, Checksum) = False) Then dAdd "[Battle.net] Check Revision Failed!", vbRed Disconnect Exit Sub 'HashFiles(0) is "\WAR3\War3.exe" 'HashFiles(1) is "\WAR3\Storm.dll" 'HashFIles(2) is "\WAR3\Game.dll"[/code] Uhhh, I think that's part of what you wanted... I may be wrong, feel free to clarify. | July 4, 2005, 4:03 AM |
HdxBmx27 | Use the full path. (App.Path & "\WAR\______.___") Also, Don't use it in the if statement. Assighn it to a boolean and then use that. ~-~(HDX)~-~ | July 4, 2005, 7:08 AM |
Archangel | [code] Private Function HashFilesPath(strProduct as String) Select Case strProduct Case "SEXP", "STAR" HashFiles(0) = App.Path & "\STAR\starcraft.exe" HashFiles(1) = App.Path & "\STAR\storm.dll" HashFiles(2) = App.Path & "\STAR\battle.snp" Case "WAR3" HashFiles(0) = App.Path & "\WAR3\war3.exe" HashFiles(1) = App.Path & "\WAR3\storm.dll" HashFiles(2) = App.Path & "\WAR3\game.dll" Case "W3XP" HashFiles(0) = App.Path & "\W3XP\war3.exe" HashFiles(1) = App.Path & "\W3XP\storm.dll" HashFiles(2) = App.Path & "\W3XP\game.dll" End Select End Function [/code] This is just an example function of how you can establish the hashfiles. | July 4, 2005, 4:34 PM |
shadypalm88 | [quote author=Archangel link=topic=11975.msg118825#msg118825 date=1120494867] [code] Private Function HashFilesPath(strProduct as String) ' [snipped] End Function [/code] This is just an example function of how you can establish the hashfiles. [/quote] Or, if he'd "tweaked" the example bot properly: [code]'------------------------------------------------- ' Hash File Paths '------------------------------------------------- Public Sub GetHashFiles(Files() As String) Select Case GetClient() Case CLIENT_STAR, CLIENT_SEXP Files(0) = frmMain.txtHashFolder.Text & "\starcraft.exe" Files(1) = frmMain.txtHashFolder.Text & "\storm.dll" Files(2) = frmMain.txtHashFolder.Text & "\battle.snp" Case CLIENT_W2BN Files(0) = frmMain.txtHashFolder.Text & "\WarCraft II BNE.exe" Files(1) = frmMain.txtHashFolder.Text & "\storm.dll" Files(2) = frmMain.txtHashFolder.Text & "\battle.snp" Case CLIENT_D2DV, CLIENT_D2XP Files(0) = frmMain.txtHashFolder.Text & "\Game.exe" Files(1) = frmMain.txtHashFolder.Text & "\Bnclient.dll" Files(2) = frmMain.txtHashFolder.Text & "\D2Client.dll" Case CLIENT_WAR3, CLIENT_W3XP Files(0) = frmMain.txtHashFolder.Text & "\war3.exe" Files(1) = frmMain.txtHashFolder.Text & "\Storm.dll" Files(2) = frmMain.txtHashFolder.Text & "\Game.dll" End Select End Sub[/code] | July 4, 2005, 4:47 PM |
Archangel | Of you can get that function on older bots source codes. :) | July 4, 2005, 4:51 PM |
### Teh Gnube ### | Thaaanks, that seems to have worked, maybe, every time I run the program through Visual Basic, it crashes the program... Uhhh, what's with that? | July 4, 2005, 5:59 PM |
Kp | As an aside, wouldn't it be simpler to SetCurrentDirectoryW to the right place, and then use relative paths? | July 4, 2005, 6:25 PM |
### Teh Gnube ### | Maybe, but what's done is done... And I need to know why this program crashes every time I run it. ANY ideas? Error message can be found here: http://frozengaming.net/error.PNG I SS'd it... Uhhh, yep, no clue what's going wrong here. -_- | July 4, 2005, 6:35 PM |
Kp | Your VB6 install is broken? ::shrug:: Most likely, you corrupted the stack somehow. Check the places where you modify the stack. | July 4, 2005, 8:07 PM |
### Teh Gnube ### | I don't understand what you mean by "stack"... I'm newb, remember? I can compile other things just fine, it's just this one project that crashes... | July 4, 2005, 8:47 PM |
Elneroth | Does it crash when you connect or right when you start up? If it's crashing during connection make sure you call KD_Init during startup, or before you send hashes out. | July 5, 2005, 7:08 AM |
Elneroth | Public Declare Function kd_init Lib "bncsutil.dll" () As Long | July 5, 2005, 7:10 AM |
Archangel | Try opening the project from the main folder and not from the "Recently Opened" sometimes the project doesn't find the BNCSUtil Library. | July 5, 2005, 3:16 PM |
Myndfyr | Learn how to debug. Start the program, break on the first line, and step through line-by-line until you encounter the crash. I don't know. That seems pretty obvious to me. But it seems like I've said that a lot lately. Anyone want to do a debugging tutorial? We could have language experts respectively do one for their preferred environments. Might be a good addition to BNBDR as well -- I know it was something we had talked about some time ago. If you want to do the debugging tutorial, contact me. I have privacy enabled on AIM and MSN I believe, so if we haven't talked before, PM me to tell me your name on them, or PM me with your plan for the tutorial. I can get you more specific information that way as well. | July 5, 2005, 3:31 PM |
### Teh Gnube ### | Elneroth, thank you for your solution, it was correct. I hadn't thought to call kd_init, and sure enough there was my problem! | July 5, 2005, 4:37 PM |
Myndfyr | [quote author=### Teh Gnube ### link=topic=11975.msg118991#msg118991 date=1120581447] Elneroth, thank you for your solution, it was correct. I hadn't thought to call kd_init, and sure enough there was my problem! [/quote] Now, how is that supposed to help him learn? Next project that he starts that crashes, he's going to say, "WTF, I'm not using BNCSUtil! Guys, how do I fix it?" Equip people to fix their own stuff, don't enable them. If he'd started correctly, he could have said, "My program crashes when I call this BNCSUtil routine. What's wrong?" THEN it would have been TRULY beneficial to tell him about kd_init. | July 5, 2005, 5:03 PM |
### Teh Gnube ### | I know it was something in BNCS utility, and I knew where it was happening, I just hadn't paid close enough attention to the BNCS module to realize I was missing that, so yes, he actually DID help me, in my eyes. | July 5, 2005, 5:24 PM |
shadypalm88 | [quote author=### Teh Gnube ### link=topic=11975.msg118998#msg118998 date=1120584243] I know it was something in BNCS utility, and I knew where it was happening, I just hadn't paid close enough attention to the BNCS module to realize I was missing that, so yes, he actually DID help me, in my eyes. [/quote] Yeah, but it's a "give a man a fish" versus "teach a man to fish" type of thing. You need to learn how to properly debug these things on your own, or at least know enough to give relevant information to people here. | July 5, 2005, 9:08 PM |
Elneroth | The purpose of support forums is to either point him in the right direction or help him directly. You guys were telling him to look at other things. Now, I could have just said, "Check your BNCSUtil", maybe you'll end up finding what's wrong on your own some day... No, that doesnt' really help him, and I'm sure someone else would have most likely have said something related to "Oh yeah! You need to initialize BNCSUtil." Now if I said, check to make sure you're "Initializing" it, it would have been the same thing I said to him. You people need to learn how to stop flaming random people all over the place. I see it in like every post I see. No flaming = half the posts wouldn't be deleted. Anyways, what's the point of posting if you're not improving anything here? Wow, you told me I shouldn't have helped him quite that much, did you improve anything? No. All you did was add another little number to your post count. Whatever makes you happy. The next time you need to 'tell me to stop giving away so much help', just private message me. You'll most likely post another low-life flame here again just to make me look stupid. But have fun, just another post being deleted. -Elneroth | July 5, 2005, 11:50 PM |
Elneroth | Alright, I appologize for that. I was rather mad for the flaming I've been seeing lately. I do suppose I could have taught him or let someone else do it. And sorry, MyndFyre, I would have replied directly to your PM, but I want to appologize to whoever's dealing with this topic and not just you. -elneroth | July 6, 2005, 12:10 AM |
Myndfyr | No problem dude, and I appreciate it. I know my tone can be harsh, but as I said in my PM, it's sometimes frustrating when we're trying to help people a little more than just a quick-fix engineering solution. :) | July 6, 2005, 12:30 AM |
Kp | [quote author=shadypalm88 link=topic=11975.msg119057#msg119057 date=1120597730] Yeah, but it's a "give a man a fish" versus "teach a man to fish" type of thing. You need to learn how to properly debug these things on your own, or at least know enough to give relevant information to people here.[/quote] OT: Give a man a fire and he'll be warm for a night. Set a man on fire and he'll be warm for the rest of his life. | July 6, 2005, 2:38 AM |