AslpEnvResolveVars
INT64 __fastcall AslpEnvResolveVars(WCHAR *pszSrc, UINT64 a2, WCHAR *a3, UINT64 a4, UINT16 a5, UINT16 a6, UINT64 *a7){
UINT64 v7;
unsigned int v8;
int v9;
int v10;
unsigned int v11;
__int64 v12;
unsigned int v14;
UINT16 v15;
unsigned __int64 i;
UINT16 v17;
unsigned int v18;
__int64 v19;
WCHAR *v20;
WCHAR v21;
WCHAR *v22;
NTSTATUS v23;
NTSTATUS v24;
NTSTATUS v26;
NTSTATUS v27;
UINT64 v28;
NTSTATUS v29;
__int64 v30;
__int64 v31;
WCHAR *v32;
unsigned int cchDest;
cchDest = a4;
v32 = pszSrc;
v7 = (unsigned int)a4;
v8 = a2;
v9 = 0;
v10 = 0;
v11 = 0;
v12 = 0i64;
while( 1 )
{
if( v9 )
goto LABEL_33;
v14 = dword_140C02CE0[6 * v12];
if( v8 <= v14 )
goto LABEL_13;
if( !wcsnicmp(pszSrc, off_140C02CD0[3 * v12], v14) )
break;
LABEL_12:
pszSrc = v32;
LABEL_13:
if( (unsigned __int64)++v12 >= 4 )
{
if( !v9 )
{
v11 = v8;
if( v8 > (unsigned int)v7 )
{
v18 = -1073741789;
*(_DWORD *)a7 = v8;
return v18;
}
v29 = RtlStringCchCopyW(a3, (unsigned int)v7, pszSrc);
v18 = v29;
if( v29 < 0 )
{
LODWORD(v30) = v29;
v28 = 1018i64;
goto LABEL_44;
}
}
LABEL_33:
v18 = 0;
LABEL_31:
*(_DWORD *)a7 = v11;
return v18;
}
}
v11 = v8 + dword_140C02CE4[6 * v12] - dword_140C02CE0[6 * v12];
if( v11 > (unsigned int)v7 )
{
v18 = -1073741789;
goto LABEL_31;
}
if( !v12 )
{
v15 = a5;
for( i = 0i64; i < 56; i += 8i64 )
{
v17 = a6;
if( *(_WORD *)&byte_140C04900[i * 2] == v15 && word_140C04902[i] == a6 )
{
v18 = 0;
if( (unsigned __int64)cchDest - 1 > 0x7FFFFFFE )
v18 = -1073741811;
if( (v18 & 0x80000000) != 0 )
{
if( cchDest )
*a3 = 0;
}
else
{
v19 = cchDest;
v20 = a3;
if( cchDest )
{
do
{
if( !(2147483646i64 - cchDest + v19) )
break;
v21 = *(WCHAR *)((char *)v20 + (char *)L"%systemroot%" - (char *)a3);
if( !v21 )
break;
*v20++ = v21;
--v19;
}
while( v19 );
}
v22 = v20 - 1;
if( v19 )
v22 = v20;
v18 = v19 != 0 ? 0 : 0x80000005;
*v22 = 0;
}
if( (v18 & 0x80000000) != 0 )
{
LODWORD(v30) = v18;
v28 = 940i64;
goto LABEL_44;
}
v23 = RtlStringCchCatW(a3, cchDest, (&off_140C04908)[i / 4]);
v18 = v23;
if( v23 < 0 )
{
LODWORD(v30) = v23;
AslLogCallPrintf(1ui64, "AslpEnvResolveVars", 0x3B2ui64, "RtlStringCchCatW failed [%x]", v30);
return v18;
}
v24 = RtlStringCchCatW(a3, cchDest, &v32[dword_140C02CE0[0]]);
v18 = v24;
if( v24 < 0 )
{
LODWORD(v30) = v24;
AslLogCallPrintf(1ui64, "AslpEnvResolveVars", 0x3B8ui64, "RtlStringCchCatW failed [%x]", v30);
return v18;
}
v15 = a5;
v10 = 1;
v17 = a6;
}
}
if( v10 )
goto LABEL_11;
LODWORD(v31) = v17;
LODWORD(v30) = v15;
AslLogCallPrintf(
1ui64,
"AslpEnvResolveVars",
0x3C3ui64,
"Invalid combination of Host/Current processor architectures passed to AslpEnvResolveVars Host: %x4 Current: %x4",
v30,
v31);
v7 = cchDest;
}
if( v10 )
goto LABEL_11;
v26 = RtlStringCchCopyW(a3, v7, (&off_140C02CD8)[3 * v12]);
v18 = v26;
if( v26 < 0 )
{
LODWORD(v30) = v26;
v28 = 980i64;
LABEL_44:
AslLogCallPrintf(1ui64, "AslpEnvResolveVars", v28, "RtlStringCchCopyW failed [%x]", v30);
return v18;
}
v27 = RtlStringCchCatW(a3, v7, &v32[dword_140C02CE0[6 * v12]]);
v18 = v27;
if( v27 >= 0 )
{
LABEL_11:
v7 = cchDest;
v9 = 1;
goto LABEL_12;
}
LODWORD(v30) = v27;
AslLogCallPrintf(1ui64, "AslpEnvResolveVars", 0x3DAui64, "RtlStringCchCatW failed [%x]", v30);
return v18;
}Referenced by:
AslEnvExpandStrings2