-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmemoryBlock.h
More file actions
36 lines (29 loc) · 793 Bytes
/
memoryBlock.h
File metadata and controls
36 lines (29 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __MEMORY_BLOCK_H
#define __MEMORY_BLOCK_H
#include <unistd.h>
#include "compareUtils.h"
namespace detect_similar
{
using namespace std;
struct MemoryBlock
{
MemoryBlock(const MemoryBlock &memoryBlock);
MemoryBlock();
MemoryBlock(int size, const unsigned char *d = NULL);
virtual ~MemoryBlock();
size_t compareDiff(MemoryBlock &shellcode, float threshold);
size_t compareNgram(MemoryBlock &shellcode);
void link(const unsigned char *data, size_t data_size);
const unsigned char *data;
unsigned int size;
protected:
public:
bool possibleDiff(const unsigned char *data, size_t data_size, float threshold);
void checkStatBlock();
void checkStatByte();
bool _del_flag;
uint32_t *statByte;
unordered_map<mblock, size_t> statBlock;
};
} //namespace detect_similar
#endif