Valhalla Legends Forums Archive | Battle.net Bot Development | [VB6] Working SID_AUTH_INFO Code please

AuthorMessageTime
bethra
Can anyone please post a working code of the SID_AUTH_INFO packet for VB6 using a winsock?

I'd really appreciated it. I'm sure that this would help me send other packets if I can just see a working one. Thanks alot.

Perhaps using SC/BW. Thanks again
August 5, 2004, 5:04 PM
St0rm.iD
hi guys,

can u plz giv me free sutff...i kno u workd hrd on it btu I NEEDZ IT!!!!! NOW!!!!
August 5, 2004, 5:13 PM
iago
[quote author=bethra link=board=17;threadid=8030;start=0#msg74187 date=1091725481]
Can anyone please post a working code
[...]
Perhaps using SC/BW.
[/quote]


I don't understand how I'm supposed to post code using SC/BW.
August 5, 2004, 5:41 PM
bethra
[quote author=iago link=board=17;threadid=8030;start=0#msg74199 date=1091727714]
[quote author=bethra link=board=17;threadid=8030;start=0#msg74187 date=1091725481]
Can anyone please post a working code
[...]
Perhaps using SC/BW.
[/quote]


I don't understand how I'm supposed to post code using SC/BW.
[/quote]

No, I mean in the SID_AUTH_INFO packet your suppose to like put what product your using, Client ID or something...

Any client would make me happy. thanks. If you have code of this packet already written that would be nice, as long as it works. thanks alot

[quote]
0x50 - SID_AUTH_INFO -

C => S

(DWORD) Protocol (0)
(DWORD) Platform ID
(DWORD) Client ID
(DWORD) Version code
(DWORD) Product language
(DWORD) Local IP address
(DWORD) Time zone information
(DWORD) Locale ID
(DWORD) Language ID
(STRING) Country abreviation
(STRING) Country name
[/quote]
August 5, 2004, 5:45 PM
Stealth
You just pasted in nearly all the information you need to assemble that packet. The rest you can find on BNetDocs.
August 5, 2004, 6:12 PM
bethra
[quote author=$t0rm link=board=17;threadid=8030;start=0#msg74188 date=1091725997]
hi guys,

can u plz giv me free sutff...i kno u workd hrd on it btu I NEEDZ IT!!!!! NOW!!!!
[/quote]

:(

jeeesh, I'm not trying to steal a project or anything. I just need an example of a working bnet packet...

ffs, if i had know that i'd be mocked and flamed then.. ffs jeesh.

I didn't know this was a huge request. if i didn't i wouldn't of posted.

I was taught in my hs c++ class that by looking at code you can interpret and learn from it. all i'm trying to do is get something to learn from. i thought that computer programming was something i wanted to do. the past 3 years i've been planning to major in computer science. ffs

i thought that by seeing working code of a packet i could use it as a reference, learn, interpret it on my own. i am aware of the fineline and ethics of programming and i don't plan to do them. ffs

ffs if all i'm going to get is sarcasm, forget it. what good is it to be in a forum where you have people unfriendly trying to get their +1 post count and put down others in the process? ffs
August 5, 2004, 6:16 PM
bethra
[quote author=Stealth link=board=17;threadid=8030;start=0#msg74202 date=1091729540]
You just pasted in nearly all the information you need to assemble that packet. The rest you can find on BNetDocs.
[/quote]

Yes, i've read many posts with that exact answer. i wouldn't of posted if i hadn't of looked there. I haven't come here without having tried myself... i've practically memorized everything that i've read there, i've even saved pages, copy and pasted to text files everything.

maybe i'm just dumb, if so then i guess i'm just wasting my time.
August 5, 2004, 6:22 PM
LW-Falcon
Or maybe you should actually learn the language first before making a bot?
August 5, 2004, 6:25 PM
bethra
[quote author=Falcon[anti-yL] link=board=17;threadid=8030;start=0#msg74208 date=1091730350]
Or maybe you should actually learn the language first before making a bot?
[/quote]

I know the basics of vb6 and probably more. C++ was just the class i refered to... they don't offer vb6 classes ofc.

like i said, I'm not coming in here totally unprepared. I even have bought a book like ppl have suggested to others. I know the basics and probably more. :\

I'm not a total noob :\ sigh

I can make a bot easily with CSB but that is not what i want to not use! i feel that it is even lamer to use CSB than ask for a working example of code.

i can make a bot probably just as good as veebers triviabot, but what does that use? CSB. The ez way out, Nothing would be accomplished if I just used CSB. If i can't get any help with a packet then perhaps I should just give up, b/c for ffs i'm not using CSB!
August 5, 2004, 6:36 PM
PaiD
[code]
Public Sub Send0x50()
frmMain.sckBNCS.SendData Chr$(1)
With PBuffer
.InsertDWORD &H0
.InsertNonNTString "68XI" & StrReverse(BNCS.Product)
.InsertDWORD "&H" & Hex(VerByte)
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertNTString "USA"
.InsertNTString "United States"
.SendBNCS SID_AUTH_INFO
.InsertDWORD &H0
.SendBNCS SID_PING
End With
End Sub
[/code]

This is what I use
For the Product I Store it as STAR or SEXP
August 5, 2004, 7:14 PM
Flame
Instead of just asking for a working example, try doing it yourself, and if you run into problems ask for help. People will be more likely to help you with things that you've attempted, and can show that you've attempted, rather than just give out free code. This has been discussed MANY times, so also try using the Search feature for help.
August 5, 2004, 7:26 PM
bethra
Ok, here is my code, very simple and basically is just giving me feedback. I'm also using DarkMinion's packet buffer.

[code]
'// fires when form is loaded
Sub Form_Load()
'// nothing here
'// lstDebug - ist I use to just let me know what is happening
'// ws - name of the winsock object

End Sub

'// menu event fired when clicked
Private Sub mnuConnect_Click()

Dim wsHost As String
Dim wsPort As Long

wsHost = "useast.battle.net" '// host
wsPort = 6112 '// port

'// make connection...
ws.Connect wsHost, wsPort

End Sub

'// menu event fired when clicked
Private Sub mnuDisconnect_Click()

'// closes the winsock, ws
ws.Close
'// clears the debug list
lstDebug.Clear

End Sub

'// fires when a connection is made
Private Sub ws_Connect()

'// shows me that the connection was successful
lstDebug.AddItem "Successfully Connected!"

'// calls Private Sub SID_AUTH_INFO
SID_AUTH_INFO

End Sub

'// winsock event that fires when a packet has been sent
Private Sub ws_SendComplete()

'// shows me that the packet has been sent
lstDebug.AddItem "Packet has been sent."

End Sub

'// winsock event that fires when data is recieved
Private Sub ws_DataArrival(ByVal bytesTotal As Long)

'// shows me that data from the server has been recieved/arrived
lstDebug.AddItem "Data Recieved!"

End Sub

'// winsock event that fires when the connection has been terminated
Private Sub ws_Close()

'// shows me that the connection has been terminated/disconnected
lstDebug.AddItem "Disconnected!"

End Sub

'// assembles SID_AUTH_INFO (0x50) bnet packet
Private Sub SID_AUTH_INFO()

'// create a packetbuffer object named PBuf
Dim PBuf As PacketBuffer
'// Make PBuf a new packetbuffer
Set PBuf = New PacketBuffer

'// with statement using the PBuf object
With PBuf
.InsertDWORD 0 '// Protocol ID. Always 0.
.InsertNonNTString "68XI" '// Platform ID. 'IX86'
.InsertNonNTString "RATS" '// Product ID. 'STAR'
.InsertDWORD &HC9 '// Version byte.
.InsertDWORD 0 '// Product language.*
.InsertDWORD 0 '// Local IP, for NAT compatibility.*
.InsertDWORD 0 '// Time zone.*
.InsertDWORD 0 '// Locale ID.*
.InsertDWORD 0 '// Language ID.*
.InsertNTString "USA" '// Country abbreviation. "USA"
.InsertNTString "United States" '// Country name.
.SendPacket ws, &H50 '// Send packet.
'// ws = winsock
'// &H50 (0x50) = Packet ID
End With
End Sub
[/code]

After clicking the mnuConnect. This is what I get in the lstDebug.
[quote]
Successfully Connected!
Packet has been sent.
Disconnected!
[/quote]

There must be something wrong with the packet else Bnet would return a packet and I would see:
[quote]
Successfully Connected!
Packet has been sent.
Data Recieved!
Disconnected!
[/quote]

....
August 5, 2004, 8:19 PM
Myndfyr
Just out of curiousity.... Why are you using // after the ' comment delimiter?

It really just looks funny.... I'm not saying that there's anything wrong with it, but VB programmers unfamiliar with C++-style comments might say, "what's that?"
August 5, 2004, 8:25 PM
Tuberload
[quote author=Myndfyre link=board=17;threadid=8030;start=0#msg74228 date=1091737548]
Just out of curiousity.... Why are you using // after the ' comment delimiter?

It really just looks funny.... I'm not saying that there's anything wrong with it, but VB programmers unfamiliar with C++-style comments might say, "what's that?"
[/quote]

My guess would be personal preference.
August 5, 2004, 8:28 PM
bethra
[quote author=DueL link=board=17;threadid=8030;start=0#msg74217 date=1091733260]
[code]
Public Sub Send0x50()
frmMain.sckBNCS.SendData Chr$(1)
With PBuffer
.InsertDWORD &H0
.InsertNonNTString "68XI" & StrReverse(BNCS.Product)
.InsertDWORD "&H" & Hex(VerByte)
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertNTString "USA"
.InsertNTString "United States"
.SendBNCS SID_AUTH_INFO
.InsertDWORD &H0
.SendBNCS SID_PING
End With
End Sub
[/code]

This is what I use
For the Product I Store it as STAR or SEXP
[/quote]

Hmm what is the buffer class u are using?

@mynd
Its more easy on the eyes? I mean it helps make the comments stand out more for me. I've also seen other peeps u it and I find that their way of doing is something that suits me better to. I learned basic C++ before I VB so I kind of am more... well hard to explain.
August 5, 2004, 8:28 PM
Stealth
Before you send 0x50, you need to send a single Chr(1) to the server to show it you're using a binary game client. That little tidbit is hidden at the top of the code that was posted.
August 5, 2004, 8:44 PM
PaiD
I'm also using DarkMinion's packet buffer.
I just renamed SendPacket to SendBNCS and added some other protocals into it
August 5, 2004, 8:49 PM
bethra
Ok I added the Chr$(1)

[code]
'// assembles SID_AUTH_INFO (0x50) bnet packet
Private Sub SID_AUTH_INFO()

'// create a packetbuffer object named PBuf
Dim PBuf As PacketBuffer
'// Make PBuf a new packetbuffer
Set PBuf = New PacketBuffer

ws.SendData Chr$(1)

With PBuf
.InsertDWORD &H0 '// Protocol ID. Always 0.
.InsertNonNTString "68XI" & "RATS" '// Platform ID. 'IX86'
'.InsertNonNTString "RATS" '// Product ID. 'STAR'
.InsertDWORD &HC9 '// Version byte. Starcraft
.InsertDWORD &H0 '// Product language.*
.InsertDWORD &H0 '// Local IP, for NAT compatibility.*
.InsertDWORD &H0 '// Time zone.*
.InsertDWORD &H0 '// Locale ID.*
.InsertDWORD &H0 '// Language ID.*
.InsertNTString "USA" '// Country abbreviation. "USA"
.InsertNTString "United States" '// Country name. "United States"
.SendPacket ws, &H50 '// Send packet.
'// ws = winsock
'// &H50 (0x50) = Packet ID
End With

End Sub
[/code]

IT WORKS OMG OMG OMG OMG =D

Thanks very much all of you who helped! Especially DeuL <3
August 5, 2004, 9:39 PM
iago
OMG!!!


But seroiusly, things like BNetDocs and botdev forums take all the creativity out of it. I personally got that packet, originally, by packetlogging (with Ethereal, which I found using Google) and looking at it, then recreating it byte-by-byte in VB (&h00 & &h2f & ....etc.). It feels like much more of an accomplishment to do it like that.
August 5, 2004, 10:00 PM
Eli_1
I did it byte by byte the first time I sent 0x50, also. That will only get you so far though. :P
August 6, 2004, 1:19 AM
St0rm.iD
Bethra, you're okay, it looks as if you're trying to figure it out. You're okay with me.

[quote author=bethra link=board=17;threadid=8030;start=0#msg74209 date=1091730970]
[quote author=Falcon[anti-yL] link=board=17;threadid=8030;start=0#msg74208 date=1091730350]
Or maybe you should actually learn the language first before making a bot?
[/quote]

I know the basics of vb6 and probably more.
...
I know the basics and probably more. :\

I'm not a total noob :\ sigh
[/quote]

Well, for future reference for all fledgling bot developers, making a battle.net binary bot generally requires many skills. A b.net binary bot is a VERY complex piece of software. Generally, you'll need a strong knowledge of:

- data structures
- networking, specifically tcp/ip
- file i/o, especially fast, binary i/o
- program architecture, OOA/D
- profiling/debugging
- security
- reverse engineering x86 windows code
- decompiling VC++-generated code into pseudocode
- interpreting binary numbers read from a packet logger

Of course, now that we have csb/bnls/mystolen.dll, we don't need to know a lot of this stuff.
August 6, 2004, 2:33 AM
ChR0NiC
[quote author=Eli_1 link=board=17;threadid=8030;start=15#msg74256 date=1091755189]
I did it byte by byte the first time I sent 0x50, also. That will only get you so far though. :P
[/quote]

My "very" first time recreating SID_AUTH_INFO I copy and pasted :P, but now I know the whole packet off by heart, I do most packets now by packet logging. Which is much better practice, because you're screwed if you run into a packet that has no documentation.
August 6, 2004, 6:53 AM
LordNevar
Like 0xAE, and 0x67 lol
August 6, 2004, 1:01 PM
tA-Kane
[quote author=bethra link=board=17;threadid=8030;start=0#msg74203 date=1091729764]I'm not trying to steal a project or anything. I just need an example of a working bnet packet...

I was taught in my hs c++ class that by looking at code you can interpret and learn from it. all i'm trying to do is get something to learn from. i thought that computer programming was something i wanted to do. the past 3 years i've been planning to major in computer science.

i thought that by seeing working code of a packet i could use it as a reference, learn, interpret it on my own.[/quote]

IMO, Bethra, you should have posted that in your first post. You might not have gotten such a nasty response.

But, I just wanted to let you know, anyone who's truly capable of writing a bot today needs no help at all, only information.

All they would need is to know where the information is at.

To look up the networking and interfacing functions, a Windows programmer would need MSDN (http://msdn.microsoft.com).

After that, just about every single bit of OTHER information you need is stored in BnetDocs (http://bnetdocs.valhallalegends.com). From there, you can access information regarding the BNLS packets (necessary if you don't want to have the troublesome hashfiles with your program), which are packets sent to a third party server to do version checking and password hashing. Also, there's information on the BNCS packets, which are the actual packets sent to Battle.net. Even basic packets for Battle.net's Diablo 2 Master Control Program (MCP for short) packets are there, so you're capable of logging onto Diablo 2 or Lord of Destruction and then logging into a character (or even creating one).

A person truly capable of writing a bot today would only need to take the information and "connect the dots". Anyone else does not belong here. For example, if you don't know how to get verious types of data sent correctly over the network (it doesn't matter if you use a structure or send each parameter individually, or hey... each byte individually), you don't belong here. If you're not capable of fixing your own code, you don't belong here.

Of course, there are a few instances where the documentation is confusing or nonexistant... or sometimes even wrong. That's when you should ask for help.
August 6, 2004, 7:28 PM
ChR0NiC
[quote author=LordNevar link=board=17;threadid=8030;start=15#msg74320 date=1091797276]
Like 0xAE, and 0x67 lol
[/quote]

I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.
August 6, 2004, 7:29 PM
UserLoser.
[quote author=ChR0NiC link=board=17;threadid=8030;start=15#msg74362 date=1091820553]
I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.
[/quote]

You can't count to 174?
August 6, 2004, 8:05 PM
ChR0NiC
[quote author=ChR0NiC link=board=17;threadid=8030;start=15#msg74362 date=1091820553]
I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.
[/quote]

[quote author=UserLoser. link=board=17;threadid=8030;start=15#msg74380 date=1091822732]
You can't count to 174?
[/quote]

I meant I have never heard it referred to as a valid BNCS/BNLS packet. And I have never encountered this packet ever, so it's a complete mystery to me.
August 6, 2004, 9:51 PM
LordNevar
There D2 LOD Game Packets for creating games on the realms. Refers to starting the game.
August 6, 2004, 10:06 PM
shout
Just my 2 cents, but the only reason I decided to undergo a Battle.net bot project was to learn how to program. I have learned much more about programming by trying to create my bot (which is not very far along at all) then any books or tutorials.

Besides, there is no real reason to create a battle.net bot, there are hundreds to choose from and alot of them are very good.

Edit: You also need to send the Product Language. enUS I think.
August 7, 2004, 6:26 PM

Search