Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Pyro

Pages: [1] 2
1
.NET Development / Packets
« on: November 16, 2008, 08:58:33 PM »
When you have a connection established to a remote host, there is a stream of data which you can send information to them, and likewise receive from them, on.

You only have to accept the TcpClient once, after that, you're free to send to and receive from it as you please. In most server apps that I've created, I keep a collection of all of the TcpClients, and add them to it as they come. (when you accept) Then, I usually assign a thread to each of them to listen for the actual data coming from them, receive it, and finally handle it.

To show the similarities between server and client, when the client does Connect(), the server's Pending() changes to true, and the server can then accept the connection in the form on a TcpClient or Socket. After that, any data sent from that client to the server will end up at it's network stream, and can be accessed from client.GetStream().Read().

Also, I rarely use timers in .Net. Threads ftw.

2
.NET Development / Packets
« on: November 16, 2008, 06:37:55 PM »
TcpListener is used for listening for new connections to your computer on a specified port.

It can be setup like this:
Code: [Select]
TcpListener listener = new TcpListener(IPAddress.Any, 1337);Whenever a new connection is pending on it, listener.Pending() will equal true. You can then accept the client (or socket) like this:
Code: [Select]
// Accept as TcpClient.
TcpClient newClient = listener.AcceptTcpClient();
or
Code: [Select]
// Accept as Socket.
Socket newSock = listener.AcceptSocket();

As for receiving data: if you want to receive from a remote host that you have a connection to through a TcpClient, then no, you don't; however, if you want to receive data from an unknown host (one you don't have a connection to) then yes, you need a TcpListener. (see above)

You can read from and write to a NetworkStream directly, you don't need a StreamWriter/Reader, simply stream.Read() and stream.Write().

3
.NET Development / Packets
« on: November 16, 2008, 09:16:15 AM »
A packet buffer is basically a byte array with special functions making it easier to insert different types of data (strings, integers, etc) into it.

For example, the way you would put a string into a byte array would be:
Code: [Select]
byte[] buffer;
string a = "some string";
int t = buffer.Length;
Array.Resize(buffer, t + a.Length + 1);
Encoding.ASCII.GetBytes(a + "\n").CopyTo(buffer, t);
But with a packet buffer:
Code: [Select]
PacketBuf pak = new PacketBuf();
pak.InsertString("some string");

4
.NET Development / Packets
« on: November 15, 2008, 04:29:53 PM »
client = System.Net.Sockets.TcpClient

Yes.

5
.NET Development / Packets
« on: November 15, 2008, 01:22:41 PM »
It's incredibly simple.

Code: [Select]
byte[] data = Encoding.ASCII.GetBytes("ohai");
client.GetStream().Write(data, 0, data.Length);
Code: [Select]
NetworkStream ns = client.GetStream();
byte[] data = new byte[ns.Length];
ns.Read(data, 0, data.Length);

6
News / Warden is back
« on: November 04, 2008, 09:02:57 PM »
Warden runs on all of the games; it always has. Most people think it only runs on StarCraft because that's the only game which it affects users in chat. (bots)

7
News / Warden is back
« on: November 04, 2008, 07:18:12 PM »
Quote from: Zone57
Wow Fail Bot gets around it? Thats awsome.

I have not implemented ANY Warden support AT ALL, but thats just cool.  I'll test this out later, when i get time.
If you haven't implemented any Warden support at all, then it definitely doesn't get past it, and considering that nobody has figured out what the new packet even wants yet, let alone how to get it, I doubt that it would get past it even if you did have support in it.

8
News / Warden is back
« on: November 04, 2008, 03:13:27 PM »
I seriously doubt that.

9
News / Warden is back
« on: November 04, 2008, 12:59:52 PM »
Quote from: Vector
Test for 0x5E in a bot, and see if warden still gets send using that packet ID.
It will. The only thing that changed was the addition of a new request. It still uses the same packet id and format, just with different values.

10
News / Warden is back
« on: November 04, 2008, 12:38:53 PM »
Quote from: Vector
Shadow, the bot expects 0x5E, but now its sending 0x05.
No. There are several Warden packet's, each of them being 0x5E, it's the first byte of the data contained in the packet that determines exactly which one it is, and they made a new one.

11
Vector's Computer Tech Forum / Laptop 2
« on: November 03, 2008, 06:49:01 PM »
I think the only laptops you can find for under $350 are EeePC's. These things are tiny. I could probably fit it in my pocket. They usually have very small hard drives (mine's 2 gigs) and run Linux. (Although you can upgrade to Windows XP if your HD is big enough.)

12
Vector's Computer Tech Forum / Have 2 monitors
« on: November 01, 2008, 11:56:56 PM »
Most computers don't come with the ability to connect multiple monitors unless they have a graphics card separate from the motherboard.

13
Fail Bot / Linking/Networking Fail Bots (Local and Non)
« on: October 31, 2008, 03:46:33 PM »
Quote from: Kat
Hmm sounds like fun! Now if only Stealthbot thought of that!
I'm sure they have, just never had the time to implement such a system. It can be done with scripting, anyways.

14
Vector's Computer Tech Forum / Installation Moving
« on: October 31, 2008, 03:42:40 PM »
The only installer that I'm aware of with a 1-at-a-time limit is the Windows Installer, and that's usually only used with Microsoft products.

15
Vector's Computer Tech Forum / Installation Moving
« on: October 30, 2008, 09:15:20 PM »
You're probably going to find out that it's much easier and less time consuming to just go ahead and re-install them on the other computer. You can directly copy over simple programs, but most games and 'larger' applications require certain files placed in alternate locations, such as the System32 folder, and going around and downloading all of these files individualy would be a very long and tedious process.

Pages: [1] 2