Bitdefender Hypervisor Memory Introspection
handlers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _HANDLERS_H_
6 #define _HANDLERS_H_
7 
8 #pragma pack(push, 8)
9 
10 typedef enum {
38 
40 } DETOUR_ID;
41 
42 typedef char * (d_path_fn)(void *path, char *buf, int buflen);
43 
44 typedef struct _LIX_GUEST_OS_SPECIFIC {
45  struct {
46  unsigned int MmOffset;
47  unsigned int FlagsOffset;
48  unsigned int FileOffset;
49  unsigned int VmNextOffset;
50  unsigned int VmPrevOffset;
51  unsigned int Rb;
52 
53  unsigned int ProtectionBit;
54  } Vma;
55 
56  struct {
57  unsigned int FlagsOffset;
58  unsigned int Rb;
59 
60  unsigned int ProtectionBit;
61  } Mm;
62 
63  struct {
64  unsigned int InExecve;
65  unsigned int InExecveBit;
66  } Task;
67 
68  struct {
69  unsigned int FileOffset;
70  } Binprm;
71 
72  struct {
73  unsigned int DentryOffset;
74  unsigned int PathOffset;
75  } File;
76 
77  struct {
78  unsigned int InodeOffset;
79  } Dentry;
80 
81  struct {
82  unsigned int Mode;
83  unsigned int Uid;
84  unsigned int Gid;
85  } Inode;
86 
87  unsigned int CurrentTaskOffset;
88  unsigned int CurrentCpuOffset;
89 
90  void *PercpuMemPtr;
93 
94 
95 typedef struct _LIX_GUEST_DETOUR {
96  char Name[32];
97  char HijackName[32];
98  unsigned long long Address;
99  unsigned long long RelocatedCode;
100  unsigned long long JumpBack;
101  unsigned long long EnableOptions;
103 
104 
105 typedef struct _LIX_HYPERCALL_PAGE
106 {
107  unsigned long long ProtectionOptions;
108  unsigned long long DetoursCount;
109 
111 
114 
115 #pragma pack(pop)
116 
117 #endif // _HANDLERS_H_
struct _LIX_GUEST_DETOUR LIX_GUEST_DETOUR
unsigned long long Address
Definition: handlers.h:98
struct _LIX_GUEST_OS_SPECIFIC::@260 Inode
unsigned int VmPrevOffset
Definition: handlers.h:50
struct _LIX_GUEST_OS_SPECIFIC::@254 Vma
unsigned int DentryOffset
Definition: handlers.h:73
LIX_GUEST_OS_SPECIFIC OsSpecificFields
Definition: handlers.h:112
unsigned long long EnableOptions
Definition: handlers.h:101
unsigned int FileOffset
Definition: handlers.h:48
unsigned int Gid
Definition: handlers.h:84
char *() d_path_fn(void *path, char *buf, int buflen)
Definition: handlers.h:42
unsigned int Rb
Definition: handlers.h:51
unsigned int CurrentCpuOffset
Definition: handlers.h:88
d_path_fn * DPathFnPtr
Definition: handlers.h:91
unsigned int InExecveBit
Definition: handlers.h:65
struct _LIX_GUEST_OS_SPECIFIC::@256 Task
unsigned int InodeOffset
Definition: handlers.h:78
unsigned int Uid
Definition: handlers.h:83
struct _LIX_GUEST_OS_SPECIFIC::@259 Dentry
unsigned int CurrentTaskOffset
Definition: handlers.h:87
struct _LIX_HYPERCALL_PAGE LIX_HYPERCALL_PAGE
unsigned int InExecve
Definition: handlers.h:64
struct _LIX_GUEST_OS_SPECIFIC::@257 Binprm
unsigned int ProtectionBit
Definition: handlers.h:53
unsigned int MmOffset
Definition: handlers.h:46
unsigned int PathOffset
Definition: handlers.h:74
struct _LIX_GUEST_OS_SPECIFIC::@255 Mm
unsigned int VmNextOffset
Definition: handlers.h:49
unsigned int Mode
Definition: handlers.h:82
unsigned int FlagsOffset
Definition: handlers.h:47
unsigned long long RelocatedCode
Definition: handlers.h:99
unsigned long long ProtectionOptions
Definition: handlers.h:107
unsigned long long DetoursCount
Definition: handlers.h:108
struct _LIX_GUEST_OS_SPECIFIC LIX_GUEST_OS_SPECIFIC
unsigned long long JumpBack
Definition: handlers.h:100
struct _LIX_GUEST_OS_SPECIFIC::@258 File
DETOUR_ID
Definition: handlers.h:10