RAMvader  1.4
A .NET library which provides access to other processes' memory space.
RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > Class Template Reference

More...

Public Member Functions

 CodeCaveBuilder (Injector< TMemoryAlterationSetID, TCodeCave, TVariable > injector)
 Constructor. More...
 
CodeCaveDefinition< TMemoryAlterationSetID, TCodeCave, TVariable > Build ()
 Called as the last step for building a CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable>, returning the produced definition. More...
 
CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > VarAddr (TVariable varId)
 Adds the bytes that represent the address of an injected code cave to the code cave being built. This effectivelly adds a CodeCaveArtifactVariableAddress<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts. More...
 
CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > CaveAddr (TCodeCave caveId)
 Adds the bytes that represent the address of an injected variable to the code cave being built. This effectivelly adds a CodeCaveArtifactCodeCaveAddress<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts. More...
 
CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > SBytes (params sbyte[] bytes)
 Adds the given sequence of signed bytes (SByte) to the code cave being built. This effectivelly adds a CodeCaveArtifactSByteSequence<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts. More...
 
CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > Bytes (params byte[] bytes)
 Adds the given sequence of unsigned bytes (Byte) to the code cave being built. This effectivelly adds a CodeCaveArtifactByteSequence<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts. More...
 
CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable > X86Branch (EX86BranchInstructionType instructionType, MemoryAddress targetAddress)
 Adds the bytes corresponding to an x86 branch instruction to the code cave being built. This effectivelly adds a CodeCaveArtifactX86BranchInstruction<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts. More...
 

Detailed Description

A class specialized in building CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable> objects. This class follows a fluid design pattern, allowing calls to its code cave construction-related methods to be cascaded, making code easier to read and maintain.

Under the hoods, this class generates CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects, which are kept in a list that can be used to generate the code cave definition.

Constructor & Destructor Documentation

◆ CodeCaveBuilder()

RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.CodeCaveBuilder ( Injector< TMemoryAlterationSetID, TCodeCave, TVariable >  injector)

Constructor.

Parameters
injectorA reference to the Injector<TMemoryAlterationSetID, TCodeCave, TVariable> object to which the CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable> objects will be created.

Member Function Documentation

◆ Build()

CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.Build ( )

Called as the last step for building a CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable>, returning the produced definition.

Returns
Returns the created CodeCaveDefinition<TMemoryAlterationSetID, TCodeCave, TVariable> instance.

◆ Bytes()

CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.Bytes ( params byte []  bytes)

Adds the given sequence of unsigned bytes (Byte) to the code cave being built. This effectivelly adds a CodeCaveArtifactByteSequence<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts.

Parameters
bytesThe sequence of (unsigned) bytes which will be added.
Returns
Returns a reference to the object used to call the method.

◆ CaveAddr()

CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.CaveAddr ( TCodeCave  caveId)

Adds the bytes that represent the address of an injected variable to the code cave being built. This effectivelly adds a CodeCaveArtifactCodeCaveAddress<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts.

Parameters
caveIdThe identifier of the code cave whose address will be added.
Returns
Returns a reference to the object used to call the method.

◆ SBytes()

CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.SBytes ( params sbyte []  bytes)

Adds the given sequence of signed bytes (SByte) to the code cave being built. This effectivelly adds a CodeCaveArtifactSByteSequence<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts.

Parameters
bytesThe sequence of (signed) bytes which will be added.
Returns
Returns a reference to the object used to call the method.

◆ VarAddr()

CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.VarAddr ( TVariable  varId)

Adds the bytes that represent the address of an injected code cave to the code cave being built. This effectivelly adds a CodeCaveArtifactVariableAddress<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts.

Parameters
varIdThe identifier of the variable whose address will be added.
Returns
Returns a reference to the object used to call the method.

◆ X86Branch()

CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable> RAMvader.CodeInjection.CodeCaveBuilder< TMemoryAlterationSetID, TCodeCave, TVariable >.X86Branch ( EX86BranchInstructionType  instructionType,
MemoryAddress  targetAddress 
)

Adds the bytes corresponding to an x86 branch instruction to the code cave being built. This effectivelly adds a CodeCaveArtifactX86BranchInstruction<TMemoryAlterationSetID, TCodeCave, TVariable> artifact to the list of generated artifacts.

Parameters
instructionTypeThe type of branch instruction to be generated.
targetAddressThe target address of the branching instruction.
Returns
Returns a reference to the object used to call the method.