Bitdefender Hypervisor Memory Introspection
lixdeployer.c File Reference
#include "lixdeployer.h"
#include "guests.h"
#include "kernvm.h"
#include "alerts.h"
#include "lixfiles.h"
#include "lixagent_ondemand.h"

Go to the source code of this file.

Functions

static INTSTATUS IntLixDepComplete (LIX_AGENT *Agent)
 
static INTSTATUS IntLixDepRunCommandComplete (LIX_AGENT *Agent)
 
static INTSTATUS IntLixDepGetInternalContent (DWORD Tag, BYTE **Address, DWORD *Length)
 
static INTSTATUS IntLixDepGetInternalArgs (DWORD Tag, DWORD Length, char *Args)
 
static INTSTATUS IntLixDepDeployFileHypercall (LIX_AGENT *Agent)
 Writes a chunk of the file into a allocated buffer by the agent. More...
 
INTSTATUS IntLixDepInjectFile (BYTE *Content, DWORD Size, const CHAR *Name)
 Injects an agent that deploy a file with the provided content and name on the disk. More...
 
INTSTATUS IntLixDepRunCommand (const CHAR *CommandLine)
 Injects an agent that creates a process that will execute the provided command line. More...
 
INTSTATUS IntLixDepInjectProcess (DWORD AgentTag, BYTE *Content, DWORD Size, const char *Name, const char *Args)
 Injects an agent that deploy a file to the disk and creates a process that execute the deployed file. More...
 

Function Documentation

◆ IntLixDepComplete()

static INTSTATUS IntLixDepComplete ( LIX_AGENT Agent)
static

Definition at line 15 of file lixdeployer.c.

Referenced by IntLixDepInjectFile(), and IntLixDepInjectProcess().

◆ IntLixDepDeployFileHypercall()

static INTSTATUS IntLixDepDeployFileHypercall ( LIX_AGENT Agent)
static

Writes a chunk of the file into a allocated buffer by the agent.

This function provide to the agent the number of bytes written.

Parameters
[in]AgentThe running agent.
Return values
INT_STATUS_SUCCESSOn success.

Definition at line 111 of file lixdeployer.c.

Referenced by IntLixDepInjectFile(), and IntLixDepInjectProcess().

◆ IntLixDepGetInternalArgs()

static INTSTATUS IntLixDepGetInternalArgs ( DWORD  Tag,
DWORD  Length,
char *  Args 
)
static

Definition at line 82 of file lixdeployer.c.

Referenced by IntLixDepInjectProcess().

◆ IntLixDepGetInternalContent()

static INTSTATUS IntLixDepGetInternalContent ( DWORD  Tag,
BYTE **  Address,
DWORD Length 
)
static

Definition at line 39 of file lixdeployer.c.

Referenced by IntLixDepInjectProcess().

◆ IntLixDepInjectFile()

INTSTATUS IntLixDepInjectFile ( BYTE Content,
DWORD  Size,
const CHAR Name 
)

Injects an agent that deploy a file with the provided content and name on the disk.

This function deploy the file to the root (/) directory. If there's another file with the same name, the existing file will be replaced.

Parameters
[in]ContentThe content of the file.
[in]SizeThe size of the content.
[in]NameThe name of the file.
Return values
INT_STATUS_SUCCESSOn success.
INT_STATUS_INVALID_PARAMETER_1If the content of the file is null.
INT_STATUS_INVALID_PARAMETER_2If the size of the file is 0.
INT_STATUS_INVALID_PARAMETER_3If the name of the file is null.
INT_STATUS_NOT_FOUNDIf the handler of the agent is not found.
INT_STATUS_ALREADY_INITIALIZED_HINTIf another agent is already running.

Definition at line 174 of file lixdeployer.c.

Referenced by IntDepInjectFile().

◆ IntLixDepInjectProcess()

INTSTATUS IntLixDepInjectProcess ( DWORD  AgentTag,
BYTE Content,
DWORD  Size,
const char *  Name,
const char *  Args 
)

Injects an agent that deploy a file to the disk and creates a process that execute the deployed file.

This function deploy the file to the root (/) directory. If there's another file with the same name, the existing file will be replaced. The deployed file is the first argument of the newly created process and the next arguments is provided by the caller, if any.

Parameters
[in]AgentTagThe tag used by the integrator.
[in]ContentThe content of the file.
[in]SizeThe size of the file.
[in]NameThe name of the file.
[in,out]ArgsThe arguments used by the created process.
Return values
INT_STATUS_SUCCESSOn success.
INT_STATUS_INVALID_PARAMETER_3If the name of the file is null.
INT_STATUS_NOT_FOUNDIf the handler of the agent is not found.
INT_STATUS_NOT_NEEDED_HINTIf the content of the file is empty and we decide that no agent should be deployed.
INT_STATUS_ALREADY_INITIALIZED_HINTIf another agent is already running.

Definition at line 337 of file lixdeployer.c.

Referenced by IntDepInjectProcess().

◆ IntLixDepRunCommand()

INTSTATUS IntLixDepRunCommand ( const CHAR CommandLine)

Injects an agent that creates a process that will execute the provided command line.

Parameters
[in]CommandLineThe command line to be executed.
Return values
INT_STATUS_SUCCESSOn success.
INT_STATUS_INVALID_PARAMETER_1If the command line is null.
INT_STATUS_NOT_FOUNDIf the handler of the agent is not found.
INT_STATUS_ALREADY_INITIALIZED_HINTIf another agent is already running.

Definition at line 266 of file lixdeployer.c.

Referenced by IntDepRunCommand().

◆ IntLixDepRunCommandComplete()

static INTSTATUS IntLixDepRunCommandComplete ( LIX_AGENT Agent)
static

Definition at line 28 of file lixdeployer.c.

Referenced by IntLixDepRunCommand().