Newer
Older
AMI-Aptio-BIOS-Reversed / AmiModulePkg / CSM / Aint13 / Aint13.c
@Ajax Dong Ajax Dong 7 days ago 2 KB Recovering names
/** @file
  Aint13.c -- Aint13

  Auto-converted from IDA decompiler output.
  Functions: 1 (recovered API surface only; recovery/cleanup pass).

Copyright (c) HR650X BIOS Decompilation Project
**/

#include "Aint13.h"

// Recovered module-scope state used by the decompiled entry path.
STATIC EFI_HANDLE        mImageHandle;
STATIC EFI_SYSTEM_TABLE *mSystemTable     = NULL;
STATIC EFI_BOOT_SERVICES *mBootServices    = NULL;
STATIC EFI_RUNTIME_SERVICES *mRuntimeServices = NULL;

// Module protocol GUID recovered from local docs.
STATIC EFI_GUID mAint13ProtocolGuid = {
  0x6780532, 0x7613, 0x4DD3, { 0x9E, 0xD7, 0x3D, 0x9B, 0xE3, 0xA7, 0xDA, 0x63 }
};

// Recovered helper signatures (reconstruction).
// Full implementations are intentionally omitted as this pass is symbol-focused.
//
// Split note:
//  - sub_1634 is chipset-specific and belongs to AInt13Csp.c in the recovered tree.
EFI_STATUS EFIAPI
sub_18BC(
  IN CHAR8 *FileName,
  IN UINTN LineNumber,
  IN CHAR8 *Description
  )
{
  return EFI_SUCCESS;
}

EFI_STATUS EFIAPI
sub_18FC(
  VOID
  )
{
  return EFI_SUCCESS;
}

EFI_STATUS EFIAPI
sub_624(
  VOID
  )
{
  return EFI_SUCCESS;
}

EFI_STATUS EFIAPI
sub_1634(
  VOID
  )
{
  return EFI_UNSUPPORTED;
}

// Function: _ModuleEntryPoint
EFI_STATUS EFIAPI
_ModuleEntryPoint(
  EFI_HANDLE        ImageHandle,
  EFI_SYSTEM_TABLE *SystemTable
  )
{
  EFI_BOOT_SERVICES    *BootServices;
  EFI_RUNTIME_SERVICES *RuntimeServices;
  EFI_HANDLE           ImageHandle_1;
  EFI_STATUS           Status;
  VOID                 *Interface = (VOID *)&sub_624;

  mImageHandle = ImageHandle;
  if (!mImageHandle) {
    sub_18BC("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)");
  }

  mSystemTable = SystemTable;
  if (!mSystemTable) {
    sub_18BC("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)");
  }

  mBootServices = mSystemTable->BootServices;
  if (!mBootServices) {
    sub_18BC("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)");
  }

  mRuntimeServices = mSystemTable->RuntimeServices;
  if (!mRuntimeServices) {
    sub_18BC("e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)");
  }

  sub_18FC();
  ImageHandle_1 = ImageHandle;

  BootServices   = mBootServices;
  RuntimeServices = mRuntimeServices;
  (VOID)BootServices;
  (VOID)RuntimeServices;

  Status = ((EFI_STATUS (*)(EFI_HANDLE *, VOID *, UINT32, VOID *))
            mBootServices->InstallProtocolInterface)(
              &ImageHandle_1,
              &mAint13ProtocolGuid,
              0,
              Interface);

  return Status;
}

// Legacy decompiler symbol kept as a compatibility alias in recovery trees.
EFI_STATUS EFIAPI
ModuleEntryPoint(
  EFI_HANDLE        ImageHandle,
  EFI_SYSTEM_TABLE *SystemTable
  )
{
  return _ModuleEntryPoint(ImageHandle, SystemTable);
}