Beispiel #1
0
        private static bool MountEmulator(EmulatorProcess emu)
        {
            ExpressTest.ExpressionEvaluator ExpressionEvalulator;
            string ramStartExpression = emu.Stats.RamStart;

            Emulator = emu;//.Process;

            if (Emulator == null)
            {
                return(false);
            }

            foreach (ProcessModule item in Emulator.Process.Modules)
            {
                IntPtr baseAddress = item.BaseAddress;
                string moduleName  = "`" + item.ModuleName.ToLowerInvariant() + "`";
                if (ramStartExpression.Contains(moduleName))
                {
                    ramStartExpression = ramStartExpression.Replace
                                             (moduleName, baseAddress.ToString("X"));
                    emu.WatchedModules.Add(item);
                }
            }

            ExpressionEvalulator = new ExpressTest.ExpressionEvaluator(ReadProcess);
            RamPointer           = new IntPtr(ExpressionEvalulator.Evaluate(ramStartExpression));

            if (RamPointer == new IntPtr(0))
            {
                return(false);
            }

            return(true);
        }