mirror of
https://github.com/donnaskiez/ac.git
synced 2024-11-21 22:24:08 +01:00
eee
This commit is contained in:
parent
ced805cfba
commit
c0a1bd4f75
6 changed files with 20 additions and 12 deletions
|
@ -62,9 +62,8 @@ NTSTATUS HandlePeriodicCallbackReportQueue(
|
||||||
if ( report == NULL )
|
if ( report == NULL )
|
||||||
{
|
{
|
||||||
DEBUG_LOG( "callback report queue is empty, returning" );
|
DEBUG_LOG( "callback report queue is empty, returning" );
|
||||||
KeReleaseGuardedMutex( &mutex );
|
Irp->IoStatus.Information = sizeof( OPEN_HANDLE_FAILURE_REPORT_HEADER );
|
||||||
Irp->IoStatus.Information = NULL;
|
goto end;
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->IoStatus.Information = sizeof( OPEN_HANDLE_FAILURE_REPORT ) * MAX_HANDLE_REPORTS_PER_IRP +
|
Irp->IoStatus.Information = sizeof( OPEN_HANDLE_FAILURE_REPORT ) * MAX_HANDLE_REPORTS_PER_IRP +
|
||||||
|
|
|
@ -62,7 +62,7 @@ PVOID QueuePop(
|
||||||
if ( temp == NULL )
|
if ( temp == NULL )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
Head->entries -= 1;
|
Head->entries = Head->entries - 1;
|
||||||
|
|
||||||
data = temp->data;
|
data = temp->data;
|
||||||
Head->start = temp->next;
|
Head->start = temp->next;
|
||||||
|
|
|
@ -182,6 +182,9 @@ void kernelmode::Driver::QueryReportQueue()
|
||||||
if ( !header )
|
if ( !header )
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
if ( header->count == 0 )
|
||||||
|
goto end;
|
||||||
|
|
||||||
for ( int i = 0; i < header->count; i++ )
|
for ( int i = 0; i < header->count; i++ )
|
||||||
{
|
{
|
||||||
global::report_structures::OPEN_HANDLE_FAILURE_REPORT* report =
|
global::report_structures::OPEN_HANDLE_FAILURE_REPORT* report =
|
||||||
|
@ -198,6 +201,15 @@ end:
|
||||||
free( buffer );
|
free( buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kernelmode::Driver::RunCallbackReportQueue()
|
||||||
|
{
|
||||||
|
while ( true )
|
||||||
|
{
|
||||||
|
this->QueryReportQueue();
|
||||||
|
std::this_thread::sleep_for( std::chrono::seconds( 10 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void kernelmode::Driver::NotifyDriverOnProcessLaunch()
|
void kernelmode::Driver::NotifyDriverOnProcessLaunch()
|
||||||
{
|
{
|
||||||
BOOLEAN status;
|
BOOLEAN status;
|
||||||
|
|
|
@ -21,13 +21,15 @@ namespace kernelmode
|
||||||
HANDLE driver_handle;
|
HANDLE driver_handle;
|
||||||
LPCWSTR driver_name;
|
LPCWSTR driver_name;
|
||||||
std::shared_ptr<global::Report> report_interface;
|
std::shared_ptr<global::Report> report_interface;
|
||||||
|
|
||||||
|
void QueryReportQueue();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Driver(LPCWSTR DriverName, std::shared_ptr<global::Report> ReportInterface );
|
Driver(LPCWSTR DriverName, std::shared_ptr<global::Report> ReportInterface );
|
||||||
|
|
||||||
void RunNmiCallbacks();
|
void RunNmiCallbacks();
|
||||||
void VerifySystemModules();
|
void VerifySystemModules();
|
||||||
void QueryReportQueue();
|
void RunCallbackReportQueue();
|
||||||
void NotifyDriverOnProcessLaunch();
|
void NotifyDriverOnProcessLaunch();
|
||||||
void CompleteQueuedCallbackReports();
|
void CompleteQueuedCallbackReports();
|
||||||
void EnableProcessLoadNotifyCallbacks();
|
void EnableProcessLoadNotifyCallbacks();
|
||||||
|
|
|
@ -18,5 +18,5 @@ void kernelmode::KManager::VerifySystemModules()
|
||||||
|
|
||||||
void kernelmode::KManager::MonitorCallbackReports()
|
void kernelmode::KManager::MonitorCallbackReports()
|
||||||
{
|
{
|
||||||
this->thread_pool->QueueJob( [ this ]() { this->driver_interface->QueryReportQueue(); } );
|
this->thread_pool->QueueJob( [ this ]() { this->driver_interface->RunCallbackReportQueue(); } );
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,15 +28,10 @@ DWORD WINAPI Init(HINSTANCE hinstDLL)
|
||||||
usermode::UManager umanager( thread_pool, report_interface );
|
usermode::UManager umanager( thread_pool, report_interface );
|
||||||
kernelmode::KManager kmanager( driver_name, thread_pool, report_interface);
|
kernelmode::KManager kmanager( driver_name, thread_pool, report_interface);
|
||||||
|
|
||||||
|
kmanager.MonitorCallbackReports();
|
||||||
//kmanager.RunNmiCallbacks();
|
//kmanager.RunNmiCallbacks();
|
||||||
//kmanager.VerifySystemModules();
|
//kmanager.VerifySystemModules();
|
||||||
|
|
||||||
while ( true )
|
|
||||||
{
|
|
||||||
kmanager.MonitorCallbackReports();
|
|
||||||
std::this_thread::sleep_for( std::chrono::seconds( 10 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
//umanager.ValidateProcessModules();
|
//umanager.ValidateProcessModules();
|
||||||
//umanager.ValidateProcessMemory();
|
//umanager.ValidateProcessMemory();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue