mirror-ac/user/report.h

55 lines
999 B
C
Raw Normal View History

2023-08-18 07:33:13 +02:00
#ifndef REPORT_H
#define REPORT_H
#include <Windows.h>
#include "threadpool.h"
#include "client.h"
2023-08-18 10:39:21 +02:00
#include <TlHelp32.h>
#define REPORT_BUFFER_SIZE 1024
#define REPORT_CODE_MODULE_VERIFICATION 10
2023-08-18 07:33:13 +02:00
namespace global
{
2023-08-18 09:18:00 +02:00
struct TestReport
{
UINT64 value1;
UINT64 value2;
};
2023-08-18 07:33:13 +02:00
class Report
{
std::shared_ptr<global::ThreadPool> thread_pool;
2023-08-18 09:18:00 +02:00
std::shared_ptr<global::Client> client;
2023-08-18 10:39:21 +02:00
std::mutex mutex;
byte buffer[ REPORT_BUFFER_SIZE ];
2023-08-18 07:33:13 +02:00
public:
Report( std::shared_ptr<global::ThreadPool> ThreadPool, LPTSTR PipeName );
2023-08-18 10:39:21 +02:00
template <typename T>
void ReportViolation( T* Report )
{
mutex.lock();
memcpy( this->buffer, Report, sizeof( T ) );
this->client->WriteToPipe( buffer, sizeof(T) );
RtlZeroMemory( this->buffer, REPORT_BUFFER_SIZE );
mutex.unlock();
}
2023-08-18 07:33:13 +02:00
};
2023-08-18 10:39:21 +02:00
namespace report_structures
{
struct MODULE_VERIFICATION_CHECKSUM_FAILURE
{
INT report_code;
UINT64 module_base_address;
UINT64 module_size;
std::string module_name;
};
}
2023-08-18 07:33:13 +02:00
}
#endif