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

This class holds the definition of a Code Cave that can be injected into a process' memory space by using the Injector<TMemoryAlterationSetID, TCodeCave, TVariable>. A code cave is made up of a list of CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects, which hold all the information used by the Injector<TMemoryAlterationSetID, TCodeCave, TVariable> to generate the bytes of the code cave, which are then injected into the target process' memory space. More...

Public Member Functions

 CodeCaveDefinition ()
 Constructor. More...
 
void SetArtifactsArray (CodeCaveArtifact< TMemoryAlterationSetID, TCodeCave, TVariable > [] artifacts)
 Allows you to manually set the CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects to be used to generate the code cave. Code caves are usually created by using a CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable>, which is the recommended way. This method can be used as an alternative to using the builder approach. More...
 
CodeCaveArtifact< TMemoryAlterationSetID, TCodeCave, TVariable > [] GetArtifactsArray ()
 Retrieves the array of CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects used to generate the code cave. More...
 
byte [] GenerateCodeCaveBytes (Injector< TMemoryAlterationSetID, TCodeCave, TVariable > injector)
 
int GetCodeCaveSize (Target target)
 Calculates and retrieves the size of the code cave. More...
 

Detailed Description

This class holds the definition of a Code Cave that can be injected into a process' memory space by using the Injector<TMemoryAlterationSetID, TCodeCave, TVariable>. A code cave is made up of a list of CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects, which hold all the information used by the Injector<TMemoryAlterationSetID, TCodeCave, TVariable> to generate the bytes of the code cave, which are then injected into the target process' memory space.

Constructor & Destructor Documentation

◆ CodeCaveDefinition()

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

Constructor.

Member Function Documentation

◆ GenerateCodeCaveBytes()

byte [] RAMvader.CodeInjection.CodeCaveDefinition< TMemoryAlterationSetID, TCodeCave, TVariable >.GenerateCodeCaveBytes ( Injector< TMemoryAlterationSetID, TCodeCave, TVariable >  injector)

Processes the list of CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects that define the code cave, and generates the bytes that represent the code cave, as it should be injected in the target process' memory space.

This method should be called by the Injector<TMemoryAlterationSetID, TCodeCave, TVariable> during the code injection process only.

Parameters
injectorThe Injector<TMemoryAlterationSetID, TCodeCave, TVariable> object used to retrieve the bytes of the code cave.
Returns
Returns a byte sequence representing the code cave, ready to be injected into the game's memory.

◆ GetArtifactsArray()

CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> [] RAMvader.CodeInjection.CodeCaveDefinition< TMemoryAlterationSetID, TCodeCave, TVariable >.GetArtifactsArray ( )

Retrieves the array of CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects used to generate the code cave.

Returns
Returns the array of artifacts used to generate the code cave.

◆ GetCodeCaveSize()

int RAMvader.CodeInjection.CodeCaveDefinition< TMemoryAlterationSetID, TCodeCave, TVariable >.GetCodeCaveSize ( Target  target)

Calculates and retrieves the size of the code cave.

Parameters
targetThe instance of Target that is setup to access the target process' memory space. This instance is used to know properties of the target process, such as its pointers size.
Returns
Returns the number of bytes of size for the code cave.

◆ SetArtifactsArray()

void RAMvader.CodeInjection.CodeCaveDefinition< TMemoryAlterationSetID, TCodeCave, TVariable >.SetArtifactsArray ( CodeCaveArtifact< TMemoryAlterationSetID, TCodeCave, TVariable > []  artifacts)

Allows you to manually set the CodeCaveArtifact<TMemoryAlterationSetID, TCodeCave, TVariable> objects to be used to generate the code cave. Code caves are usually created by using a CodeCaveBuilder<TMemoryAlterationSetID, TCodeCave, TVariable>, which is the recommended way. This method can be used as an alternative to using the builder approach.

Parameters
artifactsThe array containing the artifacts that will be used to generate the code cave.