MMORPG Core - Deutsche Community für Online Rollenspiele - Powered by vBulletin

  • AAA
  • Aggressive
  • Alienated
  • Amazed
  • Amused
  • Angelic
  • Angry
  • Apelike
  • Artistic
  • Asleep
  • Balanced
  • Banhappy
  • Bashful
  • Bitchy
  • Blah
  • Bookworm
  • Bored
  • Breezy
  • Brooding
  • Busy
  • Buzzed
  • Chatty
  • Cheeky
  • Cheerful
  • Cloud 9
  • Cold
  • Coldturkey
  • Confused
  • Cool
  • Crappy
  • Creative
  • Curious
  • Cynical
  • Daring
  • Dead
  • Depressed
  • Devilish
  • Disagree
  • Doh
  • Doubtful
  • Dramaqueen
  • Dreaming
  • Drunk
  • Elated
  • Energetic
  • Fiendish
  • Fine
  • Flirty
  • Gloomy
  • Goofy
  • Grumpy
  • Happy
  • Horny
  • Hot
  • Hungover
  • In Love
  • Innocent
  • Inpain
  • Insomnious
  • Inspired
  • Lonely
  • Lucky
  • Lurking
  • Mellow
  • Mischievious
  • Mondayblues
  • Musical
  • Nerdy
  • Notamused
  • Notworthy
  • Paranoid
  • Pensive
  • Predatory
  • Procrastinating
  • Psychedelic
  • Question
  • Relaxed
  • Roflmao
  • Sad
  • Scared
  • Scurvy
  • Shocked
  • Sick
  • Sleepy
  • Sluggish
  • Sneaky
  • Snobbish
  • Spaced
  • Spooky
  • Sporty
  • Starving
  • Stressed
  • Sunshine
  • Sweettooth
  • Thinking
  • Tired
  • Torn
  • Twisted
  • Veggedout
  • Volatile
  • Woot
  • Worried
  • Yeehaw
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • DDos
  • Tweet   
    Ergebnis 1 bis 2 von 2
    1. #1
      Delphi
       
      Avatar von ichbinniemand
      Registriert seit
      Jul 2009
      Beiträge
      966
      Danke
      24
      Danke erhalten: 164

      Standard Theoretischer Paketfixer

      Die Werbung stört? Registriere dich hier!
      ich habe einen noch ungetesteten paket fixxer source rumliegen
      es ist nur die grundstrucktur sachen wie an clienten posten etc müsst ihr noch selbst machen
      ich habe keinen plan ob es überhaupt funktioniert nie getestet

      VB:
      Code:
      Imports System.Net.Sockets
      Imports System.Net
      Module Module1
          Dim Connections As List(Of Integer)
          Sub Main()
              Connections = New List(Of Integer)
              Dim Lines() As String = IO.File.ReadAllLines(My.Application.Info.DirectoryPath + "\Config.txt")
              Dim port As Integer = Lines(1)
              Dim ServerPort As Integer = Lines(3)
              Dim ServerAdress As Integer = Lines(5)
              Dim Server As New Sockets.TcpListener(IPAddress.Any, port)
              Dim ServerClient As Sockets.TcpClient
              Dim ClientClient As Sockets.TcpClient
              Server.Start()
              While 1 < 12948
                  ClientClient = Server.AcceptTcpClient
                  ServerClient = New Sockets.TcpClient
                  ServerClient.Connect(ServerAdress, ServerPort)
                  If ClientClient.Connected And ServerClient.Connected Then
                      Dim id As Integer
                      While 1204 > 120
                          If Connections.Contains(id) Then
                              id += 1
                          Else
                              Exit While
                          End If
                      End While
                      Connections.Add(id)
                      Dim h As New handleClient(ClientClient, ServerClient, id)
                  End If
              End While
          End Sub
          Private Sub SendBytesToClient(ByVal buffer As Byte())
      
          End Sub
          Class handleClient
              Private Id As Integer
              Private ClientSocket As Sockets.TcpClient
              Private ServerSocket As Sockets.TcpClient
              Dim Packets As String()
              Sub New(ByVal CClient As Sockets.TcpClient, ByVal SClient As Sockets.TcpClient, ByVal id As Integer)
                  Packets = IO.File.ReadAllLines(My.Application.Info.DirectoryPath + "\Packets.txt")
                  ClientSocket = CClient
                  ServerSocket = SClient
                  Dim ClientThead As Threading.Thread = New Threading.Thread(AddressOf Filter)
                  ClientThead.Start()
              End Sub
              Sub Filter()
                  Dim CNS As NetworkStream = ClientSocket.GetStream()
                  Dim SNS As NetworkStream = ServerSocket.GetStream()
                  While 1029 > 1020
                      Try
                          Dim bytesFrom(10024) As Byte
                          CNS.Read(bytesFrom, 0, CInt(ClientSocket.ReceiveBufferSize))
                          Dim blacklisted As Boolean = False
                          For Each p As String In Packets
                              Dim HexCode As String = ""
                              For Each b As Byte In bytesFrom
                                  HexCode += Hex(b)
                              Next
                              blacklisted = (HexCode = p)
                          Next
                          If blacklisted = True Then
                              Continue While
                          Else
                              SNS.Write(bytesFrom, 0, bytesFrom.Count)
                          End If
                      Catch
                          CNS.Close()
                          SNS.Close()
                          ClientSocket.Close()
                          ServerSocket.Close()
                          For Each s As Integer In Connections
                              If s = Id Then
                                  Connections.Remove(s)
                              End If
                              Exit While
                          Next
                          Exit While
                      End Try
                  End While
              End Sub
          End Class
      End Module
      c#(habs grad durch den converter gejagt:
      Code:
      using Microsoft.VisualBasic;
      using System;
      using System.Collections;
      using System.Collections.Generic;
      using System.Data;
      using System.Diagnostics;
      using System.Net.Sockets;
      using System.Net;
      static class Module1
      {
      	static List<int> Connections;
      	public static void Main()
      	{
      		Connections = new List<int>();
      		string[] Lines = System.IO.File.ReadAllLines(My.Application.Info.DirectoryPath + "\\Config.txt");
      		int port = Lines[1];
      		int ServerPort = Lines[3];
      		int ServerAdress = Lines[5];
      		System.Net.Sockets.TcpListener Server = new System.Net.Sockets.TcpListener(IPAddress.Any, port);
      		System.Net.Sockets.TcpClient ServerClient = null;
      		System.Net.Sockets.TcpClient ClientClient = null;
      		Server.Start();
      		while (1 < 12948) {
      			ClientClient = Server.AcceptTcpClient();
      			ServerClient = new System.Net.Sockets.TcpClient();
      			ServerClient.Connect(ServerAdress, ServerPort);
      			if (ClientClient.Connected & ServerClient.Connected) {
      				int id = 0;
      				while (1204 > 120) {
      					if (Connections.Contains(id)) {
      						id += 1;
      					} else {
      						break; // TODO: might not be correct. Was : Exit While
      					}
      				}
      				Connections.Add(id);
      				handleClient h = new handleClient(ClientClient, ServerClient, id);
      			}
      		}
      	}
      
      	private static void SendBytesToClient(byte[] buffer)
      	{
      	}
      	public class handleClient
      	{
      		private int Id;
      		private System.Net.Sockets.TcpClient ClientSocket;
      		private System.Net.Sockets.TcpClient ServerSocket;
      		string[] Packets;
      		public handleClient(System.Net.Sockets.TcpClient CClient, System.Net.Sockets.TcpClient SClient, int id)
      		{
      			Packets = System.IO.File.ReadAllLines(My.Application.Info.DirectoryPath + "\\Packets.txt");
      			ClientSocket = CClient;
      			ServerSocket = SClient;
      			System.Threading.Thread ClientThead = new System.Threading.Thread(Filter);
      			ClientThead.Start();
      		}
      		public void Filter()
      		{
      			NetworkStream CNS = ClientSocket.GetStream();
      			NetworkStream SNS = ServerSocket.GetStream();
      			while (1029 > 1020) {
      				try {
      					byte[] bytesFrom = new byte[10025];
      					CNS.Read(bytesFrom, 0, Convert.ToInt32(ClientSocket.ReceiveBufferSize));
      					bool blacklisted = false;
      					foreach (string p in Packets) {
      						string HexCode = "";
      						foreach (byte b in bytesFrom) {
      							HexCode += Conversion.Hex(b);
      						}
      						blacklisted = (HexCode == p);
      					}
      					if (blacklisted == true) {
      						continue;
      					} else {
      						SNS.Write(bytesFrom, 0, bytesFrom.Count);
      					}
      				} catch {
      					CNS.Close();
      					SNS.Close();
      					ClientSocket.Close();
      					ServerSocket.Close();
      					foreach (int s in Module1.Connections) {
      						if (s == Id) {
      							Module1.Connections.Remove(s);
      						}
      						break; // TODO: might not be correct. Was : Exit While
      					}
      					break; // TODO: might not be correct. Was : Exit While
      				}
      			}
      		}
      	}
      }
      vllt kann einer was damit anfangen
      Zitat Zitat von Steve Jobs
      Stay hungry - stay foolish.


    2. #2
      Weiter so!
       
      Avatar von Amaru
      Registriert seit
      Dec 2010
      Beiträge
      187
      Danke
      42
      Danke erhalten: 34

      Standard

      @ichbiniemand

      Coole Sache werde es mal versuchen zum laufen zu bekommen !


      Lg. Amaru


      ]
      *~Mein Ziel Hier~*
      [10] [50] [100] [200] [300] [500]
      Tutorials ?

    Lesezeichen

    Berechtigungen

    • Neue Themen erstellen: Nein
    • Themen beantworten: Nein
    • Anhänge hochladen: Nein
    • Beiträge bearbeiten: Nein
    •