• Welcome to Valhalla Legends Archive.
 

New to 'Packets'

Started by dodge, April 28, 2004, 03:23 PM

Previous topic - Next topic

dodge

Could someone explain how packets work, or post a link. I knew to this VB thing.. and interested. I'm searching on google right now but not much luck. I think I know how they work but mostlikely not.

THEORY

You send packets threw a winsock

Yep that's it, if I'm right thats all I know, oh wait I can add a winsock onto a project file!

synth

#1
Try:

http://www.dark-wire.net/exile/members/tutorials.php?view=7

The best thing to do is to play around with things until they work (and you understand why it works, any errors, etc).  

I would recommend limiting exposure to source from other bots.  Don't depend on the work of someone else to connect.  However, for example, say you're looking for a way to find the bitrate of a MP3 file.  There's plenty of code (and documentation) on such sites as PSCode to use and learn from.

I'm not an expert, but I enjoy spending my time playing around with my code.  You might sometimes be frustrated if something doesn't work as planned, but in the end it's always a flaw in the code - it may be hours, days, or weeks before you can find an error, and it also could be something very trivial.  Have patience and be willing to spend much time on it, if you're serious about it.

Edit:

I forgot, Feanor's tutorial uses DarkMinion's PacketBuffer class.

Here's a link:

http://botdev.valhallalegends.com/documents/vbpacketbc.html

dodge

Thanks. Just for your knowledge, I wasn't hoping someone would give me how to connect to BNET threw winsocks, I've been searching a while trying to learn but I figured someone here might have been like "Hey I just saw I site for this dude!" thanks for the help though! ;D

MyndFyre

Quote from: dodge on April 28, 2004, 03:35 PM
Thanks. Just for your knowledge, I wasn't hoping someone would give me how to connect to BNET threw winsocks, I've been searching a while trying to learn but I figured someone here might have been like "Hey I just saw I site for this dude!" thanks for the help though! ;D

Wow.  I've never seen anybody who knows how to connect to Battle.net throw a WinSock.  But then, I guess I've only been posting here for a year or so.

Kinda creepy.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Eli_1


With Winsock
   .RemoteHost = "USEast.Battle.Net"
   .RemotePort = "6112"
   .Connect
End With


Lol, Mynd...  :P

iago

Winsock stands for Windows Sockets, it's an interface that can be used to connect to the rest of the internet.  Winsock can do things such as connect, send data, recieve data, disconnect, and some other stuff that can be confusing.  

