void __fastcall ScStoragePathFromUrl(const struct IEcb *a1, const unsigned __int16 *a2, unsigned __int16 *a3, unsigned int *a4, struct CVRoot **a5) { IEcbBase *v5; // esi@1 size_t v6; // ebx@3 int v7; // eax@3 size_t v8; // eax@4 wchar_t v9; // ax@6 DWORD v10; // ecx@19 wchar_t *v11; // esi@19 wchar_t *v12; // edi@19 unsigned int v13; // eax@22 int v14; // eax@23 CRefCountedObject *v15; // eax@27 __int32 v16; // esi@29 const unsigned __int16 *v17; // edi@30 DWORD v18; // eax@33 bool v19; // cf@33 CRefCountedObject *v20; // ecx@35 unsigned __int16 *v21; // edi@43 int v22; // eax@43 char v23; // dl@43 unsigned int v24; // ecx@43 char *v25; // edi@43 char *v26; // esi@43 DWORD v27; // edx@43 int v28; // ebx@43 wchar_t *v29; // esi@43 unsigned __int16 *v30; // edx@43 unsigned __int16 *i; // eax@43 wchar_t *Str1; // [sp+8h] [bp-45Ch]@4 struct CVRoot **v33; // [sp+Ch] [bp-458h]@1 unsigned int *v34; // [sp+10h] [bp-454h]@1 unsigned __int16 *v35; // [sp+14h] [bp-450h]@1 int v36; // [sp+18h] [bp-44Ch]@3 struct IEcb *v37; // [sp+1Ch] [bp-448h]@1 wchar_t *Str; // [sp+20h] [bp-444h]@1 CRefCountedObject *v39; // [sp+24h] [bp-440h]@15 struct _HSE_UNICODE_URL_MAPEX_INFO v40; // [sp+28h] [bp-43Ch]@3 char v41; // [sp+23Ch] [bp-228h]@15 wchar_t *v42; // [sp+344h] [bp-120h]@23 char v43; // [sp+348h] [bp-11Ch]@15 wchar_t *Source; // [sp+450h] [bp-14h]@19 int v45; // [sp+460h] [bp-4h]@15 v35 = a3; v5 = a1; Str = (wchar_t *)a2; v37 = a1; v34 = a4; v33 = a5; if ( ScStripAndCheckHttpPrefix(a1, (const unsigned __int16 **)&Str) < 0 ) return; if ( *Str != 47 ) return; v6 = _wcslen(Str); IEcbBase::ScReqMapUrlToPathEx(v5, Str, &v40); v36 = v7; if ( v7 < 0 ) return; v8 = (*(int (__thiscall **)(IEcbBase *, wchar_t **))(*(_DWORD *)v5 + 52))(v5, &Str1); if ( v8 != v40.cchMatchingURL ) { if ( v8 + 1 == v40.cchMatchingURL ) { v9 = Str[v8]; if ( v9 == 47 || !v9 ) { --v40.cchMatchingURL; goto LABEL_13; } } LABEL_12: v36 = 1378295; goto LABEL_13; } if ( v8 && (!Str[v8 - 1] || __wcsnicmp(Str1, Str, v8)) ) goto LABEL_12; LABEL_13: if ( v36 == 1378295 && a5 ) { v39 = 0; v45 = 0; CStackBuffer::CStackBuffer((int)&v43, 0x104u); LOBYTE(v45) = 1; CStackBuffer::CStackBuffer((int)&v41, 0x104u); LOBYTE(v45) = 2; if ( !CStackBuffer::resize((int)&v43, 2 * v40.cchMatchingURL + 2) ) goto LABEL_51; v10 = v40.cchMatchingURL; v11 = Str; v12 = Source; while ( v10 ) { *v12 = *v11; ++v11; ++v12; --v10; } Source[v40.cchMatchingURL] = 0; v13 = CbMDPathW(v37, Source); if ( !CStackBuffer::resize((int)&v41, v13) ) { LABEL_51: LOBYTE(v45) = 1; CStackBuffer::release((int)&v41); LOBYTE(v45) = 0; CStackBuffer::release((int)&v43); v45 = -1; if ( v39 ) CRefCountedObject::Release(v39); return; } MDPathFromURIW(v37, Source, v42); __wcslwr(v42); v14 = CChildVRCache::FFindVroot(v37, (int)v42, (int)&v39); LOBYTE(v45) = 1; if ( !v14 ) { CStackBuffer::release((int)&v41); LOBYTE(v45) = 0; CStackBuffer::release((int)&v43); v45 = -1; if ( v39 ) CRefCountedObject::Release(v39); return; } v15 = v39; v39 = 0; *v33 = v15; CStackBuffer::release((int)&v41); LOBYTE(v45) = 0; CStackBuffer::release((int)&v43); v45 = -1; if ( v39 ) CRefCountedObject::Release(v39); } v16 = v40.cchMatchingPath; if ( v40.cchMatchingPath ) { v17 = (const unsigned __int16 *)((char *)&v39 + 2 * v40.cchMatchingPath + 2); if ( *v17 == 92 ) { while ( v16 && *v17 == 92 && !FIsDriveTrailingChar(v17, v16) ) { v40.cchMatchingPath = --v16; --v17; } } else if ( !*v17 ) { v16 = v40.cchMatchingPath-- - 1; } } v18 = v16 - v40.cchMatchingURL + v6 + 1; v19 = *v34 < v18; v37 = (struct IEcb *)(v16 - v40.cchMatchingURL + v6 + 1); if ( v19 ) { *v34 = v18; if ( v33 ) { v20 = *v33; *v33 = 0; if ( v20 ) CRefCountedObject::Release(v20); } } else { v21 = v35; v22 = v16; v23 = 2 * v16; v24 = (unsigned int)(2 * v16) >> 2; qmemcpy(v35, &v40, 4 * v24); v26 = (char *)&v40 + 4 * v24; v25 = (char *)&v21[2 * v24]; LOBYTE(v24) = v23; v27 = v40.cchMatchingURL; qmemcpy(v25, v26, v24 & 3); v28 = v6 - v27; v29 = &Str[v27]; v30 = v35; qmemcpy(&v35[v22], v29, 2 * v28 + 2); for ( i = &v30[v40.cchMatchingPath]; *i; ++i ) { if ( *i == 47 ) *i = 92; } *v34 = (unsigned int)v37; } }