Bitdefender Hypervisor Memory Introspection
introcrt.h File Reference
#include "rbtree.h"
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "introtypes.h"
#include "pgtable.h"

Go to the source code of this file.

Macros

#define strlen_s(s, n)   strnlen(s, n)
 
#define memzero(a, s)   memset(a, 0, s)
 

Functions

int strlower_utf16 (WCHAR *buf, size_t len)
 
int strlower_utf8 (char *buf, size_t len)
 
int wstrcmp (const WCHAR *buf1, const WCHAR *buf2)
 
int wstrcasecmp (const WCHAR *buf1, const WCHAR *buf2)
 
int wstrncasecmp (const WCHAR *buf1, const WCHAR *buf2, size_t len)
 
const WCHARstrstr_utf16 (const WCHAR *buf1, const WCHAR *buf2)
 
int strcasecmp_utf8_utf16 (const char *buf1, const WCHAR *buf2, size_t len)
 
char * utf16toutf8 (char *Destination, const WCHAR *Source, DWORD DestinationMaxLength)
 
char * utf16tolowerutf8 (char *Destination, const WCHAR *Source, DWORD DestinationMaxLength)
 
WCHARutf8toutf16 (WCHAR *Destination, const char *Source, DWORD DestinationMaxLength)
 
int is_str_ansi (const char *Buffer, size_t MaxBufferSize, size_t MinSize)
 
void memcpy_end (void *Destination, const void *Source, size_t DestinationSize, size_t SourceSize)
 
long long my_llabs (long long value)
 
BOOLEAN glob_match_utf8 (char const *Pattern, char const *String, BOOLEAN IgnoreCase, BOOLEAN Truncated)
 
BOOLEAN glob_match_numeric_utf8 (char const *Pattern, char const *String)
 
BOOLEAN glob_match_utf16 (char const *Pattern, WCHAR const *String, BOOLEAN IgnoreCase, BOOLEAN Truncated)
 
size_t wstrnlen (const WCHAR *s, size_t maxlen)
 
size_t wstrlen (const WCHAR *str)
 
size_t strlcpy (char *dst, const char *src, size_t dest_size)
 
size_t wstrlcpy (WCHAR *dst, const WCHAR *src, size_t dest_size)
 
size_t strlcat (char *dst, const char *src, size_t size)
 
int nd_vsnprintf_s (char *str, size_t sizeOfBuffer, size_t count, const char *format, va_list args)
 
static int wstrncasecmp_len (const WCHAR *buf1, const WCHAR *buf2, size_t len_buf1, size_t len_buf2)
 
static int strncasecmp_len (const char *buf1, const char *buf2, size_t len_buf1, size_t len_buf2)
 
static int strcasecmp_utf8_utf16_len (const char *buf1, const WCHAR *buf2, size_t len_buf1, size_t len_buf2)
 
static int memcmp_len (const void *buf1, const void *buf2, size_t len_buf1, size_t len_buf2)
 

Macro Definition Documentation

◆ memzero

#define memzero (   a,
 
)    memset(a, 0, s)

Definition at line 35 of file introcrt.h.

