コード例 #1
0
        public OpCodeHelper()
        {
            _logger = Locator.Current.GetService <ILogger>();
            var target = FFXIVNetworkProcessHelper.Instance.ActiveProcess;

            memhelper      = new MemHelper(target);
            patternscanner = new PatternScanner(memhelper);
        }
コード例 #2
0
        public PatternScanner(MemHelper memhelper)
        {
            _logger = Locator.Current.GetService <ILogger>();

            _memhelper = memhelper;

            _baseAddress = memhelper.BaseAddress;

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

            _logger.Write($"dosHeaders.isvalid{dosHeaders.isValid}", LogLevel.Info);
            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);
                _logger.Write($"SizeofCode:{SizeOfCode} CodeBase:{CodeBase}", LogLevel.Info);
            }
        }