Newer
Older
AMI-Aptio-BIOS-Reversed / Platform / GetDxeServicesTable.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Init
// GetDxeServicesTable - decompiled from Platform.efi
unsigned __int64 __fastcall GetDxeServicesTable(const void *DestinationBuffer, _QWORD *a2, UINTN Length)
{
  __int64 SystemTable; // rdi
  __int64 v6; // rbx
  __int64 i; // r14

  if ( !DestinationBuffer ) /*0x7702*/
    Assert((__int64)"e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 97, (__int64)"TableGuid != ((void *) 0)"); /*0x7715*/
  if ( !a2 ) /*0x771d*/
    Assert((__int64)"e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 98, (__int64)"Table != ((void *) 0)"); /*0x7730*/
  SystemTable = SystemTable; /*0x7735*/
  v6 = 0; /*0x773c*/
  *a2 = 0; /*0x773e*/
  if ( !*(_QWORD *)(SystemTable + 104) ) /*0x7742*/
    return 0x800000000000000EuLL; /*0x776b*/
  for ( i = 0; /*0x7748*/
        !(unsigned __int8)CompareMem(DestinationBuffer, (const void *)(i + *(_QWORD *)(SystemTable + 112)), Length);
        i += 24 )
  {
    if ( (unsigned __int64)++v6 >= *(_QWORD *)(SystemTable + 104) ) /*0x7769*/
      return 0x800000000000000EuLL; /*0x7769*/
  }
  *a2 = *(_QWORD *)(*(_QWORD *)(SystemTable + 112) + 24 * v6 + 16); /*0x779f*/
  return 0; /*0x7789*/
}