Example #1
0
        /// <summary>
        /// Starts the pointer value rescan.
        /// </summary>
        private void StartPointerRetargetScan()
        {
            TrackableTask <PointerBag> pointerRetargetScanTask = PointerRetargetScan.Scan(this.RetargetAddress, 4, PointerScanResultsViewModel.GetInstance().DiscoveredPointers);

            TaskTrackerViewModel.GetInstance().TrackTask(pointerRetargetScanTask);
            PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerRetargetScanTask.Result;
        }
Example #2
0
        /// <summary>
        /// Starts the pointer scan.
        /// </summary>
        private void StartScan()
        {
            TrackableTask <PointerBag> pointerScanTask = PointerScan.Scan(this.TargetAddress, (UInt32)this.PointerRadius, this.PointerDepth, 4);

            TaskTrackerViewModel.GetInstance().TrackTask(pointerScanTask);
            PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerScanTask.Result;
        }
Example #3
0
        /// <summary>
        /// Starts the pointer address rebase.
        /// </summary>
        private void StartPointerRebase()
        {
            TrackableTask <PointerBag> pointerRebaseTask = PointerRebase.Scan(PointerScanResultsViewModel.GetInstance().DiscoveredPointers, readMemory: true, performUnchangedScan: true);

            TaskTrackerViewModel.GetInstance().TrackTask(pointerRebaseTask);
            PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerRebaseTask.Result;
        }
        public PlayerMarkersViewModel(TaskTrackerViewModel taskTrackerVm,
                                      MapUserData userData,
                                      PlayerTasksFactory playerTaskFactory,
                                      IPlayerTasksController tasksController,
                                      IZoneService zoneService,
                                      IPlayerService playerService)
        {
            this.taskTrackerVm     = taskTrackerVm;
            this.playerTaskFactory = playerTaskFactory;
            this.tasksController   = tasksController;
            this.zoneService       = zoneService;
            this.playerService     = playerService;
            this.userData          = userData;

            this.PlayerMarkers = new ObservableCollection <PlayerMarkerViewModel>();

            this.playerTasksCollection = (ObservableCollection <PlayerTaskViewModel>) this.taskTrackerVm.PlayerTasks.Source;
            foreach (var task in this.playerTasksCollection)
            {
                task.PropertyChanged += Task_PropertyChanged;
                if (task.HasContinentLocation)
                {
                    this.PlayerMarkers.Add(new PlayerMarkerViewModel(task, this.zoneService, this.playerService));
                }
            }
            this.playerTasksCollection.CollectionChanged += PlayerTasksCollection_CollectionChanged;

            this.InitializeTemplates();
            this.PlayerMarkers.CollectionChanged += PlayerMarkers_CollectionChanged;
        }
Example #5
0
        /// <summary>
        /// Starts the scan using the current constraints.
        /// </summary>
        private void StartScan()
        {
            // Create a constraint manager that includes the current active constraint
            ConstraintNode scanConstraints = this.ActiveConstraint.Clone();

            if (!scanConstraints.IsValid())
            {
                Logger.Log(LogLevel.Warn, "Unable to start scan with given constraints");
                return;
            }

            DataType dataType = ScanResultsViewModel.GetInstance().ActiveType;

            // Collect values
            TrackableTask <Snapshot> valueCollectorTask = ValueCollector.CollectValues(
                SnapshotManager.GetSnapshot(Snapshot.SnapshotRetrievalMode.FromActiveSnapshotOrPrefilter, dataType));

            TaskTrackerViewModel.GetInstance().TrackTask(valueCollectorTask);

            // Perform manual scan on value collection complete
            valueCollectorTask.OnCompletedEvent += ((completedValueCollection) =>
            {
                Snapshot snapshot = valueCollectorTask.Result;
                TrackableTask <Snapshot> scanTask = ManualScanner.Scan(
                    snapshot,
                    scanConstraints);

                TaskTrackerViewModel.GetInstance().TrackTask(scanTask);
                SnapshotManager.SaveSnapshot(scanTask.Result);
            });
        }
Example #6
0
        /// <summary>
        /// Begins the value collection.
        /// </summary>
        private void CollectValues()
        {
            DataType dataType = ScanResultsViewModel.GetInstance().ActiveType;

            TrackableTask <Snapshot> valueCollectTask = ValueCollector.CollectValues(
                SnapshotManager.GetSnapshot(Snapshot.SnapshotRetrievalMode.FromActiveSnapshotOrPrefilter, dataType));

            TaskTrackerViewModel.GetInstance().TrackTask(valueCollectTask);
            SnapshotManager.SaveSnapshot(valueCollectTask.Result);
        }
Example #7
0
 /// <summary>
 /// Starts the pointer value rescan.
 /// </summary>
 private void StartPointerRetargetScan()
 {
     try
     {
         TrackableTask <PointerBag> pointerRetargetScanTask = PointerRetargetScan.Scan(this.RetargetAddress, 4, PointerScanResultsViewModel.GetInstance().DiscoveredPointers, PointerScannerViewModel.PointerScanTaskIdentifier);
         TaskTrackerViewModel.GetInstance().TrackTask(pointerRetargetScanTask);
         PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerRetargetScanTask.Result;
     }
     catch (TaskConflictException)
     {
     }
 }