Referenced by GlueIsScanEnginesApiAvailable(), IntAlertFillCodeBlocks(), IntAlertFillConnection(), IntCrLixHandleWrite(), IntCrSendAlert(), IntCrWinHandleWrite(), IntDetSendIntegrityAlert(), IntDetUninit(), IntDriverCacheCreateExport(), IntDriverCacheCreateUnknown(), IntDriverCacheInv(), IntDtrHandleWrite(), IntDtrSendAlert(), IntEngSendExecViolation(), IntExceptInvCbCacheByCr3(), IntExceptInvCbCacheByGva(), IntExceptUninit(), IntExceptUserGetExecOriginator(), IntExceptUserHandleMemoryFunctions(), IntFragExtractCodeBlocks(), IntGlueReset(), IntGuestInit(), IntGuestUninit(), IntHookGvaEnableHooks(), IntHookPtsHandleModification(), IntLixAgentInit(), IntLixAgentSendEvent(), IntLixAgentUninit(), IntLixCmdLineSendViolationEvent(), IntLixCrashSendPanicEvent(), IntLixDrvSendEvent(), IntLixDrvSendViolationEvent(), IntLixGuestClearGuestMemory(), IntLixGuestNew(), IntLixIdtWriteHandler(), IntLixKernelHandleRead(), IntLixMsrHandleWrite(), IntLixStackTraceGet(), IntLixStackTraceGetReg(), IntLixTaskGetTrapFrame(), IntLixTaskHandleInjection(), IntLixTaskSendAgentEvent(), IntLixTaskSendBlockedEvent(), IntLixTaskSendCredViolationEvent(), IntLixTaskSendExceptionEvent(), IntLixTaskSendInjectionEvent(), IntLixTaskSendTaskEvent(), IntLixUnpatchSwapgs(), IntLixVdsoHandleWriteCommon(), IntLixVmaFill(), IntPeGetSectionHeaderByRva(), IntPeGetSectionHeadersByName(), IntPtiRemovePtFilter(), IntSerializeCodeBlocks(), IntShcIsSuspiciousCode(), IntSlackSendIntegrityAlert(), IntSwapMemUnInit(), IntTranslateVirtualAddressEx(), IntVasUnInit(), IntVeHandleAccess(), IntVeHandleEPTViolationInProtectedView(), IntVeRemoveAgent(), IntWinAgentUnInit(), IntWinBcSendBsodEvent(), IntWinCrashHandleDepViolation(), IntWinDagentHandleSlackWritable(), IntWinDagentSendDoubleAgentAlert(), IntWinDepComplete(), IntWinDepDeploy(), IntWinDpiSendProcessCreationViolation(), IntWinDrvHandleRead(), IntWinDrvHandleWrite(), IntWinDrvObjHandleModification(), IntWinDrvObjHandleWrite(), IntWinDrvObjSendEptAlert(), IntWinDrvObjSendIntegrityAlert(), IntWinDrvSendAlert(), IntWinDrvSendEvent(), IntWinGuestFindKernelCr3(), IntWinGuestNew(), IntWinHalHandleDispatchTableWrite(), IntWinHalHandleHalHeapExec(), IntWinHalHandleHalIntCtrlWrite(), IntWinHalSendAlert(), IntWinHalSendPerfCntIntegrityAlert(), IntWinIdtSendIntegrityAlert(), IntWinIdtWriteHandler(), IntWinInfHookEptSppSendAlert(), IntWinInfHookIntegritySendAlert(), IntWinInfHookUnprotect(), IntWinIntObjSendIntegrityAlert(), IntWinModHandleKernelWrite(), IntWinModHandleUserWrite(), IntWinModPolyHandler(), IntWinMsrHandleWrite(), IntWinMsrSendAlert(), IntWinProcHandleCopyMemory(), IntWinProcHandleInstrument(), IntWinProcSendAgentEvent(), IntWinProcSendDllEvent(), IntWinProcSendProcessEvent(), IntWinProcSendProcessExceptionEvent(), IntWinProcValidateSystemCr3(), IntWinSDSendAclIntegrityViolation(), IntWinSDSendSecDescIntViolation(), IntWinSelfMapHandleCr3SelfMapModification(), IntWinSelfMapHandleCr3SelfMapWrite(), IntWinSendCmdLineViolation(), IntWinStackTraceGet64(), IntWinStackTraceGetUser(), IntWinSudSendSudExecAlert(), IntWinSudSendSudIntegrityAlert(), IntWinThrHandleQueueApc(), IntWinThrHandleThreadHijack(), IntWinTokenPrivsSendEptAlert(), IntWinTokenPrivsSendIntegrityAlert(), IntWinTokenPtrCheckIntegrityOnProcess(), IntWinVadIsExecSuspicious(), and RbPreinit().

◆ strlen_s

#define strlen_s (   s,
 
)    strnlen(s, n)

Function Documentation

◆ glob_match_numeric_utf8()

BOOLEAN glob_match_numeric_utf8 ( char const *  Pattern,
char const *  String 
)

Definition at line 766 of file introcrt.c.

Referenced by IntCamiLoadLinux(), and IntCamiLoadProtOptionsLinux().

◆ glob_match_utf16()

BOOLEAN glob_match_utf16 ( char const *  Pattern,
WCHAR const *  String,
BOOLEAN  IgnoreCase,
BOOLEAN  Truncated 
)

