SecureDump_Init

NTSTATUS __stdcall SecureDump_Init(){
  int v0; 
  int v1; 

  v1 = 0;
  if( SecureDmpEncryptionContext == 1 )
  {
    if( !DWORD1(xmmword_140C4C598) )
    {
      byte_140C4C594 = 0;
LABEL_4:
      SecureDmpEncryptionContext = 2;
      goto LABEL_5;
    }
    byte_140C4C594 = 1;
    v1 = SecureDump_SymmetricEncryptionSetup();
    if( v1 >= 0 )
    {
      v1 = SecureDump_EncryptSymmetricKeyWithPublicKey();
      if( v1 >= 0 )
      {
        v0 = (HIDWORD(dwFlags) + pcbResult + 8279) & 0xFFFFF000;
        dword_140C4C5E0 = v0;
        goto LABEL_4;
      }
    }
  }
LABEL_5:
  switch( SecureDmpEncryptionContext )
  {
    case 3:
      return -1073741823;
    case 2:
      return 0;
    case 0:
      return -1073741808;
  }
  if( v1 < 0 )
  {
    byte_140C4C594 = 0;
    if( *(_QWORD *)&hAlgorithm )
    {
      BCryptCloseAlgorithmProvider(hAlgorithm, v0);
      *(_QWORD *)&hAlgorithm = 0i64;
    }
    if( *(_QWORD *)&hObject )
    {
      BCryptDestroyKey(hObject);
      *(_QWORD *)&hObject = 0i64;
    }
    if( qword_140C4C5B8 )
    {
      ExFreePoolWithTag(qword_140C4C5B8, 0);
      qword_140C4C5B8 = 0i64;
    }
    if( *(&dwFlags + 1) )
    {
      ExFreePoolWithTag((PVOID)*(&dwFlags + 1), 0);
      *(&dwFlags + 1) = 0i64;
    }
    if( *((_QWORD *)&xmmword_140C4C598 + 1) )
    {
      ExFreePoolWithTag(*((PVOID *)&xmmword_140C4C598 + 1), 0);
      *((_QWORD *)&xmmword_140C4C598 + 1) = 0i64;
    }
    SecureDmpEncryptionContext = 3;
  }
  return v1;
}

Referenced by:

IopInitCrashDumpDuringSysInit