Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Joe[x86] on October 29, 2004, 03:11 AM

Title: My First Binary Bot
Post by: Joe[x86] on October 29, 2004, 03:11 AM
About a week ago, I got pissed because CSB uses the BNLS server that was down, so I stopped using it and decided to write my own Binary Bot. I feel that I'm doing quite poorly at it, but some say I'm doin good, so I'm still working on it. So far, I can send null packets (duh), log on to a JBLS server (like BNLS, made by The-FooL), and Request verbytes.

So, since I know a lot of people use CSB, but might want to try making a binary bot, have at some source code!

Verbyte Request for BNLS
pbuffer.InsertDWORD &H1
pbuffer.SendBNLSPacket &H10
WriteToLog "[BNLS] VerByte Requested (0x10)"
AddChat vbGreen, "[BNLS] Version Byte Requested (0x10)"


0x00 (Null) for JBLS
pbuffer.SendJBLSPacket "&H0"
AddChat vbGreen, "[JBLS] Sent 0x00"
WriteToLog "[JBLS] Sent 0x00 (JBLS_NULL)"


And last but not least, My Wonderful BNLS/JBLS parser:
Private Sub ParseJBLS(ByVal Data As String)
Select Case Asc(Mid(Data, 3, 1))
    Case &H10
        verbyte = GetDWORD(Mid(Data, 8, 4))
        verbyte = Replace(verbyte, Chr(13), vbNullString)
        Dim strVerbyte As String
        strVerbyte = verbyte
        AddChat vbGreen, "[JBLS] Verbyte: " & DecToHex(strVerbyte)
    Case Else
            AddChat vbCyan, "[JBLS] Data Arrival!"
            AddChat vbCyan, strJblsData
End Select
End Sub

Yup. It parses the whole 0x10 Packet.

Well, thats all I really have worth posting here. For the verbytes, though, if anyone has a DecToHex Sub so I can get verbytes like C9 and 0A and stuff, please post that here.


EDIT: I FINALLY stopped stubbing my toe on that fzcking 0x50 packet. Wee!
EDIT2: Used code blocks, and updated my ParseBNLS sub.
Title: Re: My First Binary Bot
Post by: EviL_MarinE on October 29, 2004, 04:13 AM
Use [ / code ] for your code plz.

Bot sounds good, keep it up :)
Title: Re: My First Binary Bot
Post by: Eric on October 29, 2004, 05:35 AM
/me finds it odd that your connection's out buffer is referred to as "JBLS" while your connection's in buffer is referred to as "BNLS"

Even though the small amount of code you posted has little to no use to anyone other than yourself, it may help to include all of the functions your code requires to run, rather than just a select few.

QuoteFor the verbytes, though, if anyone has a DecToHex Sub so I can get verbytes like C9 and 0A and stuff, please post that here.


Dim sHex As String * 2

sHex = Hex(201)
Title: Re: My First Binary Bot
Post by: iago on October 29, 2004, 08:28 AM
Quote from: LoRd[nK] on October 29, 2004, 05:35 AM
/me

Dim sHex As String * 2

sHex = Hex(201)


Wouldn't there be a danger with overflowing that if it was used for arbitrary data? Or is buffer overflow not an issue in vb (thus creating MORE bad habits in vb programmers)?

Incidentally, BNLS and JBLS are interchangable, so you can technically use CSB with JBLS to log in.  If you can't change the BNLS server for CSB easily, you can probably do it in your hosts file.
Title: Re: My First Binary Bot
Post by: Skywing on October 29, 2004, 09:45 AM
Quote from: iago on October 29, 2004, 08:28 AM
Quote from: LoRd[nK] on October 29, 2004, 05:35 AM
/me

Dim sHex As String * 2

sHex = Hex(201)


Wouldn't there be a danger with overflowing that if it was used for arbitrary data? Or is buffer overflow not an issue in vb (thus creating MORE bad habits in vb programmers)?

Incidentally, BNLS and JBLS are interchangable, so you can technically use CSB with JBLS to log in.  If you can't change the BNLS server for CSB easily, you can probably do it in your hosts file.
Not quite, JBLS doesn't implement the full protocol.  For instance, you might have trouble getting EternalChat to log on to War3 using it, because (IIRC) JBLS doesn't support checking server password proofs.  AFAIK, it doesn't support password change, either.
Title: Re: My First Binary Bot
Post by: Warrior on October 29, 2004, 12:10 PM
Yes, asked Spht why It wouldnt logon with SphtBot and he said it was something with JBLS .  Anyways Joe, Good job. Im glad to see your working so hard.
Title: Re: My First Binary Bot
Post by: Eric on October 29, 2004, 01:00 PM
QuoteWouldn't there be a danger with overflowing that if it was used for arbitrary data?

