Newer
Older
AMI-Aptio-BIOS-Reversed / MdeModulePkg / Application / PerfMonApp / PerfMonApp.c
@Ajax Dong Ajax Dong 2 days ago 2 KB Full restructure
/** @file
  PerfMonApp.c -- PerfMonApp

  Auto-converted from IDA decompiler output.
  Functions: 1

Copyright (c) HR650X BIOS Decompilation Project
**/

#include "PerfMonApp.h"


// Function: ModuleEntryPoint
EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { _QWORD *v3; // rdx unsigned __int64 i; // rax signed __int64 v5; // rbx _QWORD *v6; // rdi unsigned __int64 v7; // r8 unsigned __int64 v8; // rax EFI_STATUS v9; // rdi _QWORD *v11; // [rsp+38h] [rbp+10h] BYREF ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) sub_1934( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) sub_1934("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) sub_1934("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) sub_1934( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); sub_5210(); v11 = v3; n1000 = 1000; for ( i = 0; i < 0xA0; i += 40LL ) { *(_DWORD *)((char *)&unk_9220 + i + 32) = 0; *(_QWORD *)((char *)&unk_9220 + i + 8) = -1; *(_QWORD *)((char *)&unk_9220 + i + 16) = 0; *(_QWORD *)((char *)&unk_9220 + i) = 0; } v5 = sub_4D94(&unk_91E0, &v11); if ( v5 >= 0 && (v6 = v11) != 0 ) { sub_564(L"
DP Build Version: %d.%d
", 2, 4); v7 = v6[1]; v8 = v6[3]; qword_93A0 = v6[2]; qword_93A8 = v8; dword_93B0 = v7 / 0x3E8; byte_93B4 = v8 >= qword_93A0; sub_564(L"System Performance Timer Frequency: %,8d (KHz)
", (unsigned int)dword_93B0); sub_82C(); sub_918(); sub_5A8(); v5 = 0x8000000000000015uLL; if ( sub_BA0() != 0x8000000000000015uLL && sub_EF4() != 0x8000000000000015uLL ) { v9 = sub_FE4(); if ( v9 != 0x8000000000000015uLL ) { sub_129C(); return v9; } } } else { sub_564(L"Performance property not found
"); } return v5; }