Newer
Older
AMI-Aptio-BIOS-Reversed / Platform / HiiConfigRouting.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Init
// HiiConfigRouting - decompiled from Platform.efi
__int64 __fastcall HiiConfigRouting(__int64 a1, char *ZeroPool, char **a3)
{
  __int64 v5; // rsi
  __int64 v6; // rdx
  _BYTE SourceBuffer[112]; // [rsp+30h] [rbp-E8h] BYREF
  _BYTE DestinationBuffer[112]; // [rsp+A0h] [rbp-78h] BYREF
  __int64 n676; // [rsp+128h] [rbp+10h] BYREF

  if ( !ZeroPool || !a3 ) /*0x1f15*/
    return 0x8000000000000002uLL; /*0x209b*/
  if ( SetupRecordsList(ZeroPool, &SourceBuffer__4, L"FakeVar") )
  {
    DebugPrint(0x80000000, "DefaultRouteConfig: it's fake varstore\n");
    v5 = WriteProtocolVar((__int64)&unk_F950, (__int64)SourceBuffer); /*0x1f5b*/
    if ( v5 >= 0 ) /*0x1f61*/
    {
      CopyMem(DestinationBuffer, SourceBuffer, 0x67u); /*0x1f78*/
      if ( (unsigned int)GetManufacturingMode() == 1 || (unsigned int)GetManufacturingMode() == 15 ) /*0x1f8f*/
        v5 = MeSetupConfiguration((__int64)SourceBuffer, v6); /*0x1f9b*/
      if ( !v5 && StrCmpS(DestinationBuffer, (UINTN)SourceBuffer, 103) ) /*0x1fb3*/
        RegisterHiiPackage((__int64)&unk_F950, (__int64)SourceBuffer); /*0x1fc9*/
    }
  }
  if ( SetupRecordsList(ZeroPool, &SourceBuffer__3, L"PchRcConfiguration") ) /*0x1fdf*/
    return HiiFormActions((__int64)ZeroPool, a3); /*0x1fee*/
  *a3 = ZeroPool; /*0x1fff*/
  if ( SetupRecordsList(ZeroPool, &SourceBuffer__1, aIntelsetup) )// "IntelSetup" /*0x2009*/
  {
    CopyMem(&SourceBuffer__0, &DestinationBuffer__3, 0x2A4u); /*0x204b*/
    n676 = 676; /*0x2062*/
    (*(void (__fastcall **)(__int64, char *, void *, __int64 *, char **))(qword_FE68 + 32))( /*0x2075*/
      qword_FE68,
      ZeroPool,
      &SourceBuffer__0,
      &n676,
      a3);
    CopyMem(&DestinationBuffer__3, &SourceBuffer__0, 0x2A4u); /*0x2085*/
    return RegisterHiiPackage((__int64)&unk_FB40, (__int64)&SourceBuffer__0); /*0x2094*/
  }
  else
  {
    DebugPrint(0x40u, "Configuration not found-> %s \n", ZeroPool); /*0x2021*/
    return 0x800000000000000EuLL; /*0x2026*/
  }
}