Login Register


[C++] Protect Process filter_list
Author
Message
[C++] Protect Process #1
First you need to include (Visual Studio IDE): 
#include "stdafx.h"
#include <Windows.h>
#include <Aclapi.h>
#include <Sddl.h>

Here is the code:


Code:
BOOL ProtectProcess() { HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()); SECURITY_ATTRIBUTES sa; TCHAR * szSD = TEXT("D:P")  ;  TEXT("(D;OICI;GA;;;BG)");     // Deny access to                                       // built-in guests         TEXT("(D;OICI;GA;;;AN)") ;   // Deny access to                                       // anonymous logon sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle = FALSE; if (!ConvertStringSecurityDescriptorToSecurityDescriptor(szSD, SDDL_REVISION_1, &(sa.lpSecurityDescriptor), NULL)) return FALSE; if (!SetKernelObjectSecurity(hProcess, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor)) return FALSE; return TRUE; }
Just simply call: ProtectProcess() in your main.
NOTE: Admin accounts will be able to bypass this.






Messages In This Thread
[C++] Protect Process - by 3rd_Power - 05-31-2015, 09:00 PM



Users browsing this thread: 1 Guest(s)