Example #8
0
 /// <summary>
 /// Starts the pointer address rebase.
 /// </summary>
 private void StartPointerRebase()
 {
     try
     {
         TrackableTask <PointerBag> pointerRebaseTask = PointerRebase.Scan(PointerScanResultsViewModel.GetInstance().DiscoveredPointers, readMemory: true, performUnchangedScan: true, taskIdentifier: PointerScannerViewModel.PointerScanTaskIdentifier);
         TaskTrackerViewModel.GetInstance().TrackTask(pointerRebaseTask);
         PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerRebaseTask.Result;
     }
     catch (TaskConflictException)
     {
     }
 }
Example #9
0
        /// <summary>
        /// Begins the value collection.
        /// </summary>
        private void CollectValues()
        {
            DataTypeBase dataType = ScanResultsViewModel.GetInstance().ActiveType;

            TrackableTask <Snapshot> valueCollectTask = ValueCollector.CollectValues(
                SessionManager.Session?.OpenedProcess,
                SessionManager.Session.SnapshotManager.GetActiveSnapshotCreateIfNone(SessionManager.Session.OpenedProcess),
                TrackableTask.UniversalIdentifier
                );

            TaskTrackerViewModel.GetInstance().TrackTask(valueCollectTask);
            SessionManager.Session.SnapshotManager.SaveSnapshot(valueCollectTask.Result);
        }
Example #10
0
        private void ReportBugIcon_Click(object sender, RoutedEventArgs e)
        {
            TaskTrackerViewModel viewModel = new TaskTrackerViewModel(DialogCoordinator.Instance);

            Stream screenshot = ControlUtils.CaptureScreenshot(this, ImageFormat.Png);

            if (screenshot != null)
            {
                viewModel.AttachScreenshot("OptickApp.png", screenshot);
            }

            viewModel.SetGroup(FrameCaptureControl.EventThreadViewControl.Group);

            using (var scope = BootStrapperBase.Container.BeginLifetimeScope())
            {
                var screenShotView = scope.Resolve <IWindowManager>().ShowWindow(viewModel);
            }
        }
Example #11
0
 /// <summary>
 /// Starts the pointer value rescan.
 /// </summary>
 private void StartPointerRetargetScan()
 {
     try
     {
         PointerSize pointerSize = SessionManager.Session.OpenedProcess.Is32Bit() ? PointerSize.Byte4 : PointerSize.Byte8;
         TrackableTask <PointerBag> pointerRetargetScanTask = PointerRetargetScan.Scan(
             SessionManager.Session.OpenedProcess,
             this.RetargetAddress,
             pointerSize.ToSize(),
             PointerScanResultsViewModel.GetInstance().DiscoveredPointers,
             PointerScannerViewModel.PointerScanTaskIdentifier
             );
         TaskTrackerViewModel.GetInstance().TrackTask(pointerRetargetScanTask);
         PointerScanResultsViewModel.GetInstance().DiscoveredPointers = pointerRetargetScanTask.Result;
     }
     catch (TaskConflictException)
     {
     }
 }
