C# Класс slinject.Debugger.DebugEngine

This is the heart of all injection logic. I'm sorry about its complexity. TODO: refactor it.
The injection is an asynchronous two-step process. It may only occur in FuncEval-safe points. Exceptions are considered to be FE-safe. The class also does support breakpoint FuncEval probbing but if breakpoint is set on optimized method - it's ignored. During first FuncEval call we initialize space in a target process to copy injection assembly code. Once space is initialized we copy code and invoke Assembly.Load() method. After the call is made we look closely at Module Loaded event to find confirmation that our assembly is loaded. When confirmation received we resolve address of the injector method and wait for the second FuncEval-safe event to perform call to injector.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DebugEngine ( int pid ) : System
SetAssemblyCode ( byte assembly ) : void
Start ( ) : void
Stop ( ) : void

Приватные методы

Метод Описание
CallInjector ( ICorDebugThread thread ) : void
CopyInjectorAssembly ( DebuggerEvalEventArgs e ) : ICorDebugValue
CreateCallback ( ) : ManagedCallback
InitializeDebugger ( ) : void
InvokeAssemblyLoad ( ICorDebugEval2 eval, ICorDebugValue assemblyCodeInTargetProcess ) : void
IsModuleInDomain ( DebugModule module, string domainName ) : bool
OnDebuggerBreakpoint ( object sender, DebuggerBreakpointEventArgs e ) : void
OnDebuggerDomainExited ( object sender, DebuggerDomainExitedEventArgs e ) : void
OnDebuggerEvalCompleted ( object sender, DebuggerEvalEventArgs e ) : void
OnDebuggerEvalFailed ( object sender, DebuggerEvalEventArgs e ) : void
OnDebuggerException ( object sender, DebuggerEventArgs e ) : void
OnDebuggerModuleLoaded ( object sender, DebuggerModuleLoadedEventArgs e ) : void
OnFinished ( ) : void
PerformFuncEval ( ICorDebugThread thread ) : void
PrepareToCopyInjectorAssembly ( ICorDebugThread thread ) : void
ResetOldMscrolibMethods ( ) : void
ResolveNewMscrolibMethods ( DebugModule mscorlib ) : void
SetPotentialBreakpoints ( List breakpoints ) : void
UpdateInjectorFunction ( DebugModule module ) : void

Описание методов

DebugEngine() публичный Метод

public DebugEngine ( int pid ) : System
pid int
Результат System

SetAssemblyCode() публичный Метод

public SetAssemblyCode ( byte assembly ) : void
assembly byte
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Stop() публичный Метод

public Stop ( ) : void
Результат void