Exemplo n.º 1
0
        public MemoryHandler(SharlayanConfiguration configuration)
        {
            this.Configuration = configuration;
            try {
                this.ProcessHandle = UnsafeNativeMethods.OpenProcess(UnsafeNativeMethods.ProcessAccessFlags.PROCESS_VM_ALL, false, (uint)this.Configuration.ProcessModel.ProcessID);
            }
            catch (Exception) {
                this.ProcessHandle = this.Configuration.ProcessModel.Process.Handle;
            }
            finally {
                this.IsAttached = true;
            }

            this.Configuration.ProcessModel.Process.EnableRaisingEvents = true;
            this.Configuration.ProcessModel.Process.Exited += this.Process_OnExited;

            this.GetProcessModules();

            this.Scanner = new Scanner(this);
            this.Reader  = new Reader(this);

            if (this._isNewInstance)
            {
                this._isNewInstance = false;

                Task.Run(
                    async() => {
                    await this.ResolveMemoryStructures();

                    await ActionLookup.Resolve(this.Configuration);
                    await StatusEffectLookup.Resolve(this.Configuration);
                    await ZoneLookup.Resolve(this.Configuration);
                });
            }

            Task.Run(
                async() => {
                Signature[] signatures = await Signatures.Resolve(this.Configuration);
                this.Scanner.LoadOffsets(signatures, this.Configuration.ScanAllRegions);
            });
        }
Exemplo n.º 2
0
        public static async Task <Signature[]> Resolve(SharlayanConfiguration configuration)
        {
            Signature[] signatures = await APIHelper.GetSignatures(configuration);

            return(signatures);
        }
Exemplo n.º 3
0
        public MemoryHandler AddHandler(SharlayanConfiguration configuration)
        {
            MemoryHandler memoryHandler = new MemoryHandler(configuration);

            return(this._memoryHandlers.AddOrUpdate(configuration.ProcessModel.ProcessID, memoryHandler, (k, v) => memoryHandler));
        }