blob: c9d17a0a4b286b9fe29cffd19b191224f9885dc1 (
plain)
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
38
39
40
41
42
43
44
45
|
#ifndef HWID_H
#define HWID_H
class CryptoContainer;
class HardwareID
{
public:
HardwareID();
~HardwareID();
size_t Copy(void *dest, size_t size) const;
int GetCurrent(char *buffer, int size);
bool IsCorrect(uint8_t *p, size_t s) const;
bool IsCorrect(CryptoContainer &cont, size_t offset, size_t size) const;
private:
enum {
MAX_BLOCKS = 16,
TYPE_MASK = 3
};
enum BlockType {
BLOCK_CPU,
BLOCK_HOST,
BLOCK_MAC,
BLOCK_HDD,
};
uint32_t block_count_;
uint32_t start_block_;
CryptoContainer *blocks_;
void AddBlock(const void *p, size_t size, BlockType type);
void ProcessMAC(const uint8_t *p, size_t size);
void ProcessCPU(uint8_t method);
void GetCPU(uint8_t method);
void GetMacAddresses();
void GetMachineName();
void GetHDD();
// no copy ctr or assignment op
HardwareID(const HardwareID &);
HardwareID &operator =(const HardwareID &);
};
#endif
|