Newer
Older
AMI-Aptio-BIOS-Reversed / CpRcPkg / Universal / RegAccess / Pei / RegAccessPeim / decompiled / IoMemRead.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Restructure the repo
// IoMemRead - addr:0xffdaee3d
int __fastcall IoMemRead(int a1, _DWORD *a2, _DWORD *a3)
{
  int v4; // ecx
  int PeiServicesPpi; // eax
  int v6; // eax

  if ( a1 )
  {
    v4 = a1 - 1;
    if ( v4 )
    {
      if ( v4 == 1 )
      {
        *a3 = *a2;
      }
      else
      {
        if ( ((unsigned __int8)a2 & 7) != 0 )
        {
          PeiServicesPpi = GetPeiServicesPpi();
          if ( PeiServicesPpi )
            (*(void (__cdecl **)(const char *, int, const char *))(PeiServicesPpi + 4))(
              "e:\\hs\\MdePkg\\Library\\BaseIoLibIntrinsic\\IoLib.c",
              284,
              "(Address & 7) == 0");
        }
        *a3 = *a2;
        a3[1] = a2[1];
      }
    }
    else
    {
      if ( ((unsigned __int8)a2 & 1) != 0 )
      {
        v6 = GetPeiServicesPpi();
        if ( v6 )
          (*(void (__cdecl **)(const char *, int, const char *))(v6 + 4))(
            "e:\\hs\\MdePkg\\Library\\BaseIoLibIntrinsic\\IoLib.c",
            151,
            "(Address & 1) == 0");
      }
      *(_WORD *)a3 = *(_WORD *)a2;
    }
  }
  else
  {
    *(_BYTE *)a3 = *(_BYTE *)a2;
  }
  return 0;
}