Table of Contents

Interface IUnknownResolver

Namespace
Echo.Platforms.AsmResolver.Emulation
Assembly
Echo.Platforms.AsmResolver.dll

Provides methods for resolving unknown values in critical points of the emulation process.

public interface IUnknownResolver

Methods

ResolveArrayIndex(CilExecutionContext, CilInstruction, long, StackSlot)

Resolves an unknown index of an element within an array.

long? ResolveArrayIndex(CilExecutionContext context, CilInstruction instruction, long arrayAddress, StackSlot index)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The switch instruction that is being executed.

arrayAddress long

The address of the array.

index StackSlot

The index to resolve.

Returns

long?

The resolved index, or null to treat it as an unknown value that is processed successfully.

ResolveBlockSize(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown size for a memory block.

uint ResolveBlockSize(CilExecutionContext context, CilInstruction instruction, StackSlot size)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The instruction that is being executed.

size StackSlot

The size to resolve.

Returns

uint

The resolved size, or null to treat it as an unknown value that is processed successfully.

ResolveBranchCondition(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown condition value of a unary conditional branch instruction.

bool ResolveBranchCondition(CilExecutionContext context, CilInstruction instruction, StackSlot argument)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The branch instruction that is being executed.

argument StackSlot

The condition to be resolved.

Returns

bool

true if the branch should be taken, false otherwise.

ResolveBranchCondition(CilExecutionContext, CilInstruction, StackSlot, StackSlot)

Resolves an unknown condition value of a binary conditional branch instruction.

bool ResolveBranchCondition(CilExecutionContext context, CilInstruction instruction, StackSlot argument1, StackSlot argument2)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The branch instruction that is being executed.

argument1 StackSlot

The first argument.

argument2 StackSlot

The second argument.

Returns

bool

true if the branch should be taken, false otherwise.

ResolveDelegateTarget(CilExecutionContext, ObjectHandle, IList<BitVector>)

IMethodDescriptor? ResolveDelegateTarget(CilExecutionContext context, ObjectHandle delegateObject, IList<BitVector> arguments)

Parameters

context CilExecutionContext
delegateObject ObjectHandle
arguments IList<BitVector>

Returns

IMethodDescriptor

ResolveDestinationPointer(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown destination address to a memory block or object to write data to.

long? ResolveDestinationPointer(CilExecutionContext context, CilInstruction instruction, StackSlot address)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The instruction that is being executed.

address StackSlot

The address to resolve.

Returns

long?

The resolved address, or null to treat it as an unknown value that is processed successfully.

ResolveExceptionFilter(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown conclusion for an exception filter.

bool ResolveExceptionFilter(CilExecutionContext context, CilInstruction instruction, StackSlot conclusion)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The instruction that is being executed.

conclusion StackSlot

The unknown conclusion value.

Returns

bool

true if the exception should be handled, false otherwise.

ResolveMethod(CilExecutionContext, CilInstruction, IList<BitVector>)

Resolves a method devirtualization on an unknown object instance.

IMethodDescriptor? ResolveMethod(CilExecutionContext context, CilInstruction instruction, IList<BitVector> arguments)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The instruction that is being executed.

arguments IList<BitVector>

Returns

IMethodDescriptor

The resolved method, or null if devirtualization should be ignored and the default implementation of the method should be used.

ResolveSourcePointer(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown source address to a memory block or object to read data from.

long? ResolveSourcePointer(CilExecutionContext context, CilInstruction instruction, StackSlot address)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The instruction that is being executed.

address StackSlot

The address to resolve.

Returns

long?

The resolved address, or null to treat it as an unknown value that is processed successfully.

ResolveSwitchCondition(CilExecutionContext, CilInstruction, StackSlot)

Resolves an unknown index value of a switch instruction.

uint? ResolveSwitchCondition(CilExecutionContext context, CilInstruction instruction, StackSlot argument)

Parameters

context CilExecutionContext

The context in which the instruction is executed in.

instruction CilInstruction

The switch instruction that is being executed.

argument StackSlot

The switch index to resolve.

Returns

uint?

The resolved index to jump to, or null to skip the switch instruction.