#include #include #include #include typedef struct __attribute__((packed)) { ULONG ExtendedInfoClass; ULONG ExtendedInfoClassResponse; } MITIGATION_POLICY, *PMITIGATION_POLICY; INT WINAPI WinMain( HINSTANCE a, HINSTANCE b, LPSTR c, INT d ) { MITIGATION_POLICY Policy = { 0 }; NTSTATUS Status = STATUS_SUCCESS; Policy.ExtendedInfoClass = ProcessControlFlowGuardPolicy; Policy.ExtendedInfoClassResponse = 0; Status = NtQueryInformationProcess( GetCurrentProcess( ), ProcessCookie | ProcessUserModeIOPL, &Policy, sizeof( Policy ), NULL ); if ( NT_SUCCESS( Status ) ) { if ( Policy.ExtendedInfoClassResponse ) { printf("[ ] Control Flow Guard Policy Enabled\n"); } else { printf("[ ] Control Flow Guard Policy Disabled\n"); }; }; return 0; };