Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace WebRecorder
- {
- class Program
- {
- public static System.Net.Sockets.TcpListener tcpListener = new System.Net.Sockets.TcpListener(System.Net.IPAddress.Parse("127.0.0.1"), 80);
- public static byte[] buffer = new byte[1024 * 8];
- static void Main(string[] args)
- {
- tcpListener.Start();
- while (true)
- {
- System.Net.Sockets.TcpClient tcpClient = tcpListener.AcceptTcpClient();
- // Read the data stream from the client.
- System.Net.Sockets.NetworkStream stream = tcpClient.GetStream();
- int len = stream.Read(buffer, 0, buffer.Length);
- tcpClient.Close();
- byte[] trimmed = new byte[len];
- Buffer.BlockCopy(buffer, 0, trimmed, 0, len);
- File.WriteAllBytes("dump.bin", trimmed);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement