aboutsummaryrefslogtreecommitdiff
path: root/runtime/hwid.h
diff options
context:
space:
mode:
authorjmpoep <OriginalEntryPoint@qq.com>2023-12-07 16:51:07 +0800
committerjmpoep <OriginalEntryPoint@qq.com>2023-12-07 16:51:07 +0800
commit28008a746a31abb7909dd86cb0cd413ac8943b0b (patch)
treea30b74b8cad548048c3c1551d652828ab76fa9bd /runtime/hwid.h
downloadvmprotect-3.5.1-master.tar
vmprotect-3.5.1-master.tar.gz
vmprotect-3.5.1-master.tar.bz2
vmprotect-3.5.1-master.zip
first commitHEADmaster
Diffstat (limited to 'runtime/hwid.h')
-rw-r--r--runtime/hwid.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/runtime/hwid.h b/runtime/hwid.h
new file mode 100644
index 0000000..c9d17a0
--- /dev/null
+++ b/runtime/hwid.h
@@ -0,0 +1,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 \ No newline at end of file