blob: 939ebc090fce988e42feceec271e6f7429fe48d2 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
#pragma once
#ifndef WR_PCH
#define WR_PCH
#ifndef VMP_GNU
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#endif
#include "precommon.h"
#ifdef WIN_DRIVER
void * __cdecl operator new(size_t size);
void __cdecl operator delete(void* p);
void __cdecl operator delete(void* p, size_t);
void * __cdecl operator new[](size_t size);
void __cdecl operator delete[](void *p);
#endif
#define RUNTIME
#ifdef VMP_GNU
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/ptrace.h>
#ifdef __APPLE__
#include <net/if_dl.h>
#include <net/if_types.h>
#include <sys/syslimits.h>
#include <mach/mach_init.h>
#include <mach/mach_time.h>
#include <mach/vm_map.h>
#include <mach-o/dyld.h>
#include <mach-o/fat.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
#include <SystemConfiguration/SystemConfiguration.h>
#endif
#define WINAPI
#ifdef __APPLE__
#define EXPORT_API __attribute__ ((visibility ("default")))
#else
#define EXPORT_API __attribute__ ((visibility ("protected")))
#endif
#else
#define EXPORT_API __declspec(dllexport)
#ifdef WIN_DRIVER
#include <windef.h>
#include <stdlib.h>
#if defined(__cplusplus)
extern "C" {
#endif
void __cpuid(int a[4], int b);
void __nop();
#ifdef _WIN64
unsigned __int64 __readeflags(void);
void __writeeflags(unsigned __int64);
#else
unsigned __readeflags(void);
void __writeeflags(unsigned);
#endif
#if defined(__cplusplus)
}
#endif // WIN_DRIVER
typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef HANDLE HGLOBAL;
typedef unsigned int UINT;
#define WINAPI __stdcall
#define CRITICAL_SECTION KMUTEX
#ifdef _WIN64
typedef INT_PTR (FAR WINAPI *FARPROC)();
#else
typedef int (FAR WINAPI *FARPROC)();
#endif // _WIN64
#else
#include <windows.h>
#include <iphlpapi.h>
#include <intrin.h>
#include <wtsapi32.h>
#include <winternl.h>
#include <tlhelp32.h>
#endif
#endif // VMP_GNU
#include <cassert>
#ifndef NT_SUCCESS
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
#endif
#ifndef InitializeObjectAttributes
#define InitializeObjectAttributes( p, n, a, r, s ) { \
(p)->Length = sizeof( OBJECT_ATTRIBUTES ); \
(p)->RootDirectory = r; \
(p)->Attributes = a; \
(p)->ObjectName = n; \
(p)->SecurityDescriptor = s; \
(p)->SecurityQualityOfService = NULL; \
}
#endif
#ifndef OBJ_CASE_INSENSITIVE
#define OBJ_CASE_INSENSITIVE 0x00000040L
#endif
#endif //WR_PCH
|