HvDuplicateCell

UINT64 __stdcall HvDuplicateCell(PVOID Hive, UINT64 Cell, _HSTORAGE_TYPE Type, UINT8 CopyData){
  __int64(__fastcall *v6)(PVOID, UINT64, int *); 
  __int64 v8; 
  const VOID *v9; 
  size_t v10; 
  unsigned int v11; 
  VOID *v12; 
  unsigned int v13; 
  _HV_GET_CELL_CONTEXT CellAddressContext; 
  VOID *CellAddress; 
  int v17; 
  int v18; 

  v17 = -1;
  CellAddressContext.Cell = -1;
  CellAddress = 0i64;
  v18 = 0;
  v6 = (__int64(__fastcall *)(PVOID, UINT64, int *))*((_QWORD *)Hive + 1);
  *(_DWORD *)&CellAddressContext.BinContext._bf_0 = 0;
  v8 = v6(Hive, Cell, &v17);
  v9 = (const VOID *)v8;
  if( !v8 )
    return 0xFFFFFFFFi64;
  v10 = -4 - *(_DWORD *)(v8 - 4);
  v11 = HvAllocateCell((ULONG_PTR)Hive, v10, Type, &CellAddress, &CellAddressContext);
  v12 = CellAddress;
  v13 = v11;
  if( v11 != -1 )
  {
    if( CopyData == 1 )
      memmove(CellAddress, v9, v10);
    else
      memset(CellAddress, 0i64, v10);
  }
  (*((void(__fastcall **)(PVOID, int *))Hive + 2))(Hive, &v17);
  if( v12 )
    (*((void(__fastcall **)(PVOID, _HV_GET_CELL_CONTEXT *))Hive + 2))(Hive, &CellAddressContext);
  return v13;
}

Referenced by:

CmpCloneKCBValueListForTrans
CmpDuplicateIndex