SepSetSystemPaths

INT64 __fastcall SepSetSystemPaths(){
  INT64 v0; 
  INT64 v1; 
  INT64 v2; 
  unsigned int v3; 
  UINT64 v4; 
  char *PoolWithTag; 
  signed __int64 v6; 
  const WCHAR *v7; 
  WCHAR v8; 
  WCHAR *v9; 
  WCHAR v10; 
  void *v11; 
  v2 = v1;
  v3 = 0;
  SepLoadNgenLocations(v1, v0);
  v4 = *((unsigned __int16 *)PsGetCurrentServerSiloGlobals() + 536) + 30i64;
  PoolWithTag = (char *)ExAllocatePoolWithTag(PagedPool, 2 * v4 + 48, 0x63734943ui64);
  v6 = (signed __int64)PoolWithTag;
  if( PoolWithTag )
  {
    v7 = (const WCHAR *)(PoolWithTag + 48);
    RtlStringCbPrintfW((WCHAR *)PoolWithTag + 24, v4, (WCHAR *)L"\\??\\%ws\\System32\\");
    RtlInitUnicodeString((PUNICODE_STRING)v6, v7, v8);
    v9 = (WCHAR *)&v7[v4 >> 1];
    RtlStringCbPrintfW(v9, v4, (WCHAR *)L"\\??\\%ws\\SysWOW64\\");
    RtlInitUnicodeString((PUNICODE_STRING)(v6 + 16), v9, v10);
    *(_OWORD *)(v6 + 32) = *(_OWORD *)v6;
    *(_WORD *)(v6 + 32) = 12;
    v11 = (void *)(v6 & -(__int64)(_InterlockedCompareExchange64((volatile signed __int64 *)(v2 + 32), v6, 0i64) != 0));
    if( v11 )
      ExFreePoolWithTag(v11, 0x63734943u);
  }
  else
  {
    return(unsigned int)-1073741801;
  }
  return v3;
}

Referenced by:

SepIsMinTCB