added flags for dbg

pull/1/head
zhwu2697 3 years ago
parent b6e8f369f9
commit efe72a25f0

@ -2,24 +2,18 @@
namespace DCONTROL namespace DCONTROL
{ {
// forget about this for now // disables window defender
//
bool enable_control()
{
return true;
}
// write a working poc
// //
bool disable_control() bool disable_control()
{ {
// add DisableRealtimeMonitoring if it does not exist
// set to 1 if it already exists
return true; return true;
} }
// Checks whether Real-Time Protection is activated on windows // Checks whether Real-Time Protection is activated on windows
// //
bool check_defender() bool check_defender(uint32_t flags)
{ {
LSTATUS status; LSTATUS status;
HKEY hkey; HKEY hkey;
@ -43,7 +37,9 @@ namespace DCONTROL
// //
if (status) if (status)
{ {
std::cout << "Error opening Real-Time Protection key" << std::endl; if (flags & DBG_MSG)
std::cout << "Error opening Real-Time Protection key" << std::endl;
return true; return true;
} }
@ -57,7 +53,9 @@ namespace DCONTROL
if (status) if (status)
{ {
std::cout << "Failed to read DisableRealtimeMonitoring" << std::endl; if (flags & DBG_MSG)
std::cout << "Failed to read DisableRealtimeMonitoring" << std::endl;
return true; return true;
} }

@ -3,7 +3,9 @@
#include <Windows.h> #include <Windows.h>
#include <iostream> #include <iostream>
#define DBG_MSG (1 << 0)
namespace DCONTROL namespace DCONTROL
{ {
bool check_defender(); bool check_defender(uint32_t flags = 0);
} }

@ -9,12 +9,9 @@
// //
int main() int main()
{ {
if (DCONTROL::check_defender()) { printf(DCONTROL::check_defender() ?
printf("Windows defender is ACTIVE\n"); "Windows defender is ACTIVE\n" :
} "Windows defender is OFF\n");
else {
printf("Windows defender is OFF\n");
}
system("pause"); system("pause");

Loading…
Cancel
Save