Newer
Older
AMI-Aptio-BIOS-Reversed / EarlyVideoPei / ImageRenderProcessFull.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Init
int __fastcall ImageRenderProcessFull(int *a1, int *a2, int a3, unsigned __int8 *buf_1, int a5)
{
  int *v6; // edi
  int v8; // ebx
  unsigned __int8 *buf; // edi
  int *v11; // ebx
  int n0x100_1; // eax
  unsigned __int8 *buf_2; // eax
  int *v14; // edi
  int n0x100_3; // ecx
  int *v17; // [esp+8h] [ebp-14h]
  int v18; // [esp+Ch] [ebp-10h]
  int n0x100; // [esp+10h] [ebp-Ch]
  int n0x100_2; // [esp+10h] [ebp-Ch]
  int v21; // [esp+14h] [ebp-8h]
  int v22; // [esp+14h] [ebp-8h]
  int *Pool; // [esp+18h] [ebp-4h]
  int *Pool_1; // [esp+18h] [ebp-4h]

  v6 = a1;
  v18 = a2[1];
  n0x100 = a2[2];
  Pool = ImageRenderSkipPixel(n0x100, n0x100, n0x100, 255 - n0x100 - v18, a5);
  if ( !Pool )
    return -1;
  v8 = 0;
  v21 = 0;
  if ( *a2 > 0 )
  {
    buf = buf_1;
    v11 = a1;
    n0x100_1 = n0x100;
    do
    {
      *v11 = v18;
      v11[1] = a3;
      v11[2] = n0x100_1;
      v11[3] = (int)buf;
      ImageRenderProcessLine(Pool, a3, buf);
      a3 += v18;
      v11 += 4;
      n0x100_1 = n0x100;
      buf += n0x100;
      ++v21;
    }
    while ( v21 < *a2 );
    v17 = v11;
    v8 = 0;
    buf_1 = buf;
    v6 = v17;
  }
  if ( a2[3] )
  {
    v22 = a2[4];
    n0x100_2 = a2[2];
    Pool_1 = ImageRenderSkipPixel(n0x100_2, n0x100_2, n0x100_2, 255 - n0x100_2 - v22, a5);
    if ( !Pool_1 )
      return -1;
    if ( a2[3] > 0 )
    {
      buf_2 = buf_1;
      v14 = v6 + 2;
      n0x100_3 = n0x100_2;
      do
      {
        *(v14 - 2) = v22;
        *v14 = n0x100_3;
        *(v14 - 1) = a3;
        v14[1] = (int)buf_2;
        ImageRenderProcessLine(Pool_1, a3, buf_2);
        v14 += 4;
        a3 += v22;
        n0x100_3 = n0x100_2;
        buf_2 = &buf_1[n0x100_2];
        ++v8;
        buf_1 += n0x100_2;
      }
      while ( v8 < a2[3] );
    }
  }
  return 0;
}