IopLoadCrashdumpDriver

INT64 __fastcall IopLoadCrashdumpDriver(){
  WCHAR v0; 
  INT64 result; 
  IMAGE_NT_HEADERS *v2; 
  __int64(__fastcall *v3)(UNICODE_STRING **, int *); 
  __int64 v4; 
  struct _UNICODE_STRING DestinationString; 
  UNICODE_STRING *v6; 
  __int64 v7; 
  INT64(__fastcall *v8)(UNICODE_STRING *, UNICODE_STRING *, UNICODE_STRING *, INT64, INT64, INT64); 
  INT64(__fastcall *v9)(VOID *); 
  VOID(__fastcall *v10)(UINT64, VOID *, UINT64, UINT64 *, UINT64 *); 
  __int64 v11; 
  int v12; 
  int v13; 
  UNICODE_STRING *v14; 
  PVOID BaseAddress; 
  INT64 a5; 
  a5 = 0i64;
  v7 = 0i64;
  v13 = 0;
  BaseAddress = 0i64;
  DestinationString = 0i64;
  if( CrashdmpImageEntry )
    return 0i64;
  RtlInitUnicodeString(&DestinationString, L"\\SystemRoot\\System32\\Drivers\\crashdmp.sys", v0);
  result = MmLoadSystemImageEx(&DestinationString, 0i64, 0i64, 0x22ui64, (INT64)&a5, (INT64)&BaseAddress);
  if( (int)result >= 0 )
  {
    v2 = RtlImageNtHeader(BaseAddress);
    if( !v2 )
      return 3221225473i64;
    v3 = (__int64(__fastcall *)(UNICODE_STRING **, int *))((char *)BaseAddress + v2->OptionalHeader.AddressOfEntryPoint);
    v6 = &IoArcBootDeviceName;
    v14 = &PoHiberFileRoot;
    IopGetPhysicalMemoryBlock();
    v7 = v4;
    if( !v4 )
      return 3221225626i64;
    v8 = IopLoadCrashdmpImage;
    v9 = MmUnloadSystemImage;
    v11 = IopReportBugCheckProgress;
    v10 = HvlGetEncryptedData;
    v12 = VslVsmEnabled ? ((HvlpFlags & 2) != 0) + 1 : 0;
    CrashdmpCallTable = 1;
    dword_140C509A4 = 11;
    result = v3(&v6, &CrashdmpCallTable);
    if( (int)result >= 0 )
    {
      CrashdmpImageEntry = a5;
      CrashdmpImageBase = BaseAddress;
      return 0i64;
    }
  }
  return result;
}

Referenced by:

IoGetDumpStack
IopInitializeCrashDump