FopValidateFontNameTable
NTSTATUS __stdcall FopValidateFontNameTable(_FILE_IMAGE *FileHandle, UINT64 OffsetTableOffset, WCHAR **FontName){
WCHAR *v4;
int TableOffsetAndSize;
int v7;
int v8;
unsigned __int16 *v9;
char *v10;
unsigned int v11;
unsigned int v12;
UINT64 v13;
WCHAR *Memory;
unsigned int i;
__int64 v16;
UINT64 v18;
VOID *Buffer;
UINT64 v20;
LODWORD(v20) = 0;
Buffer = 0i64;
LODWORD(v18) = 0;
v4 = 0i64;
TableOffsetAndSize = FopGetTableOffsetAndSize(FileHandle, OffsetTableOffset, 0x6E616D65ui64, &v20, &v18);
if( TableOffsetAndSize < 0 )
return TableOffsetAndSize;
v7 = v20;
v8 = FopReadNamingTable(FileHandle, (unsigned int)v20, &Buffer);
v9 = (unsigned __int16 *)Buffer;
TableOffsetAndSize = v8;
if( v8 >= 0 )
{
v10 = (char *)Buffer + 6;
v11 = 0;
if( !*((_WORD *)Buffer + 1) )
{
LABEL_17:
TableOffsetAndSize = -1073741701;
goto LABEL_12;
}
while( *(_DWORD *)v10 != 65539 || *((_DWORD *)v10 + 1) != 66569 )
{
++v11;
v10 += 12;
if( v11 >= *((unsigned __int16 *)Buffer + 1) )
goto LABEL_17;
}
v12 = *((unsigned __int16 *)v10 + 4);
v13 = v12 + 2;
if( (unsigned int)v13 < v12 )
{
TableOffsetAndSize = -1073741675;
}
else
{
Memory = (WCHAR *)BgpFwAllocateMemory(v13);
v4 = Memory;
if( Memory )
{
TableOffsetAndSize = FioFwReadBytesAtOffset(
FileHandle,
v7 + v9[2] + (unsigned int)*((unsigned __int16 *)v10 + 5),
*((unsigned __int16 *)v10 + 4),
Memory);
if( TableOffsetAndSize < 0 )
goto LABEL_20;
*((_WORD *)v10 + 4) >>= 1;
for( i = 0; i < *((unsigned __int16 *)v10 + 4); v4[v16] = __ROR2__(v4[v16], 8) )
v16 = i++;
v4[i] = 0;
*FontName = v4;
LABEL_12:
if( TableOffsetAndSize >= 0 )
goto LABEL_13;
LABEL_20:
if( v4 )
BgpFwFreeMemory(v4);
goto LABEL_13;
}
TableOffsetAndSize = -1073741801;
}
}
LABEL_13:
if( v9 )
BgpFwFreeMemory(v9);
return TableOffsetAndSize;
}Referenced by:
FopInitializeFonts