• Welcome to Valhalla Legends Archive.
 

[VB6] Working SID_AUTH_INFO Code please

Started by Sorc.Polgara, August 05, 2004, 12:04 PM

Previous topic - Next topic

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.
- Stealth
Author of StealthBot

PaiD

I'm also using DarkMinion's packet buffer.
I just renamed SendPacket to SendBNCS and added some other protocals into it

Sorc.Polgara

#17
Ok I added the Chr$(1)


'// 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


IT WORKS OMG OMG OMG OMG  =D

Thanks very much all of you who helped!  Especially DeuL <3

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Eli_1

I did it byte by byte the first time I sent 0x50, also. That will only get you so far though.  :P

Banana fanna fo fanna

Bethra, you're okay, it looks as if you're trying to figure it out. You're okay with me.

Quote from: bethra on August 05, 2004, 01:36 PM
Quote from: Falcon[anti-yL] on August 05, 2004, 01:25 PM
Or maybe you should actually learn the language first before making a bot?

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

I'm not a total noob :\ sigh

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.

ChR0NiC

Quote from: Eli_1 on August 05, 2004, 08:19 PM
I did it byte by byte the first time I sent 0x50, also. That will only get you so far though.  :P

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.

LordNevar


A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

tA-Kane

Quote from: bethra on August 05, 2004, 01:16 PMI'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.

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.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

ChR0NiC

Quote from: LordNevar on August 06, 2004, 08:01 AM
Like 0xAE, and 0x67 lol

I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.

UserLoser.

Quote from: ChR0NiC on August 06, 2004, 02:29 PM
I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.

You can't count to 174?

ChR0NiC

Quote from: ChR0NiC on August 06, 2004, 02:29 PM
I've never heard of 0xAE, but 0x67 is just a friend update isn't it? Pretty straight forward actually.

Quote from: UserLoser. on August 06, 2004, 03:05 PM
You can't count to 174?

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.

LordNevar

There D2 LOD Game Packets for creating games on the realms. Refers to starting the game.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

shout

#28
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.