Bitdefender Hypervisor Memory Introspection
patsig.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _PATSIG_H_
6 #define _PATSIG_H_
7 
8 #include "introtypes.h"
9 
11 #define SIG_MAX_PATTERN 128u
12 #define SIG_NOT_FOUND 0xFFFFFFFF
14 #define SIG_FOUND 0
16 
17 #pragma pack(push)
18 #pragma pack(1)
19 
23 typedef struct _PATTERN_SIGNATURE
24 {
34 
35 #pragma pack(pop)
36 
37 DWORD
39  _In_ const BYTE *Buffer,
40  _In_ DWORD SigCount,
41  _In_ const PATTERN_SIGNATURE *Sigs
42  );
43 
44 DWORD
46  _In_ const BYTE *Buffer,
47  _In_ const DWORD BufferSize,
48  _In_ DWORD SigCount,
49  _In_ const PATTERN_SIGNATURE *Sigs
50  );
51 
52 #endif // _PATSIG_H_
long long INT64
Definition: intro_types.h:45
uint8_t BYTE
Definition: intro_types.h:47
#define _In_
Definition: intro_sal.h:21
uint16_t WORD
Definition: intro_types.h:48
WORD Pattern[SIG_MAX_PATTERN]
Definition: patsig.h:32
struct _PATTERN_SIGNATURE PATTERN_SIGNATURE
Describes a signature that can be used for searching or matching guest contents.
DWORD Offset
Offset inside the tested buffer at which the pattern should be found.
Definition: patsig.h:27
DWORD IntPatternMatch(const BYTE *Buffer, DWORD SigCount, const PATTERN_SIGNATURE *Sigs)
Matches one of the given signatures on the given buffer.
Definition: patsig.c:9
DWORD Length
The valid size of the Pattern array.
Definition: patsig.h:25
DWORD IntPatternMatchAllOffsets(const BYTE *Buffer, const DWORD BufferSize, DWORD SigCount, const PATTERN_SIGNATURE *Sigs)
Matches one of the given signatures on the given buffer at any offset inside the given buffer...
Definition: patsig.c:56
uint32_t DWORD
Definition: intro_types.h:49
struct _PATTERN_SIGNATURE * PPATTERN_SIGNATURE
#define SIG_MAX_PATTERN
The maximum size of a pattern.
Definition: patsig.h:11
Describes a signature that can be used for searching or matching guest contents.
Definition: patsig.h:23
DWORD SignatureId
Signature ID.
Definition: patsig.h:26