Beispiel #1
0
 private void BigCleanUp()
 {
     if (_driverManager != null)
     {
         _driverManager.UnloadDriver();
         _driverManager = null;
     }
     _shouldStop = true;
     FlushArtifactsList();
     _activeArtifact = null;
     _imageMd5       = "";
     if (_profile != null && _profile.ObjectTypeList != null)
     {
         _profile.ObjectTypeList.Clear();
     }
     _cacheLocation = "";
     _profile       = null;
     _kernelDtb     = 0;
     _infoDictionary.Clear();
     _processInfoDictionary.Clear();
     _kernelBaseAddress = 0;
     _architecture      = "";
     _processList.Clear();
     _pfnDatabaseBaseAddress = 0;
     AddDebugMessage("BIG CLEANUP CALLED");
 }
Beispiel #2
0
        /// <summary>
        /// This function gets called everytime something gets selected in the tree view
        /// First do a check to see if the selected item is the currently selected item
        /// </summary>
        /// <param name="selectedArtifact"></param>
        public void UpdateDetails(ArtifactBase selectedArtifact)
        {
            if (selectedArtifact == null || selectedArtifact == _activeArtifact)
            {
                return;
            }
            _activeArtifact = selectedArtifact;
            RootArtifact ra = _activeArtifact as RootArtifact;

            if (ra != null)
            {
                CurrentDetailsViewModelHint = "root";
                _processInfoDictionary.Clear();
                NotifyPropertyChange("CurrentDetailsViewModel"); // this forces the set property / INotifyPropertyCHange  CurrentHexViewerContent   CurrentDetailsViewModel
                return;
            }
            ProcessArtifact pa = _activeArtifact as ProcessArtifact;

            if (pa != null)
            {
                CurrentDetailsViewModelHint = "process";
                _processInfoDictionary.Clear();
                UpdateProcessInfoDictionary(pa.LinkedProcess);
                _selectedProcess = pa.LinkedProcess;
                NotifyPropertyChange("CurrentDetailsViewModel");
                return;
            }
        }
Beispiel #3
0
        public bool NewImageInvestigation(string possibleFilename)
        {
            FileInfo fi = new FileInfo(possibleFilename);

            if (!fi.Exists)
            {
                return(false);
            }
            IncrementActiveJobs("Initialising");
            BigCleanUp();
            _imageMd5      = GetMD5HashFromFile(possibleFilename);
            _cacheLocation = fi.Directory.FullName + "\\[" + fi.Name + "]" + _imageMd5;
            DirectoryInfo di = new DirectoryInfo(_cacheLocation);

            if (!di.Exists)
            {
                di.Create();
            }

            _liveCapture                = false;
            MemoryImageFilename         = possibleFilename;
            _dataProvider               = new ImageDataProvider(this, _cacheLocation);
            UpdateDetails(_rootArtifact = AddArtifact(ArtifactType.Root, fi.Name, true));
            AddDebugMessage("New Image Loaded: " + possibleFilename);
            UpdateMru(MemoryImageFilename);
            DecrementActiveJobs();
            InitialSurvey();
            //ProcessProcesses();
            return(true);
        }