The easiest thing to do is put a winsock control on your form, and do the following (and my syntax may be wrong, I haven't done this forever):

ws.RemoteHost = "www.google.com"
ws.RemotePort = "80"
ws.send("GET / http/1.1" + vbcrlf + "Host: www.google.com" + vbcrlf + vbcrlf)


Then put something in Winsock_dataarrival (or whatever it's called) to display the data to a textbox or something.  Unless I screwed up something in my syntax, that should ask google to send its main page back to you.
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

You would first have to call Winsock.Connect. Then in the Winsock_Connect(...) event you went send that with the SendData command.

iago

Quote from: Eli_1 on April 29, 2004, 01:54 PM
You would first have to call Winsock.Connect. Then in the Winsock_Connect(...) event you went send that with the SendData command.

That's true.  I'm used to other languages where Connect() doesn't return until the connection is established.  That, and I forgot to put the Connect() in :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


CodeMaster

Quote from: dodge on April 28, 2004, 03:23 PM
Could someone explain how packets work, or post a link. I knew to this VB thing.. and interested. I'm searching on google right now but not much luck. I think I know how they work but mostlikely not.

THEORY

You send packets threw a winsock

Yep that's it, if I'm right thats all I know, oh wait I can add a winsock onto a project file!

Quote From BNET Docs
Quote
BNCS Headers
BNCS stands for Battle.Net Chat Server and is the protocol that Blizzard's Battle.net enabled games use to communicate. Every BNCS packet has the same header:

(BYTE)      StartPacket - always 0xFF
(BYTE)      Packet ID
(WORD)    Packet length, including this header
(VOID)      Packet Data

That is the basic structure of a Battle.Net packet.


And being that you are very new to programming, you will probably be using BNLS.
Quote
BNLS Headers
BNLS is the Battle.Net Logon Server, and can be used by bot authors to perform the hashing required during a Battle.net logon. It also allows bot authors to obtain useful information such as the current version byte for a game client, and has provisions for BNCS server emulator authors. It has the following headers:
(WORD)    Packet Length, including this header
(BYTE)      Packet ID
(VOID)      Packet Data

That is the basic structure of a BNLS Packet, once you understand what each of those types are, it's a piece of cake.

iago

He didn't ask for Battle.net packets, not everybody here is writing a bot.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Maddox

Quote from: iago on April 29, 2004, 01:35 PM
Winsock stands for Windows Sockets, it's an interface that can be used to connect to the rest of the internet.  Winsock can do things such as connect, send data, recieve data, disconnect, and some other stuff that can be confusing.  

The easiest thing to do is put a winsock control on your form, and do the following (and my syntax may be wrong, I haven't done this forever):

ws.RemoteHost = "www.google.com"
ws.RemotePort = "80"
ws.send("GET / http/1.1" + vbcrlf + "Host: www.google.com" + vbcrlf + vbcrlf)


Then put something in Winsock_dataarrival (or whatever it's called) to display the data to a textbox or something.  Unless I screwed up something in my syntax, that should ask google to send its main page back to you.

It would probably be better to use HTTP 1.0, that way the data isn't chunked.
asdf.

Networks

This is farily old by now I suppose but I'll bring it up again:

I want to learn how to read packet logs and be able to send packets after reading the log correctly. I just need a tutorial or some help. I've seen feanors but I have some questions:

How do you know how many packets are being sent per packet ID, where does it tell you? or Does it?

How do you know what packet to send?

How do you know when to send a string? (InsertNTString, InsertNonNTString )

I am a complete newb at this but I'd like to know how. I'd like to be actually legit at coding bots and to further my programming knowledge. Thanks in advance.

Heres something that you can use an example:
(Feanor's tutorial)


0000 FF 1C 5B 00 00 00 00 00 00 00 00 00 02 00 01 00    ..[.............
0010 1F 00 00 00 00 00 00 00 53 6F 6D 65 47 61 6D 65    ........SomeGame
0020 4E 61 6D 65 00 00 2C 34 34 2C 31 34 2C 36 2C 32    Name..,44,14,6,2
0030 2C 32 2C 31 2C 36 38 36 34 34 37 30 33 2C 34 2C    ,2,1,68644703,4,
0040 2C 6E 65 74 77 6F 72 6B 7A 0D 54 68 65 20 4C 6F    ,networkz.The Lo
0050 73 74 20 54 65 6D 70 6C 65 0D 00 FF 10 04 00      st Temple......

Banana fanna fo fanna

Quote from: Networks on May 19, 2004, 01:31 PM
This is farily old by now I suppose but I'll bring it up again:

I want to learn how to read packet logs and be able to send packets after reading the log correctly. I just need a tutorial or some help. I've seen feanors but I have some questions:

How do you know how many packets are being sent per packet ID, where does it tell you? or Does it?

How do you know what packet to send?

How do you know when to send a string? (InsertNTString, InsertNonNTString )

I am a complete newb at this but I'd like to know how. I'd like to be actually legit at coding bots and to further my programming knowledge. Thanks in advance.

Heres something that you can use an example:
(Feanor's tutorial)


0000 FF 1C 5B 00 00 00 00 00 00 00 00 00 02 00 01 00    ..[.............
0010 1F 00 00 00 00 00 00 00 53 6F 6D 65 47 61 6D 65    ........SomeGame
0020 4E 61 6D 65 00 00 2C 34 34 2C 31 34 2C 36 2C 32    Name..,44,14,6,2
0030 2C 32 2C 31 2C 36 38 36 34 34 37 30 33 2C 34 2C    ,2,1,68644703,4,
0040 2C 6E 65 74 77 6F 72 6B 7A 0D 54 68 65 20 4C 6F    ,networkz.The Lo
0050 73 74 20 54 65 6D 70 6C 65 0D 00 FF 10 04 00      st Temple......


3

2nd byte

is it null terminated (end with a 00)?

Dyndrilliac

Quote from: St0rm.iD on May 23, 2004, 08:39 AM
Quote from: Networks on May 19, 2004, 01:31 PM
This is farily old by now I suppose but I'll bring it up again:

I want to learn how to read packet logs and be able to send packets after reading the log correctly. I just need a tutorial or some help. I've seen feanors but I have some questions:

How do you know how many packets are being sent per packet ID, where does it tell you? or Does it?

How do you know what packet to send?

How do you know when to send a string? (InsertNTString, InsertNonNTString )

I am a complete newb at this but I'd like to know how. I'd like to be actually legit at coding bots and to further my programming knowledge. Thanks in advance.

Heres something that you can use an example:
(Feanor's tutorial)


0000 FF 1C 5B 00 00 00 00 00 00 00 00 00 02 00 01 00    ..[.............
0010 1F 00 00 00 00 00 00 00 53 6F 6D 65 47 61 6D 65    ........SomeGame
0020 4E 61 6D 65 00 00 2C 34 34 2C 31 34 2C 36 2C 32    Name..,44,14,6,2
0030 2C 32 2C 31 2C 36 38 36 34 34 37 30 33 2C 34 2C    ,2,1,68644703,4,
0040 2C 6E 65 74 77 6F 72 6B 7A 0D 54 68 65 20 4C 6F    ,networkz.The Lo
0050 73 74 20 54 65 6D 70 6C 65 0D 00 FF 10 04 00      st Temple......


3

2nd byte

is it null terminated (end with a 00)?

Where do you get 3? I only see 2
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Banana fanna fo fanna

i have no idea why i said that...