public FileReader(PacketContainer pc, int port) { this.port = port; this.packetContainer = pc; this.gameSniffer = new L2GameSniffer(); this.clientStr = new L2PacketStream(); this.serverStr = new L2PacketStream(); }
/// <summary> /// Stellt eine Klasse da die das Sniffen von Packets regelt /// </summary> /// <param name="pc">Der PacketContainer dem die Packete hinzugefügt werden sollen</param> /// <param name="port">Der Port auf den der TCPStreamAssembler horchen soll</param> public SnifferControl(PacketContainer pc, int port) { this.port = port; this.packetContainer = pc; this.gameSniffer = new L2GameSniffer(); this.clientStr = new L2PacketStream(); this.serverStr = new L2PacketStream(); // TODO: wenn keine devices gefunden wurden, Meldung }
public FilterForm(PacketContainer pc, KnownPackets kp) { InitializeComponent(); this.pc = pc; this.kp = kp; if (pc != null) this.refresh(); }
private void toolStripButtonNewCapture_Click(object sender, EventArgs e) { this.packetContainer = new PacketContainer(); this.sniffer = new SnifferControl(this.packetContainer, this.devicesForm.GetPort()); this.sniffer.Init(this.devicesForm.GetDevice(), ("port " + this.devicesForm.GetPort())); this.sniffer.Start(); this.fillListbox(this.packetContainer.DisplayedPackets); this.toolStripButtonStopCatpure.Enabled = true; this.toolStripButtonNewCapture.Enabled = false; this.toolStripButtonListDevices.Enabled = false; this.toolStripButtonOpenFile.Enabled = false; this.openToolStripMenuItem.Enabled = false; this.hexBox1.ByteProvider = null; // Event Anmelden this.sniffer.NewPacketArrived += new SnifferControl.NewPacketHandler(packethandler_onPacketAdded); this.sniffer.OnSynRecived += new SnifferControl.SynRecivedEventHandler(sniffer_OnSynRecived); this.sniffer.OnFinRecived += new SnifferControl.FinRecivedEventHandler(sniffer_OnFinRecived); this.ChangeStatusLabel("Waiting for Connection", Color.Black); }
private void serialize(PacketContainer pcon, string filepath) { XmlSerializer s = new XmlSerializer(typeof(PacketContainer)); TextWriter w = new StreamWriter(filepath); s.Serialize(w, pcon); w.Close(); }
private void openFile() { DialogResult res = this.openFileDialog1.ShowDialog(this); this.packetContainer = null; // Dateierweiterung Checken if (Path.GetExtension(this.openFileDialog1.FileName).ToLower().Equals(".pcap") && res == DialogResult.OK) { this.packetContainer = new PacketContainer(); this.settingsForm.ShowDialog(this); this.pcapReader = new FileReader(this.packetContainer, this.settingsForm.GetPort()); this.pcapReader.ReadPcapFile(this.openFileDialog1.FileName); } else if (Path.GetExtension(this.openFileDialog1.FileName).ToLower().Equals(".l2ps") && res == DialogResult.OK) { this.packetContainer = this.deSerialize(this.openFileDialog1.FileName); } else if (res == DialogResult.OK) { MessageBox.Show("File not supported"); return; } else { return; } this.packetContainer.applyFilter(); this.fillListbox(this.packetContainer.DisplayedPackets); this.hexBox1.ByteProvider = null; }