Valhalla Legends Forums Archive | Visual Basic Programming | New to 'Packets'

AuthorMessageTime
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!
April 28, 2004, 8:23 PM
synth
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
April 28, 2004, 8:30 PM
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
April 28, 2004, 8:35 PM
Myndfyr
[quote author=dodge link=board=31;threadid=6525;start=0#msg57324 date=1083184540]
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
[/quote]

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.
April 28, 2004, 10:14 PM
Eli_1
[code]
With Winsock
.RemoteHost = "USEast.Battle.Net"
.RemotePort = "6112"
.Connect
End With[/code]

Lol, Mynd... :P
April 28, 2004, 10:18 PM
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):

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

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.
April 29, 2004, 6:35 PM
Eli_1
You would first have to call Winsock.Connect. Then in the Winsock_Connect(...) event you went send that with the SendData command.
April 29, 2004, 6:54 PM
iago
[quote author=Eli_1 link=board=31;threadid=6525;start=0#msg57588 date=1083264841]
You would first have to call Winsock.Connect. Then in the Winsock_Connect(...) event you went send that with the SendData command.
[/quote]

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 :)
April 29, 2004, 7:18 PM
CodeMaster
[quote author=dodge link=board=31;threadid=6525;start=0#msg57321 date=1083183817]
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]

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
[/quote]

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
[/quote]

That is the basic structure of a BNLS Packet, once you understand what each of those types are, it's a piece of cake.
May 1, 2004, 7:21 PM
iago
He didn't ask for Battle.net packets, not everybody here is writing a bot.
May 1, 2004, 9:14 PM
Maddox
[quote author=iago link=board=31;threadid=6525;start=0#msg57583 date=1083263728]
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):

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

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.
[/quote]

It would probably be better to use HTTP 1.0, that way the data isn't chunked.
May 1, 2004, 9:17 PM
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)

[code]
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......
[/code]
May 19, 2004, 6:31 PM
St0rm.iD
[quote author=Networks link=board=31;threadid=6525;start=0#msg60823 date=1084991503]
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)

[code]
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......
[/code]
[/quote]

3

2nd byte

is it null terminated (end with a 00)?
May 23, 2004, 1:39 PM
Dyndrilliac
[quote author=St0rm.iD link=board=31;threadid=6525;start=0#msg61338 date=1085319568]
[quote author=Networks link=board=31;threadid=6525;start=0#msg60823 date=1084991503]
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)

[code]
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......
[/code]
[/quote]

3

2nd byte

is it null terminated (end with a 00)?
[/quote]

Where do you get 3? I only see 2
May 23, 2004, 2:07 PM
St0rm.iD
i have no idea why i said that...
May 23, 2004, 10:29 PM
Grok
[quote author=Networks link=board=31;threadid=6525;start=0#msg60823 date=1084991503]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.[/quote]

Networks, I would strongly suggest you practice programming the fundamentals. For example, can you do the following?

* Read the first line of text from a file.
* Read the Nth line of text from a file.
* Read N lines from a file.
* Find a string within a file.
* Count the occurences of a string within a file.
* Write text lines to a new file.
* Append a new line to a text file.
* Replace all occurences of a string within a file.

* Read INI files.
* Write INI files.

* Open a binary file.
* Read all data from a binary file in blocks.
* Find specific bytes of data in a binary file.
* Write a new record to a binary file.
* Overwrite a specific record in a binary file.
* Find and replace specific fields in all records of a binary file.
* * where some condition is true about that record.

* Open an Access database.
* Open a table and walk through a table.
* Read data from the columns into your program.
* Change data in a table.
* Append new records to a table.

* Create a status bar on your VB form. (style=Simple)
* Update the SimpleText on your status bar as conditions change in your program.
* Create a normal style status bar with 3 panels.
* Add a date panel, clock panel, caps lock panel, numlock panel, to your status bar.
* Write program status to the 3rd panel that is not one of the special panels.
* Add graphics and icons to the status bar panels.

* Add a menu to your form.
* Add commands for your program's abilities to the menu.
* Have menu items that turn features on/off with checkmarks showing their status.

* Add a toolbar to your form with 10 buttons.
* Have each button invoke one of your program procedures.
* Map each button to a menu item.

* Allow user to resize your form, and it resizes all the controls on it to fit the new size.
* If a parent control gets resized, any child controls inside it also get resized to fit.

* Use a treeview
* Let users left-click and right-click on your nodes to do functions.

* All controls have a popup menu when user right-clicks on them, if any action can be performed.

Those are some suggestions. Learn how to do most of those before worrying about advanced controls like Winsock.
May 24, 2004, 1:01 AM
St0rm.iD
Write mergesort.
May 24, 2004, 7:57 PM
iago
[quote author=St0rm.iD link=board=31;threadid=6525;start=15#msg61594 date=1085428662]
Write mergesort.
[/quote]

Too easy - shellsort is better :)
May 24, 2004, 9:27 PM
St0rm.iD
monte carlo!
May 25, 2004, 12:01 AM
Dyndrilliac
[quote author=Skywing[vL] link=board=31;threadid=6525;start=15#msg61645 date=1085443315]
monte carlo!
[/quote]

Off topic, but, is it me, or do my eyes decieve me? Storm's Username is "Skywing[vL]".
May 26, 2004, 3:33 AM
St0rm.iD
m3 = t3h h4x
May 27, 2004, 1:10 AM

Search