BiConvertNtFilePathToBootEnvironment

__int64 __fastcall BiConvertNtFilePathToBootEnvironment(__int64 a1, __int64 a2, _WORD *a3, unsigned int a4, _QWORD *a5){
  int v6; 
  __int64 v7; 
  unsigned int v8; 
  unsigned int v9; 
  UINT8 *PoolWithTag; 
  UINT8 *v11; 
  void *Src; 
  Src = 0i64;
  v6 = BiConvertNtDeviceToBootEnvironment((INT64 *)a1, a2, a4, &Src);
  if( v6 >= 0 )
  {
    v7 = -1i64;
    do
      ++v7;
    while( a3[v7] );
    v8 = 2 * v7 + 2;
    v9 = v8 + *((_DWORD *)Src + 2) + 12;
    PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(PagedPool, v9, 0x4B444342ui64);
    v11 = PoolWithTag;
    if( PoolWithTag )
    {
      *(_DWORD *)PoolWithTag = 1;
      *((_DWORD *)PoolWithTag + 2) = 5;
      *((_DWORD *)PoolWithTag + 1) = v9;
      memmove(PoolWithTag + 12, (UINT8 *)Src, *((unsigned int *)Src + 2));
      memmove(&v11[*((unsigned int *)Src + 2) + 12], (UINT8 *)a3, v8);
      *a5 = v11;
      v6 = 0;
    }
    else
    {
      v6 = -1073741670;
    }
  }
  if( Src )
    ExFreePoolWithTag(Src, 0x4B444342u);
  return(unsigned int)v6;
}

Referenced by:

BiConvertNtDeviceToBootEnvironment