MiProcessKernelCfgImageLoadConfig
NTSTATUS __fastcall MiProcessKernelCfgImageLoadConfig(_KLDR_DATA_TABLE_ENTRY *DataTableEntry, INT64 a2){
VOID *v5;
INT64 v6;
void(__fastcall **v7)(uintptr_t);
int v8;
_QWORD *v9;
int v10;
UINT64 Size;
LODWORD(Size) = 0;
if( (MiFlags & 0x80000) == 0 )
return 0;
v5 = RtlImageDirectoryEntryToData(DataTableEntry->DllBase, 1u, 0xAu, &Size);
v6 = (INT64)v5;
if( !v5 )
return 0;
if( *(_DWORD *)v5 < 0x78u || (v7 = (void(__fastcall **)(uintptr_t))*((_QWORD *)v5 + 14)) == 0i64 )
{
LABEL_14:
if( *(_DWORD *)v6 >= 0x80u )
{
v9 = *(_QWORD **)(v6 + 120);
if( v9 )
{
if( a2 )
{
MiSetImageProtection(DataTableEntry, *(VOID **)(v6 + 120), 8ui64, 4ui64);
if( !v10 )
{
MiLogStrongCodeDriverLoadFailure((INT8 *)"CfgUnwritableLoadConfig", DataTableEntry);
dword_140C4C958 = 104;
return -1073741701;
}
}
*v9 = &guard_dispatch_icall;
if( a2 && *(_QWORD *)(a2 + 16) )
MiSetImageProtection(DataTableEntry, v9, 8ui64, 0x100ui64);
}
}
if( *(_DWORD *)v6 >= 0xC0u && (*(_DWORD *)(v6 + 144) & 0x10000) != 0 )
{
if( *(_QWORD *)(v6 + 184) )
MiCheckForDiscardableLongJumpTable(DataTableEntry, v6);
}
return 0;
}
if( !a2 || (MiSetImageProtection(DataTableEntry, *((VOID **)v5 + 14), 8ui64, 4ui64), v8) )
{
*v7 = guard_check_icall;
if( a2 && *(_QWORD *)(a2 + 16) )
MiSetImageProtection(DataTableEntry, v7, 8ui64, 0x100ui64);
goto LABEL_14;
}
MiLogStrongCodeDriverLoadFailure((INT8 *)"CfgUnwritableLoadConfig", DataTableEntry);
dword_140C4C958 = 103;
return -1073741701;
}Referenced by:
MiInitializeKernelCfg
MiProcessLoadConfigForDriver