C# Class 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.
Afficher le fichier Open project: anvaka/slinject Class Usage Examples

Méthodes publiques

Méthode Description
DebugEngine ( int pid ) : System
SetAssemblyCode ( byte assembly ) : void
Start ( ) : void
Stop ( ) : void

Private Methods

Méthode Description
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

Method Details

DebugEngine() public méthode

public DebugEngine ( int pid ) : System
pid int
Résultat System

SetAssemblyCode() public méthode

public SetAssemblyCode ( byte assembly ) : void
assembly byte
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void