No.  It would just trunicate the returned value, but since, in this case, it'll only be used for byte conversions, so it shouldn't be a problem.
Title: Re: My First Binary Bot
Post by: Joe[x86] on October 29, 2004, 02:48 PM
Quote[12:47:49 PM] [JBLS] Connecting
[12:47:49 PM] [JBLS] Connected!
[12:47:50 PM] [JBLS] Version Byte Requested (0x10)
[12:47:50 PM] [JBLS] Verbyte: C9

*hugs lord, realizes what he just did, and steps back*

Thanks LoRd

EDIT: The reason it says the JBLS verbyte came from BNLS, is because my ParseJBLS sub is a copy and pasted version of my ParseBNLS sub and I forgot to change the label for it. Its fixed now.

EDIT2: As for Sphtbot, JBLS doesn't handle 0x0F properly, because, quite obviosly, FooL doesn't have the BNLS accound passwords :P

EDIT3: I tweaked the DecToHex thing a bit and ended up with..Public Function DecToHex(Dec As String) As String
Dim sHex As String * 2
sHex = Hex(Dec)
DecToHex = sHex
End Function
Title: Re: My First Binary Bot
Post by: Minux on October 29, 2004, 03:21 PM
Quote from: JoeTheOdd on October 29, 2004, 02:48 PM


Public Function DecToHex(Dec As String) As String
Dim sHex As String * 2
sHex = Hex(Dec)
DecToHex = sHex
End Function


EDIT3: I tweaked the DecToHex thing a bit and ended up with..

Forgive me for being out of line, but how is that tweaked?

Lord's code
Quote from: LoRd[nK] on October 29, 2004, 05:35 AM

Dim sHex As String * 2

sHex = Hex(201)


All you did was make it into a function. So you constructed it into a routine...you did not tweak it.
Title: Re: My First Binary Bot
Post by: Joe[x86] on October 29, 2004, 03:29 PM
By tweaked, I meant made it into a function :P
Title: Re: My First Binary Bot
Post by: iago on October 29, 2004, 05:48 PM
Quote from: Skywing on October 29, 2004, 09:45 AM
Quote from: iago on October 29, 2004, 08:28 AM
Quote from: LoRd[nK] on October 29, 2004, 05:35 AM
/me

Dim sHex As String * 2

sHex = Hex(201)


Wouldn't there be a danger with overflowing that if it was used for arbitrary data? Or is buffer overflow not an issue in vb (thus creating MORE bad habits in vb programmers)?

Incidentally, BNLS and JBLS are interchangable, so you can technically use CSB with JBLS to log in.  If you can't change the BNLS server for CSB easily, you can probably do it in your hosts file.
Not quite, JBLS doesn't implement the full protocol. For instance, you might have trouble getting EternalChat to log on to War3 using it, because (IIRC) JBLS doesn't support checking server password proofs. AFAIK, it doesn't support password change, either.

I've never actually looked at it at all.  But I'm not surprised it doesn't do password change, since he's using my login code and I never wrote a password change myself.  In fact, same with checking proofs.
Title: Re: My First Binary Bot
Post by: Eric on October 29, 2004, 07:55 PM
QuoteEDIT2: As for Sphtbot, JBLS doesn't handle 0x0F properly, because, quite obviosly, FooL doesn't have the BNLS accound passwords Tongue
All it'd have to do is spit out a random encryption key and return the sucess value when the client replied to it with the checksum...
Title: Re: My First Binary Bot
Post by: Skywing on October 29, 2004, 09:24 PM
Quote from: iago on October 29, 2004, 05:48 PM
Quote from: Skywing on October 29, 2004, 09:45 AM
Quote from: iago on October 29, 2004, 08:28 AM
Quote from: LoRd[nK] on October 29, 2004, 05:35 AM
/me

Dim sHex As String * 2

sHex = Hex(201)


Wouldn't there be a danger with overflowing that if it was used for arbitrary data? Or is buffer overflow not an issue in vb (thus creating MORE bad habits in vb programmers)?

Incidentally, BNLS and JBLS are interchangable, so you can technically use CSB with JBLS to log in.  If you can't change the BNLS server for CSB easily, you can probably do it in your hosts file.
Not quite, JBLS doesn't implement the full protocol. For instance, you might have trouble getting EternalChat to log on to War3 using it, because (IIRC) JBLS doesn't support checking server password proofs. AFAIK, it doesn't support password change, either.

