RtlCountRequiredHotPatchAddressTableEntries
INT64 __fastcall RtlCountRequiredHotPatchAddressTableEntries(
INT64 a1,
UINT64 a2,
UINT64 a3,
_DWORD *a4,
INT64 *a5,
CHAR a6,
INT64 a7,
INT64 a8,
_DWORD *a9){
unsigned __int64 v10;
unsigned int v11;
int v12;
unsigned int HotPatchSize;
INT64 *v14;
__int64 v15;
int v16;
bool v17;
INT64 *v18;
bool v19;
__int64 v20;
BYTE *v21;
BYTE *v22;
unsigned __int64 v23;
__int64 v24;
unsigned __int64 v25;
int v26;
v10 = (unsigned int)a3;
v11 = a2;
v12 = 0;
HotPatchSize = RtlGetHotPatchSize(a4);
v14 = a5;
v15 = HotPatchSize;
v16 = *(_DWORD *)a5;
if( !*(_DWORD *)a5 )
{
LABEL_23:
*a9 = v12;
return 0i64;
}
while( 1 )
{
v17 = 0;
v18 = v14;
if( a6 )
{
if( v16 < 0 )
v17 = 1;
}
else
{
v17 = v16 >= 0;
}
v19 = 0;
v14 = (INT64 *)((char *)v14 + 4);
if( (v16 & 0xFC000) == 114688 )
v19 = v17;
if( v19 )
break;
v14 = (INT64 *)((char *)v18 + 4 * (v16 & 0xFFF) * (unsigned int)v15 + 4);
LABEL_22:
v16 = *(_DWORD *)v14;
if( !*(_DWORD *)v14 )
goto LABEL_23;
}
if( (v16 & 0xFFF) == 0 )
goto LABEL_22;
while( 1 )
{
v20 = *(unsigned int *)v14;
if( (unsigned int)v20 < 0x10 || (int)v20 + 2 > v11 )
return 3221225595i64;
v21 = 0i64;
v22 = (BYTE *)(a1 + v20);
if( (_DWORD)v15 != 2 )
v21 = (BYTE *)(v14 + 1);
v23 = RtlpCheckFunctionPatchAppliedInOriginalImage(v22, v21);
if( v23 == -1i64 )
return 3221225595i64;
if( v23 )
{
if( v23 < v25 || v23 - v25 >= v10 )
return 3221225507i64;
}
else
{
++v12;
}
v14 = (INT64 *)(v24 + 4 * v15);
if( v26 == 1 )
goto LABEL_22;
}
}Referenced by:
MiPrepareToHotPatchImage