RefreshOpcodes() public méthode

public RefreshOpcodes ( bool pReselect ) : void
pReselect bool
Résultat void
Exemple #1
0
        void ParseImportedFile()
        {
            while (device.Opened)
            {
                RawCapture  packet  = null;
                SessionForm session = null;
                while ((packet = device.GetNextPacket()) != null)
                {
                    if (!started)
                    {
                        continue;
                    }
                    TcpPacket tcpPacket = TcpPacket.GetEncapsulated(Packet.ParsePacket(packet.LinkLayerType, packet.Data));
                    if (tcpPacket == null)
                    {
                        continue;
                    }

                    if ((tcpPacket.SourcePort < Config.Instance.LowPort || tcpPacket.SourcePort > Config.Instance.HighPort) &&
                        (tcpPacket.DestinationPort < Config.Instance.LowPort || tcpPacket.DestinationPort > Config.Instance.HighPort))
                    {
                        continue;
                    }
                    this.Invoke((MethodInvoker) delegate {
                        try
                        {
                            if (tcpPacket.Syn && !tcpPacket.Ack)
                            {
                                session = NewSession();
                                var res = session.BufferTCPPacket(tcpPacket, packet.Timeval.Date);
                                if (res == SessionForm.Results.Continue)
                                {
                                    session.Show(mDockPanel, DockState.Document);
                                }
                            }
                            else if (session != null && session.MatchTCPPacket(tcpPacket))
                            {
                                var res = session.BufferTCPPacket(tcpPacket, packet.Timeval.Date);
                                if (res == SessionForm.Results.CloseMe)
                                {
                                    session.Close();
                                }
                            }
                        }
                        catch (Exception)
                        {
                            session.Close();
                            session = null;
                        }
                    });
                }
                this.Invoke((MethodInvoker) delegate {
                    mSearchForm.RefreshOpcodes(false);
                });
            }
        }
Exemple #2
0
        private void mDockPanel_ActiveDocumentChanged(object pSender, EventArgs pArgs)
        {
            if (!mClosed)
            {
                SessionForm session = mDockPanel.ActiveDocument as SessionForm;
                mSearchForm.ComboBox.Items.Clear();
                if (session != null)
                {
                    //   session.RefreshPackets();

                    mSearchForm.RefreshOpcodes(false);
                    session.ReselectPacket();
                }
                else
                {
                    if (mDataForm.HexBox.ByteProvider != null)
                    {
                        mDataForm.HexBox.ByteProvider.DeleteBytes(0, mDataForm.HexBox.ByteProvider.Length);
                    }
                    mStructureForm.Tree.Nodes.Clear();
                    mPropertyForm.Properties.SelectedObject = null;
                }
            }
        }
Exemple #3
0
        private void mFileImportMenu_Click(object pSender, EventArgs pArgs)
        {
            if (mImportDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            PcapOfflineDevice device = new PcapOfflineDevice(mImportDialog.FileName);

            device.Open();

            Packet      packet  = null;
            SessionForm session = null;

            while ((packet = device.GetNextPacket()) != null)
            {
                TCPPacket tcpPacket = packet as TCPPacket;
                if (tcpPacket == null)
                {
                    continue;
                }
                if ((tcpPacket.SourcePort < Config.Instance.LowPort || tcpPacket.SourcePort > Config.Instance.HighPort) &&
                    (tcpPacket.DestinationPort < Config.Instance.LowPort || tcpPacket.DestinationPort > Config.Instance.HighPort))
                {
                    continue;
                }
                if (tcpPacket.Syn && !tcpPacket.Ack)
                {
                    session = NewSession(); session.BufferTCPPacket(tcpPacket);
                }
                else if (session.MatchTCPPacket(tcpPacket))
                {
                    session.BufferTCPPacket(tcpPacket);
                }
            }
            mSearchForm.RefreshOpcodes(false);
        }