SdbpInitializeSearchDBContext
__int64 __fastcall SdbpInitializeSearchDBContext(__int64 a1, __int64 a2, INT64 a3){
__int64 v3;
const wchar_t *ProcessHistory;
__int64 v5;
__int64 v6;
UINT8 *v7;
__int64 v8;
UINT64 v9;
__int64 result;
v3 = a1;
if( *(_QWORD *)(a1 + 72) )
return 1i64;
ProcessHistory = *(const wchar_t **)(a1 + 64);
if( !ProcessHistory )
{
if( (*(_DWORD *)a1 & 2) != 0 || (a1 = *(_QWORD *)(a1 + 56)) == 0 )
{
v5 = -1i64;
v6 = -1i64;
do
++v6;
while( *(_WORD *)(*(_QWORD *)(v3 + 32) + 2 * v6) );
do
++v5;
while( *(_WORD *)(*(_QWORD *)(v3 + 40) + 2 * v5) );
v7 = (UINT8 *)AslAlloc((VOID *)a1, 2i64 * (unsigned int)(v5 + v6 + 1), a3);
ProcessHistory = (const wchar_t *)v7;
if( !v7 )
{
AslLogCallPrintf(1ui64, "SdbpInitializeSearchDBContext", 0x152ui64, "Failed to allocate process history buffer");
return 0i64;
}
v8 = (unsigned int)v6;
v9 = (unsigned int)v6;
memmove(v7, *(UINT8 **)(v3 + 32), v9 * 2);
memmove((UINT8 *)&ProcessHistory[v9], *(UINT8 **)(v3 + 40), 2i64 * (unsigned int)v5);
ProcessHistory[(unsigned int)v5 + v8] = 0;
}
else
{
ProcessHistory = SdbpGetProcessHistory((PWCHAR)a1, *(PWCHAR *)(v3 + 32), *(PWCHAR *)(v3 + 40));
if( !ProcessHistory )
{
AslLogCallPrintf(1ui64, "SdbpInitializeSearchDBContext", 0x161ui64, "Failed to retrieve process history");
return 0i64;
}
}
}
*(_QWORD *)(v3 + 64) = ProcessHistory;
result = SdbpCreateSearchPathPartsFromPath(ProcessHistory, (_QWORD *)(v3 + 72));
if( (_DWORD)result )
*(_DWORD *)v3 |= 1u;
return result;
}Referenced by:
SdbpCheckMatchingDir
SdbpCheckMatchingFiles
SdbpCheckMatchingTextEntry
SdbpCheckMatchingWildcardFiles