Newer
Older
AMI-Aptio-BIOS-Reversed / ServerCommonPkg / Universal / GetSec / Pei / TxtPei / TxtPeiInit.c
@Ajax Dong Ajax Dong 2 days ago 2 KB Restructure the repo
// Decompiled: 0xffe0683a
// Function: TxtPeiInit
// Module: TxtPei.efi (TXTPEI)

int __fastcall TxtPeiInit(EFI_SYSTEM_TABLE *SystemTable, _DWORD *a2)
{
  int v4; // eax
  int v5; // eax
  int v6; // eax

  *a2 = SystemTable; /*0xffe06845*/
  a2[1] = *(_DWORD *)(LODWORD(SystemTable->Hdr.Signature) + 96); /*0xffe0684c*/
  a2[2] = *(_DWORD *)(LODWORD(SystemTable->Hdr.Signature) + 100); /*0xffe06854*/
  if ( (*(int (__cdecl **)(EFI_SYSTEM_TABLE *, void *, _DWORD, _DWORD, _DWORD *))(LODWORD(SystemTable->Hdr.Signature) /*0xffe06872*/
                                                                                + 32))(
         SystemTable,
         &unk_FFE08C90,
         0,
         0,
         a2 + 3) < 0 )
  {
    DebugPrint(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n"); /*0xffe0687b*/
    v4 = DebugPrintProtocol(); /*0xffe06883*/
    if ( v4 ) /*0xffe0688a*/
      (*(void (__cdecl **)(const char *, int, const char *))(v4 + 4))( /*0xffe06898*/
        "e:\\hs\\ServerCommonPkg\\Universal\\GetSec\\Pei\\TxtPeiLib.c",
        98,
        "!EFI_ERROR (Status)");
  }
  (*(void (__cdecl **)(EFI_SYSTEM_TABLE *, void *, _DWORD, _DWORD, _DWORD *))(LODWORD(SystemTable->Hdr.Signature) + 32))( /*0xffe068ac*/
    SystemTable,
    &unk_FFE08CB0,
    0,
    0,
    a2 + 4);
  v5 = GetNextGuidHob(&unk_FFE08C30); /*0xffe068b7*/
  if ( v5 ) /*0xffe068be*/
  {
    a2[5] = v5 + 24; /*0xffe068d5*/
  }
  else
  {
    DebugPrint(0x80000000, "GUID HOB gEfiPlatformTxtDeviceMemoryGuid not found!\n"); /*0xffe068c6*/
    a2[5] = 0; /*0xffe068cd*/
  }
  v6 = GetNextGuidHob(&unk_FFE08C70); /*0xffe068dd*/
  if ( v6 ) /*0xffe068e4*/
  {
    a2[6] = v6 + 24; /*0xffe06903*/
    DebugPrint(0x80000000, "PlatformTxtPolicy:\n"); /*0xffe06906*/
    DebugPrint(0x80000000, "  BiosAcmAddress             - 0x%08x\n"); /*0xffe06919*/
    DebugPrint(0x80000000, "  TxtScratchAddress          - 0x%08x\n"); /*0xffe0692d*/
    DebugPrint(0x80000000, "  BiosAcmPolicy              - 0x%08x\n"); /*0xffe0693e*/
    TxtDebugPrintPolicy(a2); /*0xffe06948*/
    DebugPrint(0x80000000, "ApVector - 0x%08x\n"); /*0xffe06958*/
    return 0; /*0xffe06960*/
  }
  else
  {
    DebugPrint(0x80000000, "GUID HOB gEfiPlatformTxtPolicyDataGuid not found! Error when do TxtPei Init.\n"); /*0xffe068ec*/
    return -2147483634; /*0xffe068f3*/
  }
}