public void Demo_memory_reading_from_process_sample()
        {
            //	To get a process sample of the EVE Online client to use with this reading approach,
            //	see the guide at https://forum.botengine.org/t/how-to-collect-samples-for-memory-reading-development/50

            var windowsProcessMeasurementFilePath =
                System.IO.Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                    "BotEngine", "Sanderling.Process.Sample", "my-eve-online-client-process-sample.zip");

            var windowsProcessMeasurementZipArchive = System.IO.File.ReadAllBytes(windowsProcessMeasurementFilePath);

            var measurementId = StringIdentifierFromValue(windowsProcessMeasurementZipArchive);

            Console.WriteLine("Loaded sample " + measurementId + " from '" + windowsProcessMeasurementFilePath + "'");

            var windowsProcessMeasurement = BotEngine.Interface.Process.Snapshot.Extension.SnapshotFromZipArchive(windowsProcessMeasurementZipArchive);

            var memoryReader = new BotEngine.Interface.Process.Snapshot.SnapshotReader(windowsProcessMeasurement?.ProcessSnapshot?.MemoryBaseAddressAndListOctet);

            Console.WriteLine("I begin to search for the root of the UI tree...");

            //	The address of the root of the UI tree usually does not change in an EVE Online client process.
            //	Therefore the UI tree root search result is reused when reading the UI tree from the same process later.
            var searchForUITreeRoot = memoryReader.SearchForUITreeRoot();

            Console.WriteLine("I read the partial python model of the UI tree...");

            var memoryMeasurementPartialPythonModel = memoryReader?.ReadUITreeFromRoot(searchForUITreeRoot);

            var allNodesFromMemoryMeasurementPartialPythonModel =
                memoryMeasurementPartialPythonModel.EnumerateNodeFromTreeDFirst(node => node.GetListChild())
                .ToList();

            Console.WriteLine($"The tree in memoryMeasurementPartialPythonModel contains { allNodesFromMemoryMeasurementPartialPythonModel.Count } nodes");

            var memoryMeasurementReducedWithNamedNodes =
                Optimat.EveOnline.AuswertGbs.Extension.SensorikScnapscusKonstrukt(memoryMeasurementPartialPythonModel, null);

            var memoryMeasurementReducedWithNamedNodesParsedFurther =
                memoryMeasurementReducedWithNamedNodes.Parse();

            //	At this point, you will find in the "parsedMemoryMeasurement" variable the contents read from the process measurement as they would appear in the Sanderling API Explorer.

            Console.WriteLine("Overview window read: " + (memoryMeasurementReducedWithNamedNodesParsedFurther.WindowOverview?.Any() ?? false));

            {
                //	TODO: Improve accessibility: Move this derivation section into an artifact which can be easily referenced and executed from the Windows Console App.

                var destinationDirectoryPath =
                    System.IO.Path.Combine(
                        System.IO.Path.GetDirectoryName(windowsProcessMeasurementFilePath),
                        "derivation",
                        "from-" + measurementId);

                Console.WriteLine("I serialize the values from the different stages of memory reading and write those into files.");

                var stagesNamedValues = new[]
Example #2
0
        public void Demo_memory_reading_from_process_sample()
        {
            //	To get a process sample of the EVE Online client to use with this reading approach,
            //	see the guide at https://forum.botengine.org/t/how-to-collect-samples-for-memory-reading-development/50

            var windowsProcessMeasurementFilePath =
                Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
                .PathToFilesysChild("Sanderling.Process.Sample")
                .PathToFilesysChild("my-eve-online-client-process-sample.zip");

            var windowsProcessMeasurementZipArchive = System.IO.File.ReadAllBytes(windowsProcessMeasurementFilePath);

            var windowsProcessMeasurement = BotEngine.Interface.Process.Snapshot.Extension.SnapshotFromZipArchive(windowsProcessMeasurementZipArchive);

            var memoryReader = new BotEngine.Interface.Process.Snapshot.SnapshotReader(windowsProcessMeasurement?.ProcessSnapshot?.MemoryBaseAddressAndListOctet);

            Console.WriteLine("I begin to search for the root of the UI tree...");

            //	The address of the root of the UI tree usually does not change in an EVE Online client process.
            //	Therefore the UI tree root search result is reused when reading the UI tree from the same process later.
            var searchForUITreeRoot = memoryReader.SearchForUITreeRoot();

            Console.WriteLine("I read the partial python model of the UI tree...");

            var memoryMeasurementPartialPythonModel = memoryReader?.ReadUITreeFromRoot(searchForUITreeRoot);

            var allNodesFromMemoryMeasurementPartialPythonModel =
                memoryMeasurementPartialPythonModel.EnumerateNodeFromTreeDFirst(node => node.GetListChild())
                .ToList();

            Console.WriteLine($"The tree in memoryMeasurementPartialPythonModel contains { allNodesFromMemoryMeasurementPartialPythonModel.Count } nodes");

            var sanderlingMemoryMeasurement = Optimat.EveOnline.AuswertGbs.Extension.SensorikScnapscusKonstrukt(memoryMeasurementPartialPythonModel, null);

            var parsedMemoryMeasurement = sanderlingMemoryMeasurement.Parse();

            //	At this point, you will find in the "parsedMemoryMeasurement" variable the contents read from the process measurement as they would appear in the Sanderling API Explorer.

            Console.WriteLine("Overview window read: " + (parsedMemoryMeasurement.WindowOverview?.Any() ?? false));
        }
Example #3
0
        public void Demo_memory_reading_from_process_sample()
        {
            //	To obtain a process sample of the eve online client to use with this reading approach,
            //	see the guide at http://forum.botengine.de/t/collecting-samples-for-memory-reading-development/50

            var sampleFilePath =
                Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
                .PathToFilesysChild("Sanderling.Process.Sample")
                .PathToFilesysChild("my-eve-online-client-process-sample.zip");

            var snapshotZipArchiv = Bib3.Glob.InhaltAusDataiMitPfaad(sampleFilePath);

            var snapshot = BotEngine.Interface.Process.Snapshot.Extension.SnapshotFromZipArchive(snapshotZipArchiv);

            var memoryReader = new BotEngine.Interface.Process.Snapshot.SnapshotReader(snapshot?.ProcessSnapshot?.MemoryBaseAddressAndListOctet);

            var memoryMeasurement = memoryReader.MemoryMeasurement().Parse();

            //	At this point, you will find in the "memoryMeasurement" variable the contents read from the process sample as they would appear in the Sanderling API Explorer.

            Console.WriteLine("Overview window read: " + (memoryMeasurement.WindowOverview?.Any() ?? false));
        }