Skip to content

Commit ef3e4ca

Browse files
committed
added files
1 parent 100ea07 commit ef3e4ca

17 files changed

+16760
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.idea
2+
/cmake-build

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.28)
2+
3+
project(cv-sdk)
4+
5+
add_library(cv-sdk INTERFACE)
6+
target_include_directories(cv-sdk INTERFACE include)
7+
target_link_directories(cv-sdk INTERFACE lib)

CMakePresets.json

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"version": 3,
3+
"configurePresets": [
4+
{
5+
"name": "windows-base",
6+
"hidden": true,
7+
"generator": "Ninja",
8+
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
9+
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
10+
"cacheVariables": {
11+
"CMAKE_C_COMPILER": "cl.exe",
12+
"CMAKE_CXX_COMPILER": "cl.exe"
13+
},
14+
"condition": {
15+
"type": "equals",
16+
"lhs": "${hostSystemName}",
17+
"rhs": "Windows"
18+
}
19+
},
20+
{
21+
"name": "x64-debug",
22+
"displayName": "x64 Debug",
23+
"inherits": "windows-base",
24+
"architecture": {
25+
"value": "x64",
26+
"strategy": "external"
27+
},
28+
"cacheVariables": {
29+
"CMAKE_BUILD_TYPE": "Debug"
30+
}
31+
},
32+
{
33+
"name": "x64-release",
34+
"displayName": "x64 Release",
35+
"inherits": "x64-debug",
36+
"cacheVariables": {
37+
"CMAKE_BUILD_TYPE": "Release"
38+
}
39+
},
40+
{
41+
"name": "x86-debug",
42+
"displayName": "x86 Debug",
43+
"inherits": "windows-base",
44+
"architecture": {
45+
"value": "x86",
46+
"strategy": "external"
47+
},
48+
"cacheVariables": {
49+
"CMAKE_BUILD_TYPE": "Debug"
50+
}
51+
},
52+
{
53+
"name": "x86-release",
54+
"displayName": "x86 Release",
55+
"inherits": "x86-debug",
56+
"cacheVariables": {
57+
"CMAKE_BUILD_TYPE": "Release"
58+
}
59+
},
60+
{
61+
"name": "linux-base",
62+
"hidden": true,
63+
"generator": "Ninja",
64+
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
65+
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
66+
"cacheVariables": {
67+
"CMAKE_C_COMPILER": "gcc",
68+
"CMAKE_CXX_COMPILER": "g++"
69+
},
70+
"condition": {
71+
"type": "equals",
72+
"lhs": "${hostSystemName}",
73+
"rhs": "Linux"
74+
}
75+
},
76+
{
77+
"name": "linux-debug",
78+
"displayName": "Linux Debug",
79+
"inherits": "linux-base",
80+
"cacheVariables": {
81+
"CMAKE_BUILD_TYPE": "Debug"
82+
}
83+
},
84+
{
85+
"name": "linux-release",
86+
"displayName": "Linux Release",
87+
"inherits": "linux-debug",
88+
"cacheVariables": {
89+
"CMAKE_BUILD_TYPE": "Release"
90+
}
91+
}
92+
]
93+
}
+250
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
/******************************************************************************
2+
Header: VirtualizerSDK.h
3+
Description: SDK header definition for the C/C++ language
4+
5+
Author/s: Oreans Technologies
6+
(c) 2023 Oreans Technologies
7+
*****************************************************************************/
8+
9+
#pragma once
10+
11+
// ***********************************************
12+
// Cross Compiler definitions
13+
// ***********************************************
14+
15+
#if defined(__GNUC__)
16+
17+
#define DLL_IMPORT extern
18+
#define STDCALL_CONVENTION
19+
20+
#else
21+
22+
#define DLL_IMPORT __declspec(dllimport)
23+
#define STDCALL_CONVENTION __stdcall
24+
25+
#endif
26+
27+
// ***********************************************
28+
// Specify platform
29+
// ***********************************************
30+
31+
#if defined(__GNUC__)
32+
33+
#if defined(__x86_64__)
34+
#define PLATFORM_X64
35+
#elif defined(__aarch64__)
36+
#define PLATFORM_ARM64
37+
#else
38+
#define PLATFORM_X32
39+
#endif
40+
41+
#else
42+
43+
#if defined(_M_X64)
44+
#define PLATFORM_X64
45+
#elif defined(_M_ARM64)
46+
#define PLATFORM_ARM64
47+
#else
48+
#define PLATFORM_X32
49+
#endif
50+
51+
#endif
52+
53+
// ***********************************************
54+
// Defines
55+
// ***********************************************
56+
57+
#if defined(__GNUC__) || defined (__ICL)
58+
59+
#define CV_X32_INSERT_VIA_INLINE
60+
#define CV_X64_INSERT_VIA_INLINE
61+
#define CV_ARM64_INSERT_VIA_INLINE
62+
63+
#else
64+
65+
#define CV_X32_INSERT_VIA_INLINE
66+
//#define CV_X64_INSERT_VIA_INLINE // uncomment for inline assembly
67+
//#define CV_ARM64_INSERT_VIA_INLINE // uncomment for inline assembly
68+
69+
#endif
70+
71+
// ***********************************************
72+
// Include files
73+
// ***********************************************
74+
75+
#include "VirtualizerSDK_CustomVMs.h"
76+
77+
// ***********************************************
78+
// link with correct platform library
79+
// ***********************************************
80+
81+
#ifndef CV_X64_INSERT_VIA_INLINE
82+
#ifdef PLATFORM_X64
83+
#ifdef _NTDDK_
84+
#pragma comment(lib, "VirtualizerDDK.lib")
85+
#else
86+
#pragma comment(lib, "VirtualizerSDK64.lib")
87+
#endif
88+
#endif
89+
#endif
90+
91+
#ifndef CV_X32_INSERT_VIA_INLINE
92+
#ifdef PLATFORM_X32
93+
#ifdef _NTDDK_
94+
#pragma comment(lib, "VirtualizerDDK.lib")
95+
#else
96+
#pragma comment(lib, "VirtualizerSDK32.lib")
97+
#endif
98+
#endif
99+
#endif
100+
101+
#ifndef CV_ARM64_INSERT_VIA_INLINE
102+
#ifdef PLATFORM_ARM64
103+
#ifdef _NTDDK_
104+
#pragma comment(lib, "VirtualizerArm64DDK.lib")
105+
#else
106+
#pragma comment(lib, "VirtualizerArm64SDK.lib")
107+
#endif
108+
#endif
109+
#endif
110+
111+
// ***********************************************
112+
// In latest CV versions, we have removed the
113+
// VirtualizerXStart and VirtualizerMutate macros
114+
// ***********************************************
115+
116+
#define Virtualizer1Start VirtualizerStart
117+
#define Virtualizer2Start VirtualizerStart
118+
#define Virtualizer3Start VirtualizerStart
119+
#define Virtualizer4Start VirtualizerStart
120+
#define Virtualizer5Start VirtualizerStart
121+
#define Virtualizer1End VirtualizerEnd
122+
#define Virtualizer2End VirtualizerEnd
123+
#define Virtualizer3End VirtualizerEnd
124+
#define Virtualizer4End VirtualizerEnd
125+
#define Virtualizer5End VirtualizerEnd
126+
#define VirtualizerMutate1Start VirtualizerStart
127+
#define VirtualizerMutate2Start VirtualizerStart
128+
#define VirtualizerMutate3Start VirtualizerStart
129+
130+
#define VIRTUALIZER1_START VIRTUALIZER_START
131+
#define VIRTUALIZER2_START VIRTUALIZER_START
132+
#define VIRTUALIZER3_START VIRTUALIZER_START
133+
#define VIRTUALIZER4_START VIRTUALIZER_START
134+
#define VIRTUALIZER5_START VIRTUALIZER_START
135+
#define VIRTUALIZER1_END VIRTUALIZER_END
136+
#define VIRTUALIZER2_END VIRTUALIZER_END
137+
#define VIRTUALIZER3_END VIRTUALIZER_END
138+
#define VIRTUALIZER4_END VIRTUALIZER_END
139+
#define VIRTUALIZER5_END VIRTUALIZER_END
140+
#define VIRTUALIZER_MUTATE1_START VIRTUALIZER_START
141+
#define VIRTUALIZER_MUTATE2_START VIRTUALIZER_START
142+
#define VIRTUALIZER_MUTATE3_START VIRTUALIZER_START
143+
144+
// ***********************************************
145+
// Definition of VirtualizerStart macro to keep
146+
// compatibility with previous CV versions
147+
// ***********************************************
148+
149+
#ifdef __cplusplus
150+
extern "C" {
151+
#endif
152+
153+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerStart(void);
154+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerEnd(void);
155+
156+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerStrEncryptStart(void);
157+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerStrEncryptEnd(void);
158+
159+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerStrEncryptWStart(void);
160+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerStrEncryptWEnd(void);
161+
162+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerUnprotectedStart(void);
163+
DLL_IMPORT void STDCALL_CONVENTION VirtualizerUnprotectedEnd(void);
164+
165+
#ifdef __cplusplus
166+
}
167+
#endif
168+
169+
#if defined(PLATFORM_X64) && !defined(CV_X64_INSERT_VIA_INLINE)
170+
171+
#define VIRTUALIZER_START VirtualizerStart();
172+
#define VIRTUALIZER_END VirtualizerEnd();
173+
174+
#define VIRTUALIZER_STR_ENCRYPT_START VirtualizerStrEncryptStart();
175+
#define VIRTUALIZER_STR_ENCRYPT_END VirtualizerStrEncryptEnd();
176+
177+
#define VIRTUALIZER_STR_ENCRYPTW_START VirtualizerStrEncryptWStart();
178+
#define VIRTUALIZER_STR_ENCRYPTW_END VirtualizerStrEncryptWEnd();
179+
180+
#define VIRTUALIZER_UNPROTECTED_START VirtualizerUnprotectedStart();
181+
#define VIRTUALIZER_UNPROTECTED_END VirtualizerUnprotectedEnd();
182+
183+
#define CV_CUSTOM_VMS_DEFINED
184+
185+
#endif
186+
187+
#if defined(PLATFORM_ARM64) && !defined(CV_ARM64_INSERT_VIA_INLINE)
188+
189+
#define VIRTUALIZER_START VirtualizerStart();
190+
#define VIRTUALIZER_END VirtualizerEnd();
191+
192+
#define VIRTUALIZER_STR_ENCRYPT_START VirtualizerStrEncryptStart();
193+
#define VIRTUALIZER_STR_ENCRYPT_END VirtualizerStrEncryptEnd();
194+
195+
#define VIRTUALIZER_STR_ENCRYPTW_START VirtualizerStrEncryptWStart();
196+
#define VIRTUALIZER_STR_ENCRYPTW_END VirtualizerStrEncryptWEnd();
197+
198+
#define VIRTUALIZER_UNPROTECTED_START VirtualizerUnprotectedStart();
199+
#define VIRTUALIZER_UNPROTECTED_END VirtualizerUnprotectedEnd();
200+
201+
#define CV_CUSTOM_VMS_DEFINED
202+
203+
#endif
204+
205+
206+
#if defined(PLATFORM_X32) && !defined(CV_X32_INSERT_VIA_INLINE)
207+
208+
#define VIRTUALIZER_START VirtualizerStart();
209+
#define VIRTUALIZER_END VirtualizerEnd();
210+
211+
#define VIRTUALIZER_STR_ENCRYPT_START VirtualizerStrEncryptStart();
212+
#define VIRTUALIZER_STR_ENCRYPT_END VirtualizerStrEncryptEnd();
213+
214+
#define VIRTUALIZER_STR_ENCRYPTW_START VirtualizerStrEncryptWStart();
215+
#define VIRTUALIZER_STR_ENCRYPTW_END VirtualizerStrEncryptWEnd();
216+
217+
#define VIRTUALIZER_UNPROTECTED_START VirtualizerUnprotectedStart();
218+
#define VIRTUALIZER_UNPROTECTED_END VirtualizerUnprotectedEnd();
219+
220+
#define CV_CUSTOM_VMS_DEFINED
221+
222+
#endif
223+
224+
// ***********************************************
225+
// x32/x64 definition as inline assembly
226+
// ***********************************************
227+
228+
#ifndef CV_CUSTOM_VMS_DEFINED
229+
230+
#ifdef __BORLANDC__
231+
#include "VirtualizerSDK_BorlandC_inline.h"
232+
#endif
233+
234+
#ifdef __GNUC__
235+
#include "VirtualizerSDK_GNU_inline.h"
236+
#endif
237+
238+
#ifdef __ICL
239+
#include "VirtualizerSDK_ICL_inline.h"
240+
#endif
241+
242+
#ifdef __LCC__
243+
#include "VirtualizerSDK_LCC_inline.h"
244+
#endif
245+
246+
#if defined(_MSC_VER) || defined(__INTEL_COMPILER)
247+
#include "VirtualizerSDK_VC_inline.h"
248+
#endif
249+
250+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/******************************************************************************
2+
* Header: VirtualizerSDK_BorlandC_inline.h
3+
* Description: Borland C++ inline assembly macros definitions
4+
*
5+
* Author/s: Oreans Technologies
6+
* (c) 2013 Oreans Technologies
7+
*
8+
******************************************************************************/
9+
10+
/***********************************************
11+
* Definition as inline assembly
12+
***********************************************/
13+
14+
#define VIRTUALIZER_START __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x0C, 0x00, 0x00, 0x00, \
15+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
16+
17+
#define VIRTUALIZER_END __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x0D, 0x00, 0x00, 0x00, \
18+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
19+
20+
#define VIRTUALIZER_STR_ENCRYPT_START __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x12, 0x00, 0x00, 0x00, \
21+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
22+
#define VIRTUALIZER_STR_ENCRYPT_END __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x13, 0x00, 0x00, 0x00, \
23+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
24+
#define VIRTUALIZER_STR_ENCRYPTW_START __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x22, 0x00, 0x00, 0x00, \
25+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
26+
#define VIRTUALIZER_STR_ENCRYPTW_END __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x23, 0x00, 0x00, 0x00, \
27+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
28+
29+
#define VIRTUALIZER_UNPROTECTED_START __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, \
30+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
31+
32+
#define VIRTUALIZER_UNPROTECTED_END __emit__ (0xEB, 0x10, 0x43, 0x56, 0x20, 0x20, 0x21, 0x00, 0x00, 0x00, \
33+
0x00, 0x00, 0x00, 0x00, 0x43, 0x56, 0x20, 0x20);
34+

0 commit comments

Comments
 (0)