WbHashData

NTSTATUS __stdcall WbHashData(PUCHAR pbInput, UINT32 cbInput){
  _QWORD *v2; 
  _DWORD *v3; 
  _DWORD *v5; 
  _QWORD *v6; 
  NTSTATUS Property; 
  UINT64 *v9; 
  UINT64 v10; 
  void *v11; 
  ULONG *pcbResult; 
  ULONG v14; 
  ULONG v15; 
  UCHAR pbOutput[4]; 
  ULONG v17; 
  BCRYPT_HASH_HANDLE phHash; 
  void *P[2]; 
  phHash = 0i64;
  v5 = v3;
  P[0] = 0i64;
  v6 = v2;
  *(_DWORD *)pbOutput = 0;
  v17 = 0;
  if( !*(__int64 *)((char *)&qword_140C53B04 + 4) )
    return -1073741811;
  Property = BCryptCreateHash(
               *(BCRYPT_ALG_HANDLE *)((char *)&qword_140C53B04 + 4),
               &phHash,
               0i64,
               0,
               (PUCHAR)pcbResult,
               v14,
               v15);
  if( Property >= 0 )
  {
    Property = BCryptGetProperty(*(PVOID *)((char *)&qword_140C53B04 + 4), (PWCHAR)L"HashDigestLength", pbOutput, v9);
    if( Property >= 0 )
    {
      Property = WbAlloc(*(unsigned int *)pbOutput);
      if( Property < 0 || (Property = BCryptHashData(phHash, pbInput, cbInput, v10), Property < 0) )
      {
        v11 = P[0];
      }
      else
      {
        v11 = P[0];
        Property = BCryptFinishHash(phHash, (UINT8 *)P[0]);
        if( Property >= 0 )
        {
          if( v6 )
          {
            *v6 = v11;
            v11 = 0i64;
          }
          if( v5 )
            *v5 = *(_DWORD *)pbOutput;
        }
      }
      if( v11 )
        ExFreePoolWithTag(v11, 0x42524157u);
    }
  }
  if( phHash )
    BCryptDestroyHash(phHash);
  return Property;
}

Referenced by:

sub_14065D5DC