コード例 #1
0
        private MultiboxProcess FetchProcessMultiboxInfo(Process process)
        {
            List <Signature> sigList = new List <Signature>();
            string           file    = Path.Combine(Program.appBase, "signatures.json");

            using (var streamReader = new StreamReader(file)) {
                sigList = JsonSerializer.DeserializeFromReader <List <Signature> >(streamReader);
            }

            // Initialize process scanner
            FFMemoryParser.Memory memory = new FFMemoryParser.Memory(process);
            // Get memory addresses
            memory.SearchMemory(sigList);
            // Fetch memory data
            memory.MemoryLoop();

            if (memory.actorsData.currentActors.Count > 0)
            {
                ActorData localPlayer = memory.actorsData.currentActors.First().Value;
                return(new MultiboxProcess {
                    characterId = memory.charIdData.id,
                    characterName = localPlayer.name
                });
            }
            return(new MultiboxProcess());
        }