Definition at line 909 of file introcrt.c.

Referenced by IntExceptUser(), and IntExceptUserMatchNameGlob().

◆ glob_match_utf8()

BOOLEAN glob_match_utf8 ( char const *  Pattern,
char const *  String,
BOOLEAN  IgnoreCase,
BOOLEAN  Truncated 
)

◆ is_str_ansi()

int is_str_ansi ( const char *  Buffer,
size_t  MaxBufferSize,
size_t  MinSize 
)

Definition at line 527 of file introcrt.c.

Referenced by IntReadString().

◆ memcmp_len()

static int memcmp_len ( const void *  buf1,
const void *  buf2,
size_t  len_buf1,
size_t  len_buf2 
)
inlinestatic

◆ memcpy_end()

void memcpy_end ( void *  Destination,
const void *  Source,
size_t  DestinationSize,
size_t  SourceSize 
)

Definition at line 576 of file introcrt.c.

◆ my_llabs()

long long my_llabs ( long long  value)

Definition at line 600 of file introcrt.c.

Referenced by IntExceptVerifyCodeBlocksSig().

◆ nd_vsnprintf_s()

int nd_vsnprintf_s ( char *  str,
size_t  sizeOfBuffer,
size_t  count,
const char *  format,
va_list  args 
)

Definition at line 1226 of file introcrt.c.

◆ strcasecmp_utf8_utf16()

int strcasecmp_utf8_utf16 ( const char *  buf1,
const WCHAR buf2,
size_t  len 
)

Definition at line 413 of file introcrt.c.

Referenced by strcasecmp_utf8_utf16_len().

◆ strcasecmp_utf8_utf16_len()

static int strcasecmp_utf8_utf16_len ( const char *  buf1,
const WCHAR buf2,
size_t  len_buf1,
size_t  len_buf2 
)
inlinestatic

Definition at line 261 of file introcrt.h.

◆ strlcat()

size_t strlcat ( char *  dst,
const char *  src,
size_t  size 
)

Definition at line 1169 of file introcrt.c.

◆ strlcpy()

◆ strlower_utf16()

int strlower_utf16 ( WCHAR buf,
size_t  len 
)

◆ strlower_utf8()

int strlower_utf8 ( char *  buf,
size_t  len 
)

◆ strncasecmp_len()

static int strncasecmp_len ( const char *  buf1,
const char *  buf2,
size_t  len_buf1,
size_t  len_buf2 
)
inlinestatic

Definition at line 241 of file introcrt.h.

◆ strstr_utf16()

const WCHAR* strstr_utf16 ( const WCHAR buf1,
const WCHAR buf2 
)

Definition at line 195 of file introcrt.c.

Referenced by IntWinModCheckSpecialCases().

◆ utf16tolowerutf8()

char* utf16tolowerutf8 ( char *  Destination,
const WCHAR Source,
DWORD  DestinationMaxLength 
)

Definition at line 480 of file introcrt.c.

Referenced by IntWinGetProcCmdLineHandleBufferInMemory().

◆ utf16toutf8()

char* utf16toutf8 ( char *  Destination,
const WCHAR Source,
DWORD  DestinationMaxLength 
)

◆ utf8toutf16()

WCHAR* utf8toutf16 ( WCHAR Destination,
const char *  Source,
DWORD  DestinationMaxLength 
)

◆ wstrcasecmp()

◆ wstrcmp()

int wstrcmp ( const WCHAR buf1,
const WCHAR buf2 
)

Definition at line 86 of file introcrt.c.

◆ wstrlcpy()

size_t wstrlcpy ( WCHAR dst,
const WCHAR src,
size_t  dest_size 
)

◆ wstrlen()

◆ wstrncasecmp()

int wstrncasecmp ( const WCHAR buf1,
const WCHAR buf2,
size_t  len 
)

◆ wstrncasecmp_len()

static int wstrncasecmp_len ( const WCHAR buf1,
const WCHAR buf2,
size_t  len_buf1,
size_t  len_buf2 
)
inlinestatic

◆ wstrnlen()

size_t wstrnlen ( const WCHAR s,
size_t  maxlen 
)

Definition at line 1064 of file introcrt.c.

Referenced by IntAlertGetHashForLinuxName(), and IntAlertGetHashForWindowsName().