Newer
Older
AMI-Aptio-BIOS-Reversed / EarlyVideoPei / ImageXorDecodeType7.c
@Ajax Dong Ajax Dong 2 days ago 601 bytes Init
int __cdecl ImageXorDecodeType7(int a1, _BYTE *a2, _BYTE *a3)
{
  int v3; // ecx
  int i; // ebx
  int v7; // edx
  int v9; // [esp+8h] [ebp-Ch]
  int v10; // [esp+Ch] [ebp-8h]

  v3 = 0;
  for ( i = 0; v3 < a1; ++v3 )
  {
    v9 = 0;
    v7 = 0;
    v10 = 0;
    do
    {
      if ( (char)*a2 >= 0 )
      {
        *a3 = *a2 ^ ((((_BYTE)v9 + (_BYTE)v3 + (unsigned __int8)(v7 % 3)) & 1) == 0);
        v7 = v10;
      }
      else
      {
        *a3 = *a2;
      }
      v7 += v3;
      v10 = v7;
      i += *a3 & 1;
      ++a2;
      ++a3;
      ++v9;
    }
    while ( v9 < a1 );
  }
  return i;
}