This commit is contained in:
lhodges1 2023-08-19 21:00:45 +10:00
parent 4684dd2158
commit f3124359c8

View file

@ -9,9 +9,7 @@ NTSTATUS ValidateDriverIOCTLDispatchRegion(
_In_ PBOOLEAN Flag _In_ PBOOLEAN Flag
) )
{ {
NTSTATUS status;
UINT64 dispatch_function; UINT64 dispatch_function;
UINT64 base = ( UINT64 )Driver->DriverStart; UINT64 base = ( UINT64 )Driver->DriverStart;
UINT64 end = base + Driver->DriverSize; UINT64 end = base + Driver->DriverSize;
@ -25,18 +23,20 @@ NTSTATUS ValidateDriverIOCTLDispatchRegion(
dispatch_function = Driver->MajorFunction[ IRP_MJ_DEVICE_CONTROL ]; dispatch_function = Driver->MajorFunction[ IRP_MJ_DEVICE_CONTROL ];
if ( dispatch_function == NULL ) if ( dispatch_function == NULL )
return; return STATUS_SUCCESS;
DEBUG_LOG( "Current function: %llx", dispatch_function ); DEBUG_LOG( "Current function: %llx", dispatch_function );
if ( dispatch_function >= base && dispatch_function <= end ) if ( dispatch_function >= base && dispatch_function <= end )
{ {
DEBUG_LOG( "THIS ADDRESS IS INSIDE ITS REGIUON :)" ); DEBUG_LOG( "THIS ADDRESS IS INSIDE ITS REGIUON :)" );
return; return STATUS_SUCCESS;
} }
DEBUG_ERROR( "Driver with invalid IOCTL dispatch routine found" ); DEBUG_ERROR( "Driver with invalid IOCTL dispatch routine found" );
*Flag = FALSE; *Flag = FALSE;
return STATUS_SUCCESS;
} }
VOID InitDriverList( VOID InitDriverList(