I've never actually looked at it at all.  But I'm not surprised it doesn't do password change, since he's using my login code and I never wrote a password change myself.  In fact, same with checking proofs.
Provided he understands how the system works, it shouldn't be too difficult to implement those...
Title: Re: My First Binary Bot
Post by: The-FooL on October 29, 2004, 09:31 PM
 
Quote from: LoRd[nK] on October 29, 2004, 07:55 PM
QuoteEDIT2: As for Sphtbot, JBLS doesn't handle 0x0F properly, because, quite obviosly, FooL doesn't have the BNLS accound passwords Tongue
All it'd have to do is spit out a random encryption key and return the sucess value when the client replied to it with the checksum...

It actually does support the BNLS account login packets, but accepts all logins as anonymous.  You *could* modify the source and have it reply with the password verified response code.

And as iago said, I used his Checkrevision and SRP Classes, so there is no change password support.
Title: Re: My First Binary Bot
Post by: Joe[x86] on January 29, 2005, 09:00 PM
Well, I don't mean to be a topic bumper, but..

*BUMP*

Work on this project has been re-started. I'm working on a JSTR client because 0x51 was a stumper. My BNLS packet work with the JSTR client should be sufficient to get past 0x51, but, meh.
Title: Re: My First Binary Bot
Post by: Zakath on January 30, 2005, 05:34 AM
Good luck getting JSTR working using 0x51.
Title: Re: My First Binary Bot
Post by: Joe[x86] on January 30, 2005, 10:02 AM
You're not the only one who mis-understood me. By saying that I'm trying to get past 0x51, I meant after JSTR I'm doing STAR again. I've seen the BnetDocs Logon Sequences page, and I have no intention of using JSTR with SID_AUTH_*.
Title: Re: My First Binary Bot
Post by: Zakath on January 30, 2005, 06:04 PM
Ah. Personally, I've never even bothered to write code to deal with non-SID_AUTH_* logins. DRTL and JSTR aren't of enough value to me for me to find it desirable to write more code to deal with another kind of logon.
Title: Re: My First Binary Bot
Post by: Blaze on January 30, 2005, 06:45 PM
They also can't go into private channels which makes them even more useless.
Title: Re: My First Binary Bot
Post by: Joe[x86] on January 30, 2005, 08:38 PM
Yeah, thats true. However, if you're on TestBNCS, they can do some back assward tricks, including, but not limited to, joining private channels.

Back to normal BNET though: JSTR eats a SC key too, making it even MORE annoying.
Title: Re: My First Binary Bot
Post by: OnlyMeat on January 31, 2005, 01:55 AM
Quote from: Zakath on January 30, 2005, 06:04 PM
Ah. Personally, I've never even bothered to write code to deal with non-SID_AUTH_* logins. DRTL and JSTR aren't of enough value to me for me to find it desirable to write more code to deal with another kind of logon.

DRTL login is incredibly simple as it requires no cdkey related login packets.

I can load 8 DRTL bots on a single ip without any cdkeys quite funny really :)
Title: Re: My First Binary Bot
Post by: tA-Kane on February 01, 2005, 05:07 AM
It's also quite useless.
Title: Re: My First Binary Bot
Post by: Blaze on February 01, 2005, 10:56 AM
I bet there isn't a lot of people hosting the hash files for them either..
Title: Re: My First Binary Bot
Post by: Hdx on February 01, 2005, 01:27 PM
Hay, if ur gona be like me and support all login types, DRTL is one of them, I have the hashes, and if u want any help ask me.  But seriously, loading bots is worthless...
~-~(HDX)~-~
Title: Re: My First Binary Bot
Post by: Zakath on February 01, 2005, 04:18 PM
You could also do it the old fashioned way and just install the game...

Or are all you people too young to have played Diablo?
Title: Re: My First Binary Bot
Post by: shout on February 01, 2005, 05:04 PM
I used to love Diablo.  But then dumb "hackers" (cough) ruined the game.
Title: Re: My First Binary Bot
Post by: Hdx on February 01, 2005, 06:09 PM
Quote from: Zakath on February 01, 2005, 04:18 PM
You could also do it the old fashioned way and just install the game...

Or are all you people too young to have played Diablo?
D1 is the only acull client I have installed, Theres nuthing like the classics. And yes "hackers" fuck it up the *ss royaly, its not worth playing Online anymore unless u get private servers. But its still a good Single player game, specilly if u know how to make mods for it ;)
~-~(HDX)~-~
Title: Re: My First Binary Bot
Post by: MyndFyre on February 01, 2005, 08:01 PM
Quote from: HdxBmx27 on February 01, 2005, 06:09 PM
Quote from: Zakath on February 01, 2005, 04:18 PM
You could also do it the old fashioned way and just install the game...

Or are all you people too young to have played Diablo?
D1 is the only acull client I have installed, Theres nuthing like the classics. And yes "hackers" fuck it up the *ss royaly, its not worth playing Online anymore unless u get private servers. But its still a good Single player game, specilly if u know how to make mods for it ;)
~-~(HDX)~-~

Out of curiosity, why would you censor "ass" but not "fuck"?
Title: Re: My First Binary Bot
Post by: Hdx on February 01, 2005, 10:16 PM
I said fuck 0.o whops, do u ppl care if i swear?
Lots of ppl do, I try to catch it but w/e
~-~(HDX)~-~
Title: Re: My First Binary Bot
Post by: UserLoser. on February 01, 2005, 10:19 PM
Quote from: HdxBmx27 on February 01, 2005, 10:16 PM
I said fuck 0.o whops, do u ppl care if i swear?
Lots of ppl do, I try to catch it but w/e
~-~(HDX)~-~

I don't think so.  Most of us are over 12 years in age, although a bunch of people surely do not act like it
Title: Re: My First Binary Bot
Post by: shout on February 02, 2005, 09:49 AM
And plus, we happen to be on the internet, so its not like your talking to someone face to face.
Title: Re: My First Binary Bot
Post by: Blaze on February 02, 2005, 02:34 PM
I swear at hdx all the time on the phone; does that count as face to face?
Title: Re: My First Binary Bot
Post by: shout on February 02, 2005, 03:59 PM
No.
Title: Re: My First Binary Bot
Post by: Joe[x86] on February 02, 2005, 04:06 PM
I suppose I am too young to have played Diablo I, but after I played WarCraft III, I bought a copy of D1 at a garage sale for four bucks. It included the strategy guide, so, meh.

Also, DRTL is not exactly worthless. Now that someone mentioned loading 8 D1 bots.. its more than you can load with CHAT. Why would anyone care? If your users don't mind downloading additional hashes for their bot, you can load up 3 DRTL connections in the background along with your STAR or whatever bot, so you can use the DRTL's for a user monitor feature. This wouldn't be that big of an ass to maintain either, because the hashes are.. 1.2MB?.. and there is no way in hell its ever going to be patched again.
Title: Re: My First Binary Bot
Post by: Eric on February 02, 2005, 04:41 PM
Quoteyou can load up 3 DRTL connections in the background along with your STAR

Why not just load those 3 additional clients as spawns?
Title: Re: My First Binary Bot
Post by: Joe[x86] on February 02, 2005, 04:52 PM
I guess that works too. DRTL would be an easier logon sequence to use, wouldn't it? With spawn, I think you're only allowed to play games with the one who shares your key, so you would need to send your key, AFAIK.
Title: Re: My First Binary Bot
Post by: Hdx on February 02, 2005, 06:06 PM
Yes Spawns are olny allowed to play with others on there cdkey, BUT why would u make a bot to play games, spawn shats perfectly fine.
But Just add DRTl cuz its something to do, adds more flexibility for your bot.
End-Users Like flexibility.
~-~(HDX)~-~
Title: Re: My First Binary Bot
Post by: Kp on February 02, 2005, 09:15 PM
Quote from: JoeTheOdd on February 02, 2005, 04:06 PMIt included the strategy guide, so, meh.

Trash that "strategy guide" at once.  It's based off a pre-release and is often wildly inaccurate.  You're quite likely to get your character killed if you heed its advice.
Title: Re: My First Binary Bot
Post by: Joe[x86] on February 04, 2005, 07:00 AM
You're likely to get killed if you don't use hax.

HdxBmx27: Doesn't that mean we need to send the CD-Key? More packet work we need to do if we don't wanna use DRTL.

Back on the subject of my bot, I'm about half way done with the JSTR logon.
Title: Re: My First Binary Bot
Post by: Kp on February 04, 2005, 11:46 AM
Quote from: JoeTheOdd on February 04, 2005, 07:00 AMYou're likely to get killed if you don't use hax.

If you follow that strategy guide from Prima, yes, you are.  However, if you have a clue what you're doing, Diablo is an extremely easy game to play legit.  Consider such cases as Percy(BNM), the blind lighthouse, and the numerous 3@30 postings. :)
Title: Re: My First Binary Bot
Post by: UserLoser. on February 05, 2005, 12:34 AM
Quote from: JoeTheOdd on February 02, 2005, 04:52 PM
I guess that works too. DRTL would be an easier logon sequence to use, wouldn't it? With spawn, I think you're only allowed to play games with the one who shares your key, so you would need to send your key, AFAIK.

You can play Starcraft (and I'm sure Diablo I) games without even being on Battle.net.