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

  v3 = 0;
  v4 = a1;
  for ( i = 0; v3 < a1; ++v3 )
  {
    v8 = v4;
    v9 = 0;
    v11 = v8;
    do
    {
      if ( (char)*a2 >= 0 )
      {
        *a3 = *a2 ^ ((v9 & 1) + v9 % 3 == 0);
        v8 = v11;
      }
      else
      {
        *a3 = *a2;
      }
      v9 += v3;
      i += *a3 & 1;
      ++a2;
      ++a3;
      v11 = --v8;
    }
    while ( v8 );
    v4 = a1;
  }
  return i;
}