Example #12
0
        public PlayerMarkersViewModel(TaskTrackerViewModel taskTrackerVm,
                                      MapUserData userData,
                                      PlayerTasksFactory playerTaskFactory,
                                      IPlayerTasksController tasksController,
                                      IZoneService zoneService,
                                      IPlayerService playerService)
        {
            this.taskTrackerVm     = taskTrackerVm;
            this.playerTaskFactory = playerTaskFactory;
            this.tasksController   = tasksController;
            this.zoneService       = zoneService;
            this.playerService     = playerService;
            this.userData          = userData;

            this.PlayerMarkers = new ObservableCollection <PlayerMarkerViewModel>();

            if (this.playerService.HasValidMapId)
            {
                var continent = this.zoneService.GetContinentByMap(this.playerService.MapId);
                this.currentContinentId = continent.Id;
            }
            else
            {
                this.currentContinentId = 1;
            }

            this.playerTasksCollection = this.tasksController.PlayerTasks;
            foreach (var task in this.playerTasksCollection)
            {
                task.PropertyChanged += Task_PropertyChanged;
                if (task.HasContinentLocation)
                {
                    this.PlayerMarkers.Add(new PlayerMarkerViewModel(task, this.userData, this.currentContinentId, this.zoneService, this.playerService));
                }
            }
            this.playerTasksCollection.CollectionChanged += PlayerTasksCollection_CollectionChanged;

            this.InitializeTemplates();
            this.PlayerMarkers.CollectionChanged += PlayerMarkers_CollectionChanged;

            this.ToggleCategoryVisibiltyCommand = new DelegateCommand <string>(this.ToggleCategoryVisibility);
        }
        /// <summary>
        /// Starts the scan using the current constraints.
        /// </summary>
        private void StartScan()
        {
            // Create a constraint manager that includes the current active constraint
            DataTypeBase    dataType        = ScanResultsViewModel.GetInstance().ActiveType;
            ScanConstraints scanConstraints = new ScanConstraints(dataType, this.ActiveConstraint?.Clone());

            if (!scanConstraints.IsValid())
            {
                Logger.Log(LogLevel.Warn, "Unable to start scan with given constraints");
                return;
            }

            try
            {
                // Collect values
                TrackableTask <Snapshot> valueCollectorTask = ValueCollector.CollectValues(
                    SessionManager.Session.OpenedProcess,
                    SessionManager.Session.SnapshotManager.GetActiveSnapshotCreateIfNone(SessionManager.Session.OpenedProcess),
                    TrackableTask.UniversalIdentifier
                    );

                TaskTrackerViewModel.GetInstance().TrackTask(valueCollectorTask);

                // Perform manual scan on value collection complete
                valueCollectorTask.OnCompletedEvent += ((completedValueCollectionTask) =>
                {
                    Snapshot snapshot = valueCollectorTask.Result;
                    TrackableTask <Snapshot> scanTask = ManualScanner.Scan(
                        snapshot,
                        scanConstraints,
                        TrackableTask.UniversalIdentifier);

                    TaskTrackerViewModel.GetInstance().TrackTask(scanTask);
                    SessionManager.Session.SnapshotManager.SaveSnapshot(scanTask.Result);
                });
            }
            catch (TaskConflictException)
            {
            }
        }
Example #14
0
        /// <summary>
        /// Fetches and applies updates from the Github repository. The application is not restarted.
        /// </summary>
        public static void UpdateApp()
        {
            if (!ApplicationUpdater.IsSquirrelInstalled())
            {
                Logger.Log(LogLevel.Warn, "Updater not found, Squalr will not check for automatic updates.");
                return;
            }

            Task.Run(async() =>
            {
                try
                {
                    using (UpdateManager manager = await UpdateManager.GitHubUpdateManager(ApplicationUpdater.GithubRepositoryUrl))
                    {
                        UpdateInfo updates       = await manager.CheckForUpdate();
                        ReleaseEntry lastVersion = updates?.ReleasesToApply?.OrderBy(x => x.Version).LastOrDefault();

                        if (lastVersion == null)
                        {
                            Logger.Log(LogLevel.Info, "Squalr is up to date.");
                            return;
                        }

                        Logger.Log(LogLevel.Info, "New version of Squalr found. Downloading files in background...");

                        TrackableTask <Boolean> downloadTask = TrackableTask <Boolean>
                                                               .Create("Downloading Updates", out UpdateProgress updateProgress, out CancellationToken cancellationToken)
                                                               .With(Task <Boolean> .Run(() =>
                        {
                            try
                            {
                                manager.DownloadReleases(new[] { lastVersion }, (progress) => updateProgress(progress)).Wait();
                            }
                            catch (Exception ex)
                            {
                                Logger.Log(LogLevel.Error, "Error downloading updates.", ex);
                                return(false);
                            }

                            return(true);
                        }, cancellationToken));

                        TaskTrackerViewModel.GetInstance().TrackTask(downloadTask);

                        if (!downloadTask.Result)
                        {
                            return;
                        }

                        TrackableTask <Boolean> applyReleasesTask = TrackableTask <Boolean>
                                                                    .Create("Applying Releases", out updateProgress, out cancellationToken)
                                                                    .With(Task <Boolean> .Run(() =>
                        {
                            try
                            {
                                manager.ApplyReleases(updates, (progress) => updateProgress(progress)).Wait();
                            }
                            catch (Exception ex)
                            {
                                Logger.Log(LogLevel.Error, "Error applying releases.", ex);
                                return(false);
                            }

                            return(true);
                        }, cancellationToken));

                        TaskTrackerViewModel.GetInstance().TrackTask(applyReleasesTask);

                        if (!applyReleasesTask.Result)
                        {
                            return;
                        }

                        TrackableTask <Boolean> updateTask = TrackableTask <Boolean>
                                                             .Create("Updating", out updateProgress, out cancellationToken)
                                                             .With(Task <Boolean> .Run(() =>
                        {
                            try
                            {
                                manager.UpdateApp((progress) => updateProgress(progress)).Wait();
                            }
                            catch (Exception ex)
                            {
                                Logger.Log(LogLevel.Error, "Error applying updates.", ex);
                                return(false);
                            }

                            return(true);
                        }, cancellationToken));

                        TaskTrackerViewModel.GetInstance().TrackTask(updateTask);

                        if (!updateTask.Result)
                        {
                            return;
                        }

                        Logger.Log(LogLevel.Info, "New Squalr version downloaded. Restart the application to apply updates.");
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(LogLevel.Error, "Error updating Squalr.", ex);
                }
            });
        }