SdbpCheckAllAttributes
NTSTATUS __stdcall SdbpCheckAllAttributes(
UINT64 *bMatchedOut,
tagSDBCONTEXT *pSdbContext,
VOID *pdb,
UINT64 tiMatch,
UINT64 hFileMapping){
NTSTATUS Attributes;
unsigned int v7;
_DB *v8;
unsigned int v9;
char *v10;
unsigned int v11;
int *v12;
UINT16 v13;
unsigned int FirstTag;
char *v15;
__int64 v16;
int v17;
UINT64 *p_QWORDTag;
int v20;
unsigned int v21;
WCHAR *StringTagPtr;
__int64 v23;
void(__fastcall *v24)(_QWORD, UINT64 *, _QWORD, _QWORD);
_BOOL8 v25;
int DWORDTag;
unsigned int v27;
__int64 QWORDTag;
unsigned int v32;
unsigned __int16 hFileMappinga;
v32 = tiMatch;
Attributes = 0;
DWORDTag = 0;
v7 = tiMatch;
QWORDTag = 0i64;
v8 = (_DB *)pdb;
*(_DWORD *)bMatchedOut = 0;
v9 = 1;
v27 = 1;
if( !hFileMapping )
return Attributes;
if( *(_DWORD *)(hFileMapping + 80) )
{
v25 = *(_QWORD *)(hFileMapping + 32) != 0i64;
goto LABEL_34;
}
if( !*(_QWORD *)(hFileMapping + 8) )
{
LODWORD(v25) = 0;
LABEL_34:
if( !v25 )
return Attributes;
}
v10 = (char *)AslAlloc(bMatchedOut, 1056, (INT64)pdb);
if( !v10 )
return -1073741801;
v11 = 0;
v12 = (int *)&unk_140C121B4;
while( 1 )
{
v13 = *((_WORD *)v12 - 2);
hFileMappinga = v13;
FirstTag = SdbFindFirstTag(v8, v7, v13);
if( !FirstTag )
goto LABEL_7;
p_QWORDTag = 0i64;
v20 = v13 & 0xF000;
v21 = 0;
switch( v20 )
{
case 20480:
QWORDTag = SdbReadQWORDTag((_DB *)pdb, FirstTag, 0i64);
p_QWORDTag = (UINT64 *)&QWORDTag;
v21 = 8;
break;
case 16384:
DWORDTag = SdbReadDWORDTag((_DB *)pdb, FirstTag, 0);
p_QWORDTag = (UINT64 *)&DWORDTag;
v21 = 4;
break;
case 24576:
StringTagPtr = SdbGetStringTagPtr(pdb, FirstTag);
v23 = -1i64;
p_QWORDTag = (UINT64 *)StringTagPtr;
do
++v23;
while( StringTagPtr[v23] );
v21 = 2 * v23 + 2;
break;
}
Attributes = AslFileAllocAndGetAttributes((__int64)v10, hFileMapping, 1i64 << *v12);
if( Attributes < 0 )
break;
if( (*(_DWORD *)&v10[32 * *v12 + 24] & 1) == 0 )
goto LABEL_9;
if( !(unsigned int)SdbpCheckAttribute(&v27, hFileMappinga, p_QWORDTag, v21, (__int64)&v10[32 * *v12]) )
{
Attributes = -1073741595;
AslLogCallPrintf(1ui64, (INT8 *)"SdbpCheckAllAttributes", 0x2FFui64, (INT8 *)"SdbpCheckAttribute failed [%x]");
goto LABEL_10;
}
v9 = v27;
v24 = (void(__fastcall *)(_QWORD, UINT64 *, _QWORD, _QWORD))*((_QWORD *)pSdbContext + 122);
if( v24 )
v24(hFileMappinga, p_QWORDTag, v21, v27);
if( !v9 )
{
LABEL_8:
*(_DWORD *)bMatchedOut = v9;
LABEL_9:
Attributes = 0;
goto LABEL_10;
}
v8 = (_DB *)pdb;
v7 = v32;
LABEL_7:
++v11;
v12 += 2;
if( v11 >= 0x22 )
goto LABEL_8;
}
AslLogCallPrintf(1ui64, (INT8 *)"SdbpCheckAllAttributes", 0x2E8ui64, (INT8 *)"Failed to get attribute %d [%x]");
LABEL_10:
v15 = v10 + 16;
v16 = 33i64;
do
{
v17 = *((_DWORD *)v15 + 2);
if( (v17 & 1) != 0 && *((_DWORD *)v15 - 4) == 4 && (v17 & 4) != 0 && *(_QWORD *)v15 )
ExFreePoolWithTag(*(PVOID *)v15, 0x74705041u);
v15 += 32;
--v16;
}
while( v16 );
memset(v10, 0i64, 0x420u);
ExFreePoolWithTag(v10, 0x74705041u);
return Attributes;
}Referenced by:
SdbpCheckMatchingFiles
SdbpCheckMatchingWildcardFiles