Bitdefender Hypervisor Memory Introspection
exec.c File Reference
#include "../common.h"

Go to the source code of this file.

Data Structures

struct  data
 

Typedefs

typedef void *() filp_open_fn(const char *filename, int flags, unsigned short mode)
 
typedef int() filp_close_fn(void *filp, void *id)
 
typedef void() flush_delayed_fput_fn(void)
 
typedef void *() vmalloc_fn(unsigned long size)
 
typedef unsigned int() __kernel_write_fn(void *file, const void *buf, unsigned int count, long long *pos)
 
typedef int() kernel_write_fn(void *file, const char *buf, size_t count, unsigned long pos)
 
typedef void() vfree_fn(void *ptr)
 
typedef char **() argv_split_fn(unsigned int gfp, const char *str, int *argcp)
 
typedef void() argv_free_fn(char **argv)
 
typedef void *() call_usermodehelper_setup_fn(const char *path, char **argv, char **envp, unsigned long gfp_mask, int(*init) (void *info, void *new), void(*cleanup) (void *info), void *data)
 
typedef int() call_usermodehelper_exec_fn(void *sub_info, int wait)
 
typedef void() do_exit_fn(long code)
 
typedef int() printk_fn(const char *fmt,...)
 
typedef int() chmod_common_fn(void *path, unsigned short mode)
 

Functions

struct data _data __aligned (1)
 The section used for this agent is .adata'. More...
 
__default_fn_attr int call_usermodehelper (const char *path, char **argv, char **envp, unsigned int wait)
 
__default_fn_attr void exec (void)
 Deploys the provided content on the disk and creates a new process of that content. More...
 
__fn_naked void trampoline (void)
 The trampoline of the agent. More...
 

Variables

void * __address
 

Typedef Documentation

◆ __kernel_write_fn

typedef unsigned int() __kernel_write_fn(void *file, const void *buf, unsigned int count, long long *pos)

Definition at line 11 of file exec.c.

◆ argv_free_fn

typedef void() argv_free_fn(char **argv)

Definition at line 15 of file exec.c.

◆ argv_split_fn

typedef char**() argv_split_fn(unsigned int gfp, const char *str, int *argcp)

Definition at line 14 of file exec.c.

◆ call_usermodehelper_exec_fn

typedef int() call_usermodehelper_exec_fn(void *sub_info, int wait)

Definition at line 18 of file exec.c.

◆ call_usermodehelper_setup_fn

typedef void*() call_usermodehelper_setup_fn(const char *path, char **argv, char **envp, unsigned long gfp_mask, int(*init)(void *info, void *new), void(*cleanup)(void *info), void *data)

Definition at line 16 of file exec.c.

◆ chmod_common_fn

typedef int() chmod_common_fn(void *path, unsigned short mode)

Definition at line 21 of file exec.c.

◆ do_exit_fn

typedef void() do_exit_fn(long code)

Definition at line 19 of file exec.c.

◆ filp_close_fn

typedef int() filp_close_fn(void *filp, void *id)

Definition at line 8 of file exec.c.

◆ filp_open_fn

typedef void*() filp_open_fn(const char *filename, int flags, unsigned short mode)

Definition at line 7 of file exec.c.

◆ flush_delayed_fput_fn

typedef void() flush_delayed_fput_fn(void)

Definition at line 9 of file exec.c.

◆ kernel_write_fn

typedef int() kernel_write_fn(void *file, const char *buf, size_t count, unsigned long pos)

Definition at line 12 of file exec.c.

◆ printk_fn

typedef int() printk_fn(const char *fmt,...)

Definition at line 20 of file exec.c.

◆ vfree_fn

typedef void() vfree_fn(void *ptr)

Definition at line 13 of file exec.c.

◆ vmalloc_fn

typedef void*() vmalloc_fn(unsigned long size)

Definition at line 10 of file exec.c.

Function Documentation

◆ __aligned()

struct data _data __aligned ( )

The section used for this agent is .adata'.

◆ call_usermodehelper()

__default_fn_attr int call_usermodehelper ( const char *  path,
char **  argv,
char **  envp,
unsigned int  wait 
)

Definition at line 75 of file exec.c.

Referenced by exec().

◆ exec()

__default_fn_attr void exec ( void  )

Deploys the provided content on the disk and creates a new process of that content.

If an error occurs, the Intocore is notified.

Definition at line 89 of file exec.c.

Referenced by trampoline().

◆ trampoline()

__fn_naked void trampoline ( void  )

The trampoline of the agent.

Calls the exec function and calls 'do_exit'.

The section used for this function is '.start'.

Definition at line 220 of file exec.c.

Variable Documentation

◆ __address

void* __address