forked from alpet83/Xray-Research
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CopyProtection.h
49 lines (39 loc) · 911 Bytes
/
CopyProtection.h
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
#pragma once
#ifndef DEBUG
//#define USE_COPYPROTECTION
#endif
// [4/28/2004]
#ifdef USE_COPYPROTECTION
#pragma pack(push,1)
typedef struct SECUROM_PID{
int pid_error;
unsigned long pid_version;
union{
unsigned char pid_buf[264];
struct{
unsigned char pid_reserved[3];
unsigned char pid_type;
unsigned long pid_length;
unsigned char pid_data[256];
};
};
}tSECUROM_PID;
#pragma pack(pop)
IC void CheckCopyProtection ()
{
u32 ret;
__asm{
mov eax,8791h;
mov ebx,2107h;
mov ecx,6345h;
};
ret=GetVersion();
if(ret!=0x6345){
MessageBox(NULL,"Copy protection violation!","Error",MB_OK | MB_ICONHAND);
TerminateProcess(GetCurrentProcess(),0x66);
}
}
#else
IC void CheckCopyProtection () {
}
#endif