mirror of
https://github.com/0xjbb/cet-spoofing-detection
synced 2026-06-21 13:41:03 +00:00
41 lines
908 B
C++
41 lines
908 B
C++
#ifndef CETSPOOFINGDETECTION_UTIL_H
|
|
#define CETSPOOFINGDETECTION_UTIL_H
|
|
#include <iostream>
|
|
#include <unordered_set>
|
|
#include <unordered_map>
|
|
#include <format>
|
|
#include <exception>
|
|
#include <print>
|
|
|
|
#include <cstdint>
|
|
#include <Windows.h>
|
|
#include <tlhelp32.h>
|
|
#include <dbghelp.h>
|
|
|
|
namespace util {
|
|
|
|
|
|
struct Thread {
|
|
DWORD processId;
|
|
DWORD threadId;
|
|
};
|
|
|
|
struct Process {
|
|
DWORD processId;
|
|
std::vector<Thread> threads;
|
|
};
|
|
|
|
struct ShadowStackResult {
|
|
bool HasShadowStack;
|
|
uintptr_t ssp;
|
|
std::vector<uint64_t> frames;
|
|
};
|
|
|
|
bool HasCetEnabled(int process_id);
|
|
std::unordered_map<unsigned int, Process> GetCETProcesses();
|
|
ShadowStackResult GetShadowStackFrames(HANDLE thread_handle, HANDLE process);
|
|
std::vector<uintptr_t> GetNormalFrames(HANDLE thread_handle, HANDLE process);
|
|
}
|
|
|
|
|
|
#endif //CETSPOOFINGDETECTION_UTIL_H
|