Beispiel #4
0
 public bool NewLiveInvestigation()
 {
     BigCleanUp();
     if (_driverManager == null)
     {
         try
         {
             _driverManager = new DriverManager();
             bool result = _driverManager.LoadDriver();
             AddDebugMessage("Loaded Driver: " + result.ToString());
             if (!result)
             {
                 System.Windows.Forms.MessageBox.Show("Unable to perform live analysis.\nThere was a proble loading the driver", "DriverProblem", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return(false);
             }
         }
         catch (Exception ex)
         {
             System.Windows.MessageBox.Show("Error: Loading Driver. (DataModel:NewLiveInvestigation): " + ex.Message, "Fatal Error", MessageBoxButton.OK, MessageBoxImage.Error);
             return(false);
         }
     }
     _liveCapture                = true;
     MemoryImageFilename         = "Live";
     _dataProvider               = new LiveDataProvider(this);
     UpdateDetails(_rootArtifact = AddArtifact(ArtifactType.Root, "Live Capture", true));
     InitialSurvey();
     //ProcessProcesses();
     return(true);
 }
        private void Awake()
        {
            ModLogger = Logger;

            // Don't know how to create/use an asset bundle, or don't have a unity project set up?
            // Look here for info on how to set these up: https://github.com/KomradeSpectre/AetheriumMod/blob/rewrite-master/Tutorials/Item%20Mod%20Creation.md#unity-project

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ItemModCreationBoilerplate.my_assetbundlefile"))
            {
                MainAssets = AssetBundle.LoadFromStream(stream);
            }

            //This section automatically scans the project for all artifacts
            var ArtifactTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)));

            foreach (var artifactType in ArtifactTypes)
            {
                ArtifactBase artifact = (ArtifactBase)Activator.CreateInstance(artifactType);
                if (ValidateArtifact(artifact, Artifacts))
                {
                    artifact.Init(Config);
                }
            }

            //This section automatically scans the project for all items
            var ItemTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)));

            foreach (var itemType in ItemTypes)
            {
                ItemBase item = (ItemBase)System.Activator.CreateInstance(itemType);
                if (ValidateItem(item, Items))
                {
                    item.Init(Config);
                }
            }

            //this section automatically scans the project for all equipment
            var EquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)));

            foreach (var equipmentType in EquipmentTypes)
            {
                EquipmentBase equipment = (EquipmentBase)System.Activator.CreateInstance(equipmentType);
                if (ValidateEquipment(equipment, Equipments))
                {
                    equipment.Init(Config);
                }
            }

            //this section automatically scans the project for all elite equipment
            var EliteEquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)));

            foreach (var eliteEquipmentType in EliteEquipmentTypes)
            {
                EliteEquipmentBase eliteEquipment = (EliteEquipmentBase)System.Activator.CreateInstance(eliteEquipmentType);
                if (ValidateEliteEquipment(eliteEquipment, EliteEquipments))
                {
                    eliteEquipment.Init(Config);
                }
            }
        }
        public void AddToAssembly()
        {
            //This section automatically scans the project for all artifacts
            var ArtifactTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)));

            foreach (var artifactType in ArtifactTypes)
            {
                ArtifactBase artifact = (ArtifactBase)Activator.CreateInstance(artifactType);
                if (ValidateArtifact(artifact, Artifacts))
                {
                    artifact.Init(Config);
                }
            }

            //This section automatically scans the project for all items
            var ItemTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)));

            foreach (var itemType in ItemTypes)
            {
                ItemBase item = (ItemBase)System.Activator.CreateInstance(itemType);
                if (ValidateItem(item, Items))
                {
                    item.Init(Config);
                }
            }

            //this section automatically scans the project for all equipment
            var EquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)));

            foreach (var equipmentType in EquipmentTypes)
            {
                EquipmentBase equipment = (EquipmentBase)System.Activator.CreateInstance(equipmentType);
                if (ValidateEquipment(equipment, Equipments))
                {
                    equipment.Init(Config);
                }
            }

            //this section automatically scans the project for all elite equipment
            var EliteEquipmentTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)));

            foreach (var eliteEquipmentType in EliteEquipmentTypes)
            {
                EliteEquipmentBase eliteEquipment = (EliteEquipmentBase)System.Activator.CreateInstance(eliteEquipmentType);
                if (ValidateEliteEquipment(eliteEquipment, EliteEquipments))
                {
                    eliteEquipment.Init(Config);
                }
            }

            //this section automatically scans the project for all elite equipment
            var ControllerTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ControllerBase)));

            foreach (var controllerType in ControllerTypes)
            {
                ControllerBase controllerBase = (ControllerBase)System.Activator.CreateInstance(controllerType);
                controllerBase.Init(Config);
            }
        }
        /// <summary>
        /// A helper to easily set up and initialize an artifact from your artifact classes if the user has it enabled in their configuration files.
        /// </summary>
        /// <param name="artifact">A new instance of an ArtifactBase class."</param>
        /// <param name="artifactList">The list you would like to add this to if it passes the config check.</param>
        public bool ValidateArtifact(ArtifactBase artifact, List <ArtifactBase> artifactList)
        {
            var enabled = Config.Bind <bool>("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact appear for selection?").Value;

            if (enabled)
            {
                artifactList.Add(artifact);
            }
            return(enabled);
        }
Beispiel #8
0
        /// <summary>
        /// A helper to easily set up and initialize an artifact from your artifact classes if the user has it enabled in their configuration files.
        /// </summary>
        /// <param name="artifact">A new instance of an ArtifactBase class. E.g. "new ExampleArtifact()"</param>
        /// <param name="artifactList">The list you would like to add this to if it passes the config check.</param>
        public bool ValidateArtifact(ArtifactBase artifact, List <ArtifactBase> artifactList)
        {
            if (TurboEdition.instance.Config.Bind <bool>("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact be enabled in game?").Value)
            {
#if DEBUG
                TurboEdition._logger.LogWarning("Validating artifact " + artifact + ", user has it set to enabled, so adding it to " + artifactList);
#endif
                artifactList.Add(artifact);
                return(true);
            }
            return(false);
        }
Beispiel #9
0
 public bool IsValidParent(ArtifactBase candidate)
 {
     while (true)
     {
         if (candidate == null)
         {
             return(true);
         }
         if (candidate == this)
         {
             return(false);
         }
         candidate = candidate.Parent;
     }
 }
Beispiel #10
0
        public void InitArtfs()
        {
            var ArtifactTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)));

            foreach (var artifactType in ArtifactTypes)
            {
#if DEBUG
                TurboEdition._logger.LogWarning("Initializing artifacts, adding: " + artifactType + " in a ArtifactTypes of count " + ArtifactTypes.Count());
#endif
                ArtifactBase artifact = (ArtifactBase)System.Activator.CreateInstance(artifactType);
                if (ValidateArtifact(artifact, ArtifactList))
                {
#if DEBUG
                    TurboEdition._logger.LogWarning("Validated artifact, and intializing config of " + artifact);
#endif
                    artifact.Init(TurboEdition.instance.Config);
                }
            }
        }
Beispiel #11
0
 public TreeItem(ArtifactBase item, DataModel dataSource)
 {
     _artifactItem = item;
     _dataSource   = dataSource;
 }
Beispiel #12
0
        private ArtifactBase AddArtifact(ArtifactType type, string name, bool selected = false, ArtifactBase parent = null)
        {
            ArtifactBase artifact;

            switch (type)
            {
            case ArtifactType.Root:
                artifact = new RootArtifact();
                break;

            case ArtifactType.Process:
                artifact = new ProcessArtifact();
                break;

            default:
                return(null);
            }
            artifact.Name       = name;
            artifact.Parent     = parent;
            artifact.IsExpanded = false;
            artifact.IsSelected = selected;
            lock (AccessLock)
            {
                _artifacts.Add(artifact);
            }
            NotifyPropertyChange("TreeItems"); // this forces the set property / INotifyPropertyCHange
            NotifyPropertyChange("Processes");
            return(artifact);
        }