-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathOperationLocateHash.h
More file actions
37 lines (27 loc) · 959 Bytes
/
OperationLocateHash.h
File metadata and controls
37 lines (27 loc) · 959 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
37
#pragma once
#include <Windows.h>
#include <regex>
#include <vector>
#include "Operation.h"
class OperationLocateHash final : public Operation
{
// statics used by command registration utility
static std::wstring GetCommand() { return L"LocateHash"; }
static ClassFactory<OperationLocateHash> RegisteredFactory;
// operation specific
HANDLE hReportFile = INVALID_HANDLE_VALUE;
std::wregex tRegex;
std::vector<BYTE> aHashToMatch;
LONGLONG iSizeToMatch = -1;
// hashing environment (algorithm handle and hash length are read-only after construction;
// per-thread hash/buffer state lives as thread_local inside ProcessObjectAction)
BCRYPT_ALG_HANDLE hAlgHandle = nullptr;
DWORD iHashLength = 0;
public:
// overrides
void ProcessObjectAction(ObjectEntry & tObjectEntry) override;
// constructors
OperationLocateHash(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
// destructor
~OperationLocateHash() override;
};