private void StartScan(int index, Int64 searchAddress, bool validatingProcess = false)
        {
            if (index > 0)
            {
                SnapshotManager.ClearSnapshots();
            }

            ConstraintNode scanConstraints = new ScanConstraint(ScanConstraint.ConstraintType.Equal, searchAddress, dataType);

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

            valueCollectorTask.OnCompletedEvent += ((completedValueCollectionTask) =>
            {
                Snapshot snapshot = valueCollectorTask.Result;

                TrackableTask <Snapshot> scanTask = ManualScanner.Scan(
                    snapshot,
                    scanConstraints,
                    TrackableTask.UniversalIdentifier);

                SnapshotManager.SaveSnapshot(scanTask.Result);

                snapshot = scanTask.Result;

                scannedAddresses.Add(new List <Int64>());

                if (snapshot != null)
                {
                    for (UInt64 i = 0; i < snapshot.ElementCount; ++i)
                    {
                        SnapshotElementIndexer element = snapshot[i];

                        Object currentValue = element.HasCurrentValue() ? element.LoadCurrentValue() : null;
                        Object previousValue = element.HasPreviousValue() ? element.LoadPreviousValue() : null;

                        String moduleName = String.Empty;
                        UInt64 address = Query.Default.AddressToModule(element.BaseAddress, out moduleName);

                        PointerItem pointerItem = new PointerItem(baseAddress: address, dataType: dataType, moduleName: moduleName, value: currentValue);
                        pointerItem.ForceResolveAddress();

                        scannedAddresses[index].Add(Int64.Parse(pointerItem.AddressSpecifier, NumberStyles.HexNumber, CultureInfo.CurrentCulture));
                    }
                }

                int nextIteration = index + 1;
                if (nextIteration < addressesToFind.Count)
                {
                    StartScan(nextIteration, addressesToFind[nextIteration], validatingProcess);
                }
                else
                {
                    SearchLogic(validatingProcess);
                }
            });
        }
Exemplo n.º 2
0
        public void ValidateButton()
        {
            scannedAddresses.Clear();
            validatingEntityList.Clear();

            SnapshotManager.ClearSnapshots();

            StartScan(index: 0, searchAddress: addressesToFind[0], validatingProcess: true);
        }
Exemplo n.º 3
0
        private void InspectionProcessOnProcessChanged(object sender, EventArgs eventArgs)
        {
            TracesView = null;
            Details    = "";
            SnapshotManager.ClearSnapshots();
            FirstSnapshot  = null;
            SecondSnapshot = null;

            Command.RefreshAll();
        }
        public void SearchButton()
        {
            scannedAddresses.Clear();
            possibleEntityList.Clear();
            appForm.possibleEntityListTextBox.Clear();
            addressesToFind.Clear();

            SnapshotManager.ClearSnapshots();

            TextBox addressesToFindTextBox = appForm.addressesToFindTextBox;

            for (int i = 0; i < addressesToFindTextBox.Lines.Length; ++i)
            {
                addressesToFind.Add(Int64.Parse(addressesToFindTextBox.Lines[i], NumberStyles.HexNumber, CultureInfo.CurrentCulture));
            }

            StartScan(0, addressesToFind[0]);
        }