EmpParseStrings
NTSTATUS __stdcall EmpParseStrings(PVOID ParsedInfHandle){
int v2;
unsigned int SectionLineCount;
unsigned int v4;
_BYTE *v5;
void *PoolWithTag;
unsigned int v7;
PSTR SectionLineIndex;
CHAR *v9;
__int64 v10;
CHAR *v11;
__int64 v12;
PVOID *v13;
__int64 v14;
void *v16;
_QWORD *v17;
unsigned int v18;
__int64 v19;
signed __int64 v20;
v2 = 0;
SectionLineCount = EmpInfParseGetSectionLineCount(ParsedInfHandle, (PSTR)"Strings");
v4 = SectionLineCount;
if( !SectionLineCount )
return v2;
v5 = EmpStringTable;
if( !EmpStringTable )
{
PoolWithTag = ExAllocatePoolWithTag(PagedPool, 8i64 * SectionLineCount, 0x74694D45ui64);
EmpStringTable = PoolWithTag;
if( PoolWithTag )
{
memset((INT64)PoolWithTag, 0i64);
goto LABEL_5;
}
return -1073741670;
}
v16 = ExAllocatePoolWithTag(PagedPool, 8i64 * (SectionLineCount + EmpNumberOfStrings), 0x74694D45ui64);
EmpStringTable = v16;
v17 = v16;
if( !v16 )
return -1073741670;
v18 = EmpNumberOfStrings;
memset((INT64)v16, 0i64);
if( v18 )
{
v19 = v18;
v20 = v5 - (_BYTE *)v17;
do
{
*v17 = *(_QWORD *)((char *)v17 + v20);
++v17;
--v19;
}
while( v19 );
}
ExFreePoolWithTag(v5, 0x74694D45u);
LABEL_5:
v7 = 0;
while( v7 < v4 )
{
SectionLineIndex = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"Strings", v7, 0i64);
v9 = SectionLineIndex;
if( SectionLineIndex )
{
v10 = -1i64;
do
++v10;
while( SectionLineIndex[v10] );
v11 = (CHAR *)ExAllocatePoolWithTag(PagedPool, v10 + 1, 0x74694D45ui64);
v12 = (unsigned int)EmpNumberOfStrings;
v13 = (PVOID *)EmpStringTable;
*((_QWORD *)EmpStringTable + (unsigned int)EmpNumberOfStrings) = v11;
if( !v11 )
return -1073741670;
v14 = -1i64;
do
++v14;
while( v9[v14] );
v2 = RtlStringCchCopyA(v11, v14 + 1, v9);
if( v2 < 0 )
{
ExFreePoolWithTag(v13[v12], 0x74694D45u);
v2 = 0;
}
else
{
++EmpNumberOfStrings;
}
++v7;
}
}
return v2;
}Referenced by:
EmpParseInfDatabase