Advertisement
Guest User

Untitled

a guest
May 28th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1.     public partial class Form1 : Form
  2.     {
  3.         public string server = "74.86.170.188";//"us1.auth.garena.com";
  4.         public int port = 8687;//7456;
  5.         private Socket socket;
  6.         public Form1()
  7.         {
  8.             InitializeComponent();
  9.             socket = ConnectSocket(server, port);
  10.         }
  11.  
  12.         private static Socket ConnectSocket(string server, int port)
  13.         {
  14.             Socket s = new TcpClient().Client;
  15.             s.Connect(server, port);
  16.             return s;
  17.         }
  18.         private void button1_Click(object sender, EventArgs e)
  19.         {
  20.             byte[] receive = new byte[1040];
  21.             byte[] packet0 = File.ReadAllBytes(@"./joinroom_3.ga");
  22.             byte[] packet1 = File.ReadAllBytes(@"./joinroom_login.ga");
  23.             byte[] packet2 = File.ReadAllBytes(@"./joinroom_3-czsk1.ga");
  24.             socket.Send(packet0, packet0.Length, SocketFlags.None);
  25.             socket.Send(packet1, packet1.Length, SocketFlags.None);
  26.             socket.Send(packet2, packet2.Length, SocketFlags.None);
  27.             socket.Receive(receive);
  28.             foreach (byte r in receive)
  29.                 textBox1.Text += r.ToString();
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement