Esempio n. 1
0
        public SigScanner(Process process)
        {
            //_logger = Locator.Current.GetService<ILogger>();
            _memhelper = new MemHelper(process);
            SetupSearchSpace(process.MainModule);
            _baseAddress = _memhelper.BaseAddress;

            var dosHeaders = _memhelper.Read <IMAGE_DOS_HEADER>(_baseAddress);

            if (dosHeaders.isValid)
            {
                var ntHeaders = _memhelper.Read <IMAGE_NT_HEADERS64>(_baseAddress + dosHeaders.e_lfanew);
                SizeOfCode  = ntHeaders.OptionalHeader.SizeOfCode;
                CodeBase    = ntHeaders.OptionalHeader.BaseOfCode;
                _dataLength = CodeBase + SizeOfCode;
                _data       = _memhelper.ReadBytes(_baseAddress, (int)_dataLength);
            }
        }