MiVerifyLargeSectionLayout

NTSTATUS __stdcall MiVerifyLargeSectionLayout(PVOID BugCheckParameter2){
  __int64 v2; 
  unsigned int v3; 
  _DWORD *v4; 
  unsigned int v5; 
  int v6; 
  __int64 v7; 
  int v8; 
  int v9; 
  int v10; 
  unsigned int v11; 
  int v12; 
  int v13; 
  _BYTE *v14; 
  _BYTE BugCheckParameter3[40]; 

  memset(BugCheckParameter3, 0, sizeof(BugCheckParameter3));
  LODWORD(v2) = RtlImageNtHeader((UINT64)BugCheckParameter2);
  v3 = 0;
  v4 = BugCheckParameter3;
  v5 = 0x40000000;
  v6 = 0;
  v7 = v2;
  v8 = *(unsigned __int16 *)(v2 + 6);
  *(_QWORD *)&BugCheckParameter3[8] = 0i64;
  *(_OWORD *)&BugCheckParameter3[20] = 0i64;
  *(_DWORD *)&BugCheckParameter3[36] = 0x40000000;
  v9 = v8 + 1;
  *(_DWORD *)&BugCheckParameter3[8] = *(_DWORD *)(v2 + 84);
  *(_DWORD *)&BugCheckParameter3[16] = *(_DWORD *)&BugCheckParameter3[8];
  do
  {
    v10 = v4[3];
    if( v3 != v10 )
      KeBugCheckEx(0x1Au, (PVOID)0x3030209, BugCheckParameter2, (PVOID)(unsigned int)v4[3], (PVOID)v3);
    v11 = v4[4];
    if( v11 < v4[2] )
      v11 = v4[2];
    if( !v11 )
      KeBugCheckEx(0x1Au, (PVOID)0x303020A, BugCheckParameter2, v4, 0i64);
    v3 = v10 + ((v11 + 4095) & 0xFFFFF000);
    v12 = v10 & 0x1FFFFF;
    if( (v4[9] & 0xE0000000) != v5 )
    {
      if( v12 )
        KeBugCheckEx(0x1Au, (PVOID)0x303020B, BugCheckParameter2, v4, (PVOID)(unsigned int)v4[3]);
      v5 = v4[9] & 0xE0000000;
    }
    v13 = v12 != 0 ? v6 : 0;
    v6 = v13;
    if( (v4[9] & 0x2000000) != 0 )
    {
      v6 = 1;
    }
    else if( v13 )
    {
      KeBugCheckEx(0x1Au, (PVOID)0x303020C, BugCheckParameter2, v4, 0i64);
    }
    v14 = BugCheckParameter3;
    if( v4 == (_DWORD *)BugCheckParameter3 )
    {
      v14 = (_BYTE *)*(unsigned __int16 *)(v7 + 20);
      v4 = &v14[v7 + 24];
    }
    else
    {
      v4 += 10;
    }
    --v9;
  }
  while( v9 );
  return(int)v14;
}

Referenced by:

MiCheckLargePageOk