We are blocking UAC (User Account Control).

 


User Account Control defines the level of security when running programs. In practice, this means displaying windows when starting applications that we want to run as Administrator.


If we want the application to run without prompting you to allow the file, we just block it.



The entire configuration is in a branch:
"HKEY_LOCAL_MACHINE - SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", under
name EnableLUA


We'll write a simple function that will turn off the UAC.

  

bool DisableUAC(void)
{
   ::HKEY hkey;
   ::RegOpenKeyExA(HKEY_LOCAL_MACHINE, 
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\",
0,
KEY_ALL_ACCESS,
&hkey); ::DWORD value=0; ::RegSetValueExA(hkey, "EnableLUA", 0, REG_DWORD, (const BYTE*)&value, sizeof(value)); ::RegCloseKey(hkey); return 0; }

 

 

 

-----------------------------------------------------------------

Whole function is built in in header WinAPI.h WinAPI.h


#include "WinAPI.h" //https://www.netbot.sk/sk/14-blog-headers/31-winapi

int _cdecl main (void) 
{
  ::Diall_WinApi::WinApi::GetInstance()->SystemIntegrity(::Diall_WinApi::Privilege::ENABLE); 
::Diall_WinApi::WinApi::GetInstance()->ManageUAC(::Diall_WinApi::UACManage::Set_DISABLE);

return 0; }

 


Eventually, we can write a hidden application that runs the above function from its own thread.