public ManagedDebuggerPatcherX86(DbgNativeFunctionHookContext context, DbgCorDebugInternalRuntime runtime)
 {
     if (context == null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     process      = context.Process;
     this.runtime = runtime ?? throw new ArgumentNullException(nameof(runtime));
 }
Beispiel #2
0
        public static bool TryGetInternalRuntime(DbgProcess process, out DbgCorDebugInternalRuntime runtime)
        {
            runtime = null;
            var dbgRuntime = process.Runtimes.FirstOrDefault();

            Debug.Assert(dbgRuntime != null);
            if (dbgRuntime == null)
            {
                return(false);
            }

            runtime = dbgRuntime.InternalRuntime as DbgCorDebugInternalRuntime;
            return(runtime != null);
        }
Beispiel #3
0
 public IsDebuggerPresentPatcherX86(DbgNativeFunctionHookContext context, DbgCorDebugInternalRuntime runtime)
     : base(context) => clrFilename = runtime.ClrFilename;
 void HookX64(DbgNativeFunctionHookContext context, DbgCorDebugInternalRuntime runtime, [NotNullWhen(false)] out string?errorMessage) =>
 new IsDebuggerPresentPatcherX86(context, runtime).TryPatchX64(dllName, out errorMessage);