Exemplo n.º 1
0
        private void LoadCapture(object sender, RoutedEventArgs e)
        {
            PacketListView.Items.Clear();
            currentPacketStream = new MemoryStream(new byte[] { });
            isFiltered          = false;

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "XML|*.xml";
            openFileDialog.Title  = "Select a Capture XML file";

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var packets = CaptureFileOp.Load(openFileDialog.FileName);
                foreach (PacketListItem packet in packets)
                {
                    AddPacketToListView(packet);
                }
            }
        }
Exemplo n.º 2
0
        private void SaveCapture(object sender, RoutedEventArgs e)
        {
            if (captureWorker != null)
            {
                MessageBox.Show("A capture is in progress.", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return;
            }

            var fileDialog = new System.Windows.Forms.SaveFileDialog();

            fileDialog.Filter = "XML|*.xml";
            var result = fileDialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                CaptureFileOp.Save(PacketListView.Items, fileDialog.FileName);
                MessageBox.Show($"Capture saved to {fileDialog.FileName}.", "FFXIVMon Reborn", MessageBoxButton.OK, MessageBoxImage.Asterisk);
            }
        }
Exemplo n.º 3
0
        public MainWindow()
        {
            ParseCommandlineArguments();
            InitializeComponent();
            repo = Properties.Settings.Default.RepoUrl;
            db   = new Database(repo);

            captureMode = (TCPNetworkMonitor.NetworkMonitorType)Properties.Settings.Default.NetworkMonitorType;

            if (captureMode == TCPNetworkMonitor.NetworkMonitorType.RawSocket)
            {
                SwitchModeSockets.IsChecked = true;
            }
            else
            {
                SwitchModePcap.IsChecked = true;
            }

            // register the event that is fired after the key press.
            hook.KeyPressed +=
                new EventHandler <KeyPressedEventArgs>(hook_KeyPressed);
            // register the control + alt + F12 combination as hot key.

            hotkeyTimer = new System.Threading.Timer(TryAssignHotkey, null, 0, 5);

            if (!string.IsNullOrEmpty(currentXmlFile))
            {
                ChangeTitle(System.IO.Path.GetFileNameWithoutExtension(currentXmlFile));
                var packets = CaptureFileOp.Load(currentXmlFile);
                foreach (PacketListItem packet in packets)
                {
                    AddPacketToListView(packet);
                }
            }

            //var test = Struct.Parse(db.GetServerZoneStruct(0x143), new byte[] {});
        }
Exemplo n.º 4
0
        private void LoadCapture(object sender, RoutedEventArgs e)
        {
            currentPacketStream = new MemoryStream(new byte[] { });
            filterString        = "";

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "XML|*.xml";
            openFileDialog.Title  = "Select a Capture XML file";

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MessageBoxResult res = MessageBox.Show("No to open in current, Yes to open in new window.", "Open in new window?", MessageBoxButton.YesNoCancel);
                if (res == MessageBoxResult.Yes)
                {
                    Process.Start(System.IO.Path.Combine(Environment.CurrentDirectory, System.AppDomain.CurrentDomain.FriendlyName), "--xml \"" + openFileDialog.FileName + "\"");
                    return;
                }
                else if (res == MessageBoxResult.No)
                {
                    PacketListView.Items.Clear();
                }
                else
                {
                    return;
                }
                currentXmlFile = openFileDialog.FileName;
                ChangeTitle(System.IO.Path.GetFileNameWithoutExtension(currentXmlFile));

                var packets = CaptureFileOp.Load(openFileDialog.FileName);
                foreach (PacketListItem packet in packets)
                {
                    AddPacketToListView(packet);
                }
            }
        }