HdlspProcessDumpCommand

VOID __stdcall HdlspProcessDumpCommand(UINT8 Paging){
  INT64 v1; 
  int v2; 
  unsigned __int8 v3; 
  __int64 v4; 
  unsigned int v5; 
  unsigned int v6; 
  unsigned int v7; 
  __int64 v8; 
  __int64 v9; 
  unsigned __int64 v10; 
  UINT8 *v11; 
  bool v12; 
  __int64 v13; 
  __int64 v14; 
  __int64 v15; 
  _TIME_FIELDS TimeFields; 
  _STRING v17; 
  _UNICODE_STRING DestinationString; 
  UINT8 Stop; 

  v1 = 0i64;
  *(_DWORD *)(&v17.MaximumLength + 1) = 0;
  Stop = 0;
  TimeFields = 0i64;
  v2 = *(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64);
  DestinationString = 0i64;
  if( (v2 & 2) != 0 )
  {
    v3 = -1;
  }
  else
  {
    v3 = KeAcquireSpinLockRaiseToDpc(*(&stru_140CF2E80 + 920));
    v1 = 0i64;
  }
  v4 = *(&stru_140CF2E80 + 920);
  v5 = *(unsigned __int16 *)(*(&stru_140CF2E80 + 920) + 98i64);
  if( (_WORD)v5 == 0xFFFF )
  {
    if( v3 == 0xFF )
      return;
    KxReleaseSpinLock(*(&stru_140CF2E80 + 920));
  }
  else
  {
    *(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64) &= ~4u;
    v6 = v5;
    v17.Buffer = *(char **)(v4 + 24);
    v7 = 0;
    *(_DWORD *)&v17.Length = 5242880;
    while( 1 )
    {
      v8 = *(_QWORD *)(v4 + 16) + 56i64 * v6;
      if( v3 != 0xFF )
      {
        KxReleaseSpinLock((UINT64 *)v4);
        __writecr8(v3);
      }
      RtlTimeToTimeFields((INT64 *)(v8 + 8), (WORD *)&TimeFields, v1);
      LODWORD(v15) = TimeFields.Milliseconds;
      LODWORD(v14) = TimeFields.Second;
      LODWORD(v13) = TimeFields.Minute;
      sprintf_s(
        *(INT8 **)(*(&stru_140CF2E80 + 920) + 24i64),
        0x50ui64,
        (INT8 *)"%02d:%02d:%02d.%03d : ",
        (unsigned int)TimeFields.Hour,
        v13,
        v14,
        v15);
      HdlspPutString(*(UINT8 **)(*(&stru_140CF2E80 + 920) + 24i64));
      v9 = *(_QWORD *)(v8 + 48);
      v10 = -1i64;
      do
        ++v10;
      while( *(_WORD *)(v9 + 2 * v10) );
      if( v10 >= 0x4F )
      {
        *(_WORD *)(v9 + 158) = 0;
        v9 = *(_QWORD *)(v8 + 48);
      }
      RtlInitUnicodeString(&DestinationString, (PCWSTR)v9);
      RtlUnicodeStringToAnsiString(&v17, &DestinationString, 0);
      v3 = (*(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64) & 2) != 0 ? -1 : KeAcquireSpinLockRaiseToDpc(*(&stru_140CF2E80 + 920));
      if( (*(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64) & 4) != 0 )
        break;
      HdlspPutString(*(UINT8 **)(*(&stru_140CF2E80 + 920) + 24i64));
      HdlspPutString((UINT8 *)"\r\n");
      v4 = *(&stru_140CF2E80 + 920);
      ++v7;
      if( v6 == *(unsigned __int16 *)(*(&stru_140CF2E80 + 920) + 96i64) )
      {
        if( v3 == 0xFF )
          return;
        goto LABEL_38;
      }
      if( Paging && v7 > 0x14 )
      {
        if( v3 != 0xFF )
        {
          KxReleaseSpinLock(*(&stru_140CF2E80 + 920));
          __writecr8(v3);
        }
        HdlspPutMore(&Stop);
        if( (*(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64) & 2) != 0 )
          v3 = -1;
        else
          v3 = KeAcquireSpinLockRaiseToDpc(*(&stru_140CF2E80 + 920));
        v1 = 0i64;
        if( Stop )
        {
          v11 = (UINT8 *)"\r\n";
          goto LABEL_31;
        }
        v4 = *(&stru_140CF2E80 + 920);
        if( (*(_DWORD *)(*(&stru_140CF2E80 + 920) + 48i64) & 4) != 0 )
        {
          v11 = (UINT8 *)"New log entries have been added while waiting, command aborted.\r\n";
LABEL_31:
          HdlspPutString(v11);
          v12 = v3 == 0xFF;
          goto LABEL_36;
        }
        v7 = 0;
      }
      v6 = (unsigned __int8)(v6 + 1);
    }
    HdlspPutString((UINT8 *)"New log entries have been added during dump, command aborted.\r\n");
    v12 = v3 == 0xFF;
LABEL_36:
    if( v12 )
      return;
    v4 = *(&stru_140CF2E80 + 920);
LABEL_38:
    KxReleaseSpinLock((UINT64 *)v4);
  }
  __writecr8(v3);
}

Referenced by:

HdlspBugCheckProcessing
HdlspDispatch