diff --git a/AmiCRBPkg/CRB/CRBDxe/CRBDxe.c b/AmiCRBPkg/CRB/CRBDxe/CRBDxe.c index a3430a3..79f645c 100644 --- a/AmiCRBPkg/CRB/CRBDxe/CRBDxe.c +++ b/AmiCRBPkg/CRB/CRBDxe/CRBDxe.c @@ -211,16 +211,16 @@ v15[3] = -1627686829; /*0x65a*/ UefiLibCreateProtocolNotifyEvent((__int64)v15, SystemTable_1, (__int64)CrbDriverEntryPoint, v5, (__int64)&v19); /*0x661*/ UefiLibCreateProtocolNotifyEvent((__int64)&dword_3940, SystemTable_2, (__int64)PchRcConfigUpdate, v7, (__int64)&v20); /*0x67d*/ - v8 = sub_1A8C(); /*0x682*/ + v8 = CompareMemWrapper(); /*0x682*/ src = (char *)(*(__int64 (__fastcall **)(__int64))(v8 + 40))(115); /*0x68c*/ - sub_18C4(dst, src, 0x10u); /*0x69c*/ + CopyMemWrapper(dst, src, 0x10u); /*0x69c*/ v10 = *(_QWORD *)dst; /*0x6a1*/ if ( *(_QWORD *)dst && v17 ) /*0x6af*/ { - v11 = sub_1A8C(); /*0x6b1*/ + v11 = CompareMemWrapper(); /*0x6b1*/ (*(void (__fastcall **)(__int64, __int64))(v11 + 144))(18, v10); /*0x6be*/ v12 = v17; /*0x6c4*/ - v13 = sub_1A8C(); /*0x6c8*/ + v13 = CompareMemWrapper(); /*0x6c8*/ (*(void (__fastcall **)(__int64, __int64))(v13 + 144))(19, v12); /*0x6d5*/ } OptimizedBootConfig(); /*0x6db*/ @@ -434,7 +434,7 @@ if ( !v6[0] ) /*0xb24*/ { sub_172C(64, "Register protocol notification for PciIoProtocol, to disable Network devices \n"); /*0xb30*/ - return sub_1C50((__int64)&dword_38F0, SystemTable, (__int64)PciClassCodeQuery, v4, (__int64)&qword_3CB0); /*0xb4f*/ + return UefiLibCreateProtocolNotifyEvent((__int64)&dword_38F0, SystemTable, (__int64)PciClassCodeQuery, v4, (__int64)&qword_3CB0); /*0xb4f*/ } return result; /*0xb71*/ } @@ -513,12 +513,12 @@ buf_1[6] = 8; /*0xc32*/ LABEL_13: buf_1[7] = (a4 != 0) + 3; /*0xc36*/ - sub_17B4((__int64)(buf_1 + 17), "Slot9"); /*0xc4c*/ + AsciiStrCpyS((__int64)(buf_1 + 17), "Slot9"); /*0xc4c*/ v21 = -2; /*0xc5b*/ result = (*(__int64 (__fastcall **)(__int64, _QWORD, __int16 *, char *))qword_3D78)(qword_3D78, 0, &v21, buf_1); /*0xc6f*/ if ( result >= 0 ) /*0xc74*/ { - sub_1B48((__int64)buf_1); /*0xc79*/ + AllocateZeroPoolWrapper((__int64)buf_1); /*0xc79*/ return 0; /*0xc7e*/ } return result; /*0xc8f*/ @@ -686,12 +686,12 @@ } Slot9_1 = Slot9; /*0xfa6*/ buf_1[7] = (a4 != 0) + 3; /*0xfb3*/ - sub_17B4((__int64)(buf_1 + 17), Slot9_1); /*0xfb6*/ + AsciiStrCpyS((__int64)(buf_1 + 17), Slot9_1); /*0xfb6*/ a6 = -2; /*0xfc8*/ result = (*(__int64 (__fastcall **)(__int64, _QWORD, __int16 *, char *))qword_3D78)(qword_3D78, 0, &a6, buf_1); /*0xfdf*/ if ( result >= 0 ) /*0xfe4*/ { - sub_1B48((__int64)buf_1); /*0xfe9*/ + AllocateZeroPoolWrapper((__int64)buf_1); /*0xfe9*/ return 0; /*0xfee*/ } return result; /*0xff0*/ @@ -746,9 +746,9 @@ result = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(BootServices + 320))(&unk_38B0, 0, &qword_3D80); /*0x1067*/ if ( result >= 0 ) /*0x1070*/ { - sub_20E0(buf, &buf_, &buf__1); /*0x1082*/ + SmbiosType9GetSlotInfo(buf, &buf_, &buf__1); /*0x1082*/ (*(void (__fastcall **)(__int64))(BootServices + 112))(a1); /*0x1091*/ - if ( (sub_1E6C((unsigned __int8 *)&v31, &v30, &v24) & 0x8000000000000000uLL) == 0LL ) /*0x10a8*/ + if ( (SmbiosType9SlotDataValidate((unsigned __int8 *)&v31, &v30, &v24) & 0x8000000000000000uLL) == 0LL ) /*0x10a8*/ { if ( v24 ) /*0x10ae*/ { @@ -769,8 +769,8 @@ v30); } } - sub_23E4(v4, &v30, v5, v6); /*0x1116*/ - n10 = sub_21FC(v11); /*0x111b*/ + GpioGetCommunity(v4, &v30, v5, v6); /*0x1116*/ + n10 = GpioGetPadConfig(v11); /*0x111b*/ if ( v30 == 1 ) /*0x1124*/ { if ( !n10 ) /*0x112c*/ @@ -796,7 +796,7 @@ 0, "Slot2"); } - if ( (unsigned __int8)sub_2268(v13) == 1 ) /*0x11b3*/ + if ( (unsigned __int8)GpioSetPadConfig(v13) == 1 ) /*0x11b3*/ { LOBYTE(v19) = HIBYTE(buf_); /*0x11de*/ SmbiosType9SlotUpdateHelper( /*0x11ec*/ @@ -858,7 +858,7 @@ v19, 0x10u, "Slot4"); - n2_1 = sub_2268(v17); /*0x130b*/ + n2_1 = GpioSetPadConfig(v17); /*0x130b*/ if ( n2_1 == 4 ) /*0x1312*/ { LOBYTE(v22) = HIBYTE(buf_); /*0x133c*/ @@ -1058,10 +1058,10 @@ va_list va; // [rsp+40h] [rbp+18h] BYREF va_start(va, a2); - result = sub_16AC(); /*0x1743*/ + result = PciCfgReadByte(); /*0x1743*/ if ( result ) /*0x174e*/ { - result = sub_22BC(); /*0x1750*/ + result = GpioCheckPadOverride(); /*0x1750*/ if ( ((unsigned int)result & (unsigned int)a1) != 0 ) /*0x175b*/ return (*v4)(a1, a2, (__int64 *)va); /*0x176a*/ } @@ -1075,7 +1075,7 @@ { __int64 result; // rax - result = sub_16AC(); /*0x178c*/ + result = PciCfgReadByte(); /*0x178c*/ if ( result ) /*0x1794*/ return (*(__int64 (__fastcall **)(__int64, __int64, __int64))(result + 8))(a1, a2, a3); /*0x179f*/ return result; /*0x17ac*/ @@ -1202,10 +1202,10 @@ __int64 v6; // rdi __int64 v7; // rax - v4 = sub_2648(a1); /*0x1a46*/ - v5 = sub_2648(a2); /*0x1a52*/ - v6 = sub_2648(a1 + 8); /*0x1a5e*/ - v7 = sub_2648(a2 + 8); /*0x1a61*/ + v4 = MmioGetBaseAddr(a1); /*0x1a46*/ + v5 = MmioGetBaseAddr(a2); /*0x1a52*/ + v6 = MmioGetBaseAddr(a1 + 8); /*0x1a5e*/ + v7 = MmioGetBaseAddr(a2 + 8); /*0x1a61*/ return v4 == v5 && v6 == v7; /*0x1a85*/ } @@ -1420,7 +1420,7 @@ buf_ = 0; /*0x1e96*/ buf_1[0] = 0; /*0x1e9e*/ v5 = 0; /*0x1eaa*/ - sub_20E0(&buf, &buf_, buf_1); /*0x1eb1*/ + SmbiosType9GetSlotInfo(&buf, &buf_, buf_1); /*0x1eb1*/ v6 = (unsigned __int16 *)sub_1E30(((unsigned __int64)(unsigned __int8)buf_ << 20) | 0x10000); /*0x1ec3*/ if ( (unsigned __int16)sub_2618(v6) != 0xFFFF ) /*0x1ed8*/ { @@ -1635,12 +1635,12 @@ int v10; // [rsp+58h] [rbp+20h] BYREF LOBYTE(v10) = a4; /*0x230c*/ - if ( (unsigned int)sub_2580() != 1 ) + if ( (unsigned int)GpioGetChipsetId() != 1 ) { DebugLogPrint(0x80000000LL, "GPIO ERROR: Incorrect GpioPad define used on this chipset (Group=%d, Pad=%d)!\n", 6, 0); return 0x8000000000000003uLL; /*0x2344*/ } - v6 = sub_24E8(p_n6); /*0x234e*/ + v6 = GpioGetPadCfgBase(p_n6); /*0x234e*/ v8 = v6; /*0x2359*/ if ( p_n6[0] <= 6 ) { @@ -1652,7 +1652,7 @@ DebugLogPrint(0x80000000LL, "GPIO ERROR: Pin number (%d) exceeds possible range for this group\n", 0); return 0x8000000000000002uLL; /*0x2394*/ } - sub_2440(v7, &v10); /*0x239b*/ + GpioGroupCheck(v7, &v10); /*0x239b*/ if ( v10 ) { DebugLogPrint(0x80000000LL, "GPIO ERROR: Accessing pad not owned by host (Group=%d, Pad=%d)!\n", 6, 0); @@ -1693,7 +1693,7 @@ __int64 n1389; // rdx unsigned __int64 p_n6; // [rsp+40h] [rbp+18h] BYREF - v3 = sub_24E8(&p_n6); /*0x244e*/ + v3 = GpioGetPadCfgBase(&p_n6); /*0x244e*/ if ( p_n6 <= 6 ) { DebugLogPrint(0x80000000LL, "GPIO ERROR: Group argument (%d) exceeds GPIO group range\n", 6); @@ -1830,7 +1830,7 @@ unsigned __int64 p_n6; // [rsp+48h] [rbp+20h] BYREF v4 = v2; /*0x2689*/ - v5 = (unsigned __int8 *)sub_24E8(&p_n6); /*0x268c*/ + v5 = (unsigned __int8 *)GpioGetPadCfgBase(&p_n6); /*0x268c*/ if ( p_n6 > 6 ) /*0x2697*/ { *v4 = *(_DWORD *)(Value | ((v5[360] | 0xFD00LL) << 16)); /*0x26d7*/ diff --git a/AmiCRBPkg/CRB/CRBSmm/CRBSmm.c b/AmiCRBPkg/CRB/CRBSmm/CRBSmm.c index 2af91d9..d03602b 100644 --- a/AmiCRBPkg/CRB/CRBSmm/CRBSmm.c +++ b/AmiCRBPkg/CRB/CRBSmm/CRBSmm.c @@ -15,10 +15,10 @@ { signed __int64 v2; // rbx - sub_48C(ImageHandle, SystemTable); - v2 = sub_748(); + CrbSmmInitialize(ImageHandle, SystemTable); + v2 = CrbSmmGetInitStatus(); if (v2 < 0) { - sub_C5C(); + CrbSmmHandleInitError(); } return v2; } diff --git a/AmiCRBPkg/CRB/CRBSmm/CRBSmm.h b/AmiCRBPkg/CRB/CRBSmm/CRBSmm.h index 5e71bb1..1d8638c 100644 --- a/AmiCRBPkg/CRB/CRBSmm/CRBSmm.h +++ b/AmiCRBPkg/CRB/CRBSmm/CRBSmm.h @@ -24,30 +24,30 @@ ); /// -/// sub_48C +/// CrbSmmInitialize /// EFI_STATUS EFIAPI -sub_48C( +CrbSmmInitialize( VOID ); /// -/// sub_748 +/// CrbSmmGetInitStatus /// EFI_STATUS EFIAPI -sub_748( +CrbSmmGetInitStatus( VOID ); /// -/// sub_C5C +/// CrbSmmHandleInitError /// EFI_STATUS EFIAPI -sub_C5C( +CrbSmmHandleInitError( VOID ); -#endif /* __CRBSMM_H__ */ \ No newline at end of file +#endif /* __CRBSMM_H__ */ diff --git a/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.c b/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.c index 14cf910..5a7b45f 100644 --- a/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.c +++ b/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.c @@ -9,35 +9,35 @@ #include "AcpiModeEnable.h" +static EFI_STATUS gModuleStatus; +static UINT8 gAcpiModeEnableContext; // Function: ModuleEntryPoint EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { - __int64 v3; // rcx - __int64 v4; // rax - EFI_STATUS v5; // rbx + EFI_STATUS Status; // rbx - sub_564(ImageHandle); - qword_21E8 = 0x8000000000000001uLL; - if (!sub_2C0(&unk_20F0)) { - v4 = sub_BF4(v3, SystemTable); - if (v4 >= 0 || qword_21E8 < 0) { - qword_21E8 = v4; + InitializeLibrary(ImageHandle); + gModuleStatus = 0x8000000000000001uLL; + if (!IsAcpiModeEnableContextInitialized(&gAcpiModeEnableContext)) { + Status = InitializeAcpiModeEnable(ImageHandle, SystemTable); + if (Status >= 0 || gModuleStatus < 0) { + gModuleStatus = Status; } - sub_E08(&unk_20F0); - sub_360(&unk_20F0, -1); - sub_EE8( + RegisterAcpiModeEnableContext(&gAcpiModeEnableContext); + UnregisterAcpiModeEnableContext(&gAcpiModeEnableContext, -1); + AutoGenAssertion( "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\AmiCRBPkg\\Chipset\\SB\\AcpiModeEnable\\DEBUG\\AutoGen.c", 429, "((BOOLEAN)(0==1))"); - sub_EE8( + AutoGenAssertion( "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\AmiCRBPkg\\Chipset\\SB\\AcpiModeEnable\\DEBUG\\AutoGen.c", 444, "((BOOLEAN)(0==1))"); } - v5 = qword_21E8; - if (qword_21E8 < 0) { - sub_10B4(); + Status = gModuleStatus; + if (gModuleStatus < 0) { + AcpiModeEnableFatalShutdown(); } - return v5; + return Status; } diff --git a/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.h b/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.h index f877c09..4dece73 100644 --- a/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.h +++ b/AmiCRBPkg/Chipset/SB/AcpiModeEnable/AcpiModeEnable.h @@ -26,66 +26,70 @@ ); /// -/// sub_564 +/// InitializeLibrary /// EFI_STATUS EFIAPI -sub_564( - VOID +InitializeLibrary( + EFI_HANDLE ImageHandle ); /// -/// sub_BF4 +/// InitializeAcpiModeEnable /// EFI_STATUS EFIAPI -sub_BF4( - VOID +InitializeAcpiModeEnable( + EFI_HANDLE ImageHandle, + EFI_SYSTEM_TABLE *SystemTable ); /// -/// sub_E08 +/// RegisterAcpiModeEnableContext /// EFI_STATUS EFIAPI -sub_E08( - VOID +RegisterAcpiModeEnableContext( + VOID *Context ); /// -/// sub_360 +/// UnregisterAcpiModeEnableContext /// EFI_STATUS EFIAPI -sub_360( - VOID +UnregisterAcpiModeEnableContext( + VOID *Context, + INTN Status ); /// -/// sub_EE8 +/// AutoGenAssertion /// EFI_STATUS EFIAPI -sub_EE8( - VOID +AutoGenAssertion( + CONST CHAR8 *FileName, + UINTN LineNumber, + CONST CHAR8 *Expression ); /// -/// sub_2C0 +/// IsAcpiModeEnableContextInitialized /// EFI_STATUS EFIAPI -sub_2C0( - VOID +IsAcpiModeEnableContextInitialized( + VOID *Context ); /// -/// sub_10B4 +/// AcpiModeEnableFatalShutdown /// EFI_STATUS EFIAPI -sub_10B4( +AcpiModeEnableFatalShutdown( VOID ); -#endif /* __ACPIMODEENABLE_H__ */ \ No newline at end of file +#endif /* __ACPIMODEENABLE_H__ */ diff --git a/AmiCRBPkg/Chipset/SB/SBPEI/SBPEI.h b/AmiCRBPkg/Chipset/SB/SBPEI/SBPEI.h index bf3c3bf..ef704ab 100644 --- a/AmiCRBPkg/Chipset/SB/SBPEI/SBPEI.h +++ b/AmiCRBPkg/Chipset/SB/SBPEI/SBPEI.h @@ -33,7 +33,7 @@ EFI_STATUS EFIAPI -sub_FFE2FCB8( +internal_memset32( VOID ); @@ -45,127 +45,127 @@ EFI_STATUS EFIAPI -sub_FFE2FD3A( +InitializeSbPeiEnvironment( VOID ); EFI_STATUS EFIAPI -sub_FFE2FE5B( +GetSbSataDeviceAddress( VOID ); EFI_STATUS EFIAPI -sub_FFE2FE7D( +RecInitSbSataController( VOID ); EFI_STATUS EFIAPI -sub_FFE2FF1C( +ReadPortWordChecked( VOID ); EFI_STATUS EFIAPI -sub_FFE2FF4C( +ReadIoWordChecked( VOID ); EFI_STATUS EFIAPI -sub_FFE2FF7A( +WriteIoWordChecked( VOID ); EFI_STATUS EFIAPI -sub_FFE2FFAD( +BcdByteToBinary( VOID ); EFI_STATUS EFIAPI -sub_FFE3000A( +GetPeiServicesTable( VOID ); EFI_STATUS EFIAPI -sub_FFE3003B( +PeiDebugPrint( VOID ); EFI_STATUS EFIAPI -sub_FFE30065( +PeiAssert( VOID ); EFI_STATUS EFIAPI -sub_FFE30083( +GetPcdProtocol( VOID ); EFI_STATUS EFIAPI -sub_FFE300DB( +PcdGet16FromProtocol( VOID ); EFI_STATUS EFIAPI -sub_FFE300EA( +PcdGet32FromProtocol( VOID ); EFI_STATUS EFIAPI -sub_FFE300F9( +DebugAssert( VOID ); EFI_STATUS EFIAPI -sub_FFE3016B( +PcdGet16FromProtocolValue( VOID ); EFI_STATUS EFIAPI -sub_FFE30177( +GetMmioBaseFromResourceList( VOID ); EFI_STATUS EFIAPI -sub_FFE30195( +ReadRtcRegisterB( VOID ); EFI_STATUS EFIAPI -sub_FFE301E4( +InitializePcdProtocolCache( VOID ); EFI_STATUS EFIAPI -sub_FFE3027F( +ResolvePcdResourceOffset( VOID ); EFI_STATUS EFIAPI -sub_FFE303FD( +GetPeiServicesTableValue( VOID ); EFI_STATUS EFIAPI -sub_FFE3042F( +ReadIdtr( VOID ); diff --git a/AmiCompatibilityPkg/Smbios/Smbios/Smbios.c b/AmiCompatibilityPkg/Smbios/Smbios/Smbios.c index e6c7d3d..574b4e7 100644 --- a/AmiCompatibilityPkg/Smbios/Smbios/Smbios.c +++ b/AmiCompatibilityPkg/Smbios/Smbios/Smbios.c @@ -93,8 +93,7 @@ extern EFI_GUID gSmbiosProducerGuid; // unk_8C50 // -// Debug helper: macro to call DebugPrint / sub_4F00 -// sub_4F00 is DebugPrint with error level as first arg +// Debug helper: macro to call DebugPrint // #define SMBIOS_DEBUG(Level, ...) DebugPrint (Level, __VA_ARGS__) @@ -364,7 +363,7 @@ { // // For now, a placeholder that calls down to the internal implementation. - // The actual decompiled logic (sub_1BEC) performs an in-place string swap + // The actual decompiled logic performs an in-place string swap // with compaction of the trailing content. // // Full implementation from decompilation would: @@ -374,7 +373,7 @@ // 4. memmove trailing data forward/backward // 5. Copy new string into place // - ASSERT (FALSE); // Not yet fully reimplemented; see sub_1BEC decompilation. + ASSERT (FALSE); // Not yet fully reimplemented. } /** @@ -1019,7 +1018,7 @@ // // Specialized path for Processor type structures with specific flags // - Status = EFI_UNSUPPORTED; // Placeholder for sub_26E0 path + Status = EFI_UNSUPPORTED; // Placeholder for the specialized processor path } else { Status = UpdateSmbiosTable ( SMBIOS_INSERT_STRUCTURE, @@ -1409,7 +1408,7 @@ // // First time through: populate from firmware data sources // - // (sub_1AB8, sub_1CB8 - populate type-specific structures) + // Populate type-specific structures // gSmbiosFirstDynamicUpdateSeen = FALSE; } @@ -1418,7 +1417,7 @@ // After all dynamic updates, trigger memory type information update // Check if system is in S5/S6 state for memory data decisions // - // (sub_5984 handles memory-based type 17 updates) + // Handle memory-based type 17 updates // // @@ -1455,7 +1454,7 @@ ) { // - // Decompiled logic from sub_B70: + // Decompiled logic: // // 1. Walk the SMBIOS table // 2. For each structure, check if NVRAM data exists for that handle @@ -1466,7 +1465,7 @@ // // Placeholder for the full NVRAM update logic. - // The decompiled function (sub_B70, ~800 instructions) performs: + // The decompiled function (~800 instructions) performs: // - NVRAM variable enumeration per SMBIOS handle // - Field-level update with zero/skip masks // - String reference count recalculation @@ -2337,7 +2336,7 @@ // Library constructors (ProcessLibraryConstructorList) are called // in the AutoGen before reaching the entry function body. // - // sub_3BC() performs the UefiBootServicesTableLib, UefiRuntimeServicesTableLib, + // This constructor path performs the UefiBootServicesTableLib, UefiRuntimeServicesTableLib, // DxeServicesTableLib, and DxeMmPciBaseLib constructor initializations. // ProcessLibraryConstructorList (ImageHandle, SystemTable); @@ -2346,4 +2345,4 @@ // Call the real driver entry point // return SmbiosDriverEntryPoint (ImageHandle, SystemTable); -} \ No newline at end of file +} diff --git a/AmiCompatibilityPkg/Smbios/SmbiosBoard/SmbiosBoard/SmbiosBoard.c b/AmiCompatibilityPkg/Smbios/SmbiosBoard/SmbiosBoard/SmbiosBoard.c index 78c2527..40fab3c 100644 --- a/AmiCompatibilityPkg/Smbios/SmbiosBoard/SmbiosBoard/SmbiosBoard.c +++ b/AmiCompatibilityPkg/Smbios/SmbiosBoard/SmbiosBoard/SmbiosBoard.c @@ -51,10 +51,10 @@ /// +0x00 BoardData[24] - Board type/revision byte sequence /// +0x18 Reserved - Padding/reserved /// +0x20 Callbacks[8] - Function dispatch table (all point to NullCallback) -/// +0x60 LocateMmPci - MmPciBase protocol locator (sub_734) -/// +0x68 UnsupportedHandler - Stub returning EFI_UNSUPPORTED (sub_77C) -/// +0x70 MmPciAccess - MMIO PCI config access (sub_788) -/// +0x78 DestructorDispatch - Destructor dispatch loop (sub_704) +/// +0x60 LocateMmPci - MmPciBase protocol locator +/// +0x68 UnsupportedHandler - Stub returning EFI_UNSUPPORTED +/// +0x70 MmPciAccess - MMIO PCI config access +/// +0x78 DestructorDispatch - Destructor dispatch loop /// +0x80 PcdSizeConstant - PCD size value (0xC0C) /// STATIC SMBIOS_BOARD_PROTOCOL mSmbiosBoardProtocol = { @@ -838,4 +838,4 @@ ) { _disable (); -} \ No newline at end of file +} diff --git a/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.c b/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.c index cc621ec..b4a9e9b 100644 --- a/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.c +++ b/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.c @@ -15,9 +15,9 @@ { signed __int64 v4; // rbx - sub_4EC(); - v4 = sub_880(ImageHandle, SystemTable); + SmbiosDmiEditInitialize(); + v4 = SmbiosDmiEditMain(ImageHandle, SystemTable); if ( v4 < 0 ) - sub_3468(); + SmbiosDmiEditShutdownOnFailure(); return v4; } diff --git a/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.h b/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.h index 325cf96..a5012c3 100644 --- a/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.h +++ b/AmiCompatibilityPkg/Smbios/SmbiosDmiEdit/SmbiosDmiEdit.h @@ -24,30 +24,30 @@ ); /// -/// sub_4EC +/// SmbiosDmiEditInitialize /// EFI_STATUS EFIAPI -sub_4EC( +SmbiosDmiEditInitialize( VOID ); /// -/// sub_880 +/// SmbiosDmiEditMain /// EFI_STATUS EFIAPI -sub_880( +SmbiosDmiEditMain( VOID ); /// -/// sub_3468 +/// SmbiosDmiEditShutdownOnFailure /// EFI_STATUS EFIAPI -sub_3468( +SmbiosDmiEditShutdownOnFailure( VOID ); -#endif /* __SMBIOSDMIEDIT_H__ */ \ No newline at end of file +#endif /* __SMBIOSDMIEDIT_H__ */ diff --git a/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.c b/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.c index df277c0..bd745cc 100644 --- a/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.c +++ b/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.c @@ -114,7 +114,7 @@ BootServices = SystemTable->BootServices; /*0x11d6*/ RuntimeServices_0 = (__int64)SystemTable->RuntimeServices; /*0x11dd*/ BootServices_0 = (__int64)BootServices; /*0x11f0*/ - ((void (__fastcall *)(__int64, __int64, __int64 (__fastcall *)()))BootServices->CreateEvent)(513, 8, sub_24E0); /*0x1202*/ + ((void (__fastcall *)(__int64, __int64, __int64 (__fastcall *)()))BootServices->CreateEvent)(513, 8, CryptoDxeNotifyEvent); /*0x1202*/ (*(void (__fastcall **)(__int64, __int64, __int64 (__fastcall *)(), _QWORD, __int64 *))(BootServices_0 + 80))( /*0x122a*/ 1610613250, 8, diff --git a/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.h b/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.h index e45484b..ba2d53c 100644 --- a/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.h +++ b/AmiCryptoPkg/CryptoLib/CryptLibInitRun/CryptoDXE.h @@ -9,214 +9,214 @@ * Auto-generated header */ -// Address: sub_87E0 -__int64 __fastcall sub_87E0(_DWORD *a1, __int64 a2); +// Address: 0x87E0 +__int64 __fastcall Sha1Transform(_DWORD *a1, __int64 a2); -// Address: sub_EC84 -unsigned __int64 __fastcall sub_EC84(unsigned __int64 a1, unsigned __int64 n0xF4240); +// Address: 0xEC84 +unsigned __int64 __fastcall FormatString(unsigned __int64 a1, unsigned __int64 n0xF4240); -// Address: sub_42D4 -__int64 __fastcall sub_42D4(__int64 a1, __int64 a2); +// Address: 0x42D4 +__int64 __fastcall SataGetInfo(__int64 a1, __int64 a2); -// Address: sub_DA1C -__int64 __fastcall sub_DA1C(_DWORD *a1, _DWORD *a2); +// Address: 0xDA1C +__int64 __fastcall Md5Transform(_DWORD *a1, _DWORD *a2); -// Address: sub_3044 -__int64 __fastcall sub_3044(__int64 *a1, __int64 a2, _DWORD *a3); +// Address: 0x3044 +__int64 __fastcall Pkcs7ParseSignerInfo(__int64 *a1, __int64 a2, _DWORD *a3); -// Address: sub_1668 -unsigned __int64 __fastcall sub_1668(int a1, __int64 a2, __int64 a3, __int64 a4); +// Address: 0x1668 +unsigned __int64 __fastcall CryptoDispatcher(int a1, __int64 a2, __int64 a3, __int64 a4); -// Address: sub_3CFC -__int64 __fastcall sub_3CFC(__int64 a1, unsigned __int64 n0x100, _QWORD *a3); +// Address: 0x3CFC +__int64 __fastcall Pkcs7ParseCertificate(__int64 a1, unsigned __int64 n0x100, _QWORD *a3); -// Address: sub_D0C0 -__int64 __fastcall sub_D0C0(__int64 a1, _DWORD *a2, __int64 a3, __int128 *a4); +// Address: 0xD0C0 +__int64 __fastcall BnMul(__int64 a1, _DWORD *a2, __int64 a3, __int128 *a4); -// Address: sub_BFE4 -__int64 __fastcall sub_BFE4(__int64 a1, _DWORD *a2, _DWORD *a3, __int128 *a4); +// Address: 0xBFE4 +__int64 __fastcall BnSqr(__int64 a1, _DWORD *a2, _DWORD *a3, __int128 *a4); -// Address: sub_BA8C -__int64 __fastcall sub_BA8C(_DWORD *a1, _DWORD *a2, __int128 *a3, __int128 *a4); +// Address: 0xBA8C +__int64 __fastcall BnModMul(_DWORD *a1, _DWORD *a2, __int128 *a3, __int128 *a4); -// Address: sub_4BF4 -__int64 sub_4BF4(_QWORD *a1, char a2, _QWORD *a3, _QWORD *a4, ...); +// Address: 0x4BF4 +__int64 TcgGetInfo(_QWORD *a1, char a2, _QWORD *a3, _QWORD *a4, ...); -// Address: sub_7F1C -__int64 __fastcall sub_7F1C(__int64 a1, __int64 a2, int a3, void *va_1, int a5, int a6); +// Address: 0x7F1C +__int64 __fastcall SataConfig(__int64 a1, __int64 a2, int a3, void *va_1, int a5, int a6); -// Address: sub_77AC -__int64 __fastcall sub_77AC(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); +// Address: 0x77AC +__int64 __fastcall SataConfig_0(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); -// Address: sub_6AB0 -__int64 __fastcall sub_6AB0(__int64 a1, __int64 a2, __int64 a3, _QWORD *a4); +// Address: 0x6AB0 +__int64 __fastcall SataConfig_1(__int64 a1, __int64 a2, __int64 a3, _QWORD *a4); -// Address: sub_57A8 -__int64 __fastcall sub_57A8(_QWORD *a1, __int64 a2, unsigned int *a3, void *va_2); +// Address: 0x57A8 +__int64 __fastcall SataConfig_2(_QWORD *a1, __int64 a2, unsigned int *a3, void *va_2); -// Address: sub_9CA4 -__int64 __fastcall sub_9CA4(__int64 a1, unsigned int a2, _BYTE *a3, int a4, unsigned int a5, unsigned int a6); +// Address: 0x9CA4 +__int64 __fastcall RsaPssVerify(__int64 a1, unsigned int a2, _BYTE *a3, int a4, unsigned int a5, unsigned int a6); -// Address: sub_2D5C -__int64 __fastcall sub_2D5C(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); +// Address: 0x2D5C +__int64 __fastcall Pkcs7ParseDigestAlgorithmId(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); -// Address: sub_5370 -__int64 __fastcall sub_5370(__int64 a1, __int64 a2, __int64 a3, __int64 a4); +// Address: 0x5370 +__int64 __fastcall SataConfig_3(__int64 a1, __int64 a2, __int64 a3, __int64 a4); -// Address: sub_5F10 -__int64 __fastcall sub_5F10(__int64 n3, __int64 *a2, __int64 a3, __int64 a4); +// Address: 0x5F10 +__int64 __fastcall GetInfo(__int64 n3, __int64 *a2, __int64 a3, __int64 a4); -// Address: sub_3AB0 -__int64 __fastcall sub_3AB0(__int64 a1, __int64 a2, __int64 a3); +// Address: 0x3AB0 +__int64 __fastcall Pkcs7ParseAttributeTypeValue(__int64 a1, __int64 a2, __int64 a3); -// Address: sub_112C -__int64 __fastcall sub_112C(__int64 a1, __int64 a2); +// Address: 0x112C +__int64 __fastcall CryptoDxeEntryInit(__int64 a1, __int64 a2); -// Address: sub_8424 -__int64 __fastcall sub_8424(_QWORD *a1, _DWORD *a2, _DWORD *a3); +// Address: 0x8424 +__int64 __fastcall TcgConfig(_QWORD *a1, _DWORD *a2, _DWORD *a3); -// Address: sub_9FA4 -__int64 __fastcall sub_9FA4(__int64 a1, __int64 a2); +// Address: 0x9FA4 +__int64 __fastcall Sha512Transform(__int64 a1, __int64 a2); -// Address: sub_37B0 -__int64 __fastcall sub_37B0(__int64 a1, unsigned __int64 n0x100, __int64 a3); +// Address: 0x37B0 +__int64 __fastcall SataConfig_4(__int64 a1, unsigned __int64 n0x100, __int64 a3); -// Address: sub_700C -__int64 __fastcall sub_700C(__int64 a1, __int64 n13, unsigned int n16, _DWORD *a4); +// Address: 0x700C +__int64 __fastcall X509ParseTime(__int64 a1, __int64 n13, unsigned int n16, _DWORD *a4); -// Address: sub_647C -__int64 __fastcall sub_647C(unsigned __int8 *a1, int a2, __int64 a3, unsigned __int64 *a4, __int64 a5); +// Address: 0x647C +__int64 __fastcall GetInfo_0(unsigned __int8 *a1, int a2, __int64 a3, unsigned __int64 *a4, __int64 a5); -// Address: sub_1D14 -unsigned __int64 __fastcall sub_1D14(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 *a4, __int64 n0x1B, char a6); +// Address: 0x1D14 +unsigned __int64 __fastcall CryptoSignatureVerifier(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 *a4, __int64 n0x1B, char a6); -// Address: sub_75A8 -__int64 __fastcall sub_75A8(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); +// Address: 0x75A8 +__int64 __fastcall SataConfig_5(__int64 a1, __int64 a2, __int64 a3, unsigned __int8 **a4); -// Address: sub_618C -__int64 __fastcall sub_618C(__int64 a1, __int64 a2); +// Address: 0x618C +__int64 __fastcall Sha256Transform(__int64 a1, __int64 a2); -// Address: sub_A818 -__int64 __fastcall sub_A818(int n50, int a2, int a3); +// Address: 0xA818 +__int64 __fastcall DateTimeToEpoch(int n50, int a2, int a3); -// Address: sub_20C4 -__int64 __fastcall sub_20C4(__int64 a1, __int64 a2, __int64 a3); +// Address: 0x20C4 +__int64 __fastcall HashVerify(__int64 a1, __int64 a2, __int64 a3); -// Address: sub_CD98 -__int64 __fastcall sub_CD98(int *a1, int *a2, int a3); +// Address: 0xCD98 +__int64 __fastcall BnLshift(int *a1, int *a2, int a3); -// Address: sub_7C90 -_QWORD *__fastcall sub_7C90(__int64 a1, __int64 a2); +// Address: 0x7C90 +_QWORD *__fastcall SataConfig_6(__int64 a1, __int64 a2); -// Address: sub_E310 -__int64 __fastcall sub_E310(unsigned __int8 *a1, __int64 a2, __int64 a3); +// Address: 0xE310 +__int64 __fastcall SataConfig_7(unsigned __int8 *a1, __int64 a2, __int64 a3); -// Address: sub_2750 -__int64 __fastcall sub_2750(char *a1, __int64 a2, double a3); +// Address: 0x2750 +__int64 __fastcall BnBin2Bn(char *a1, __int64 a2, double a3); -// Address: sub_B478 -__int64 __fastcall sub_B478(__int64 a1, int n28, __int64 a3, __int128 *a4); +// Address: 0xB478 +__int64 __fastcall BnRshiftBits(__int64 a1, int n28, __int64 a3, __int128 *a4); -// Address: sub_5618 -__int64 __fastcall sub_5618(__int64 a1, __int64 a2, __int64 a3, unsigned __int64 n8_1); +// Address: 0x5618 +__int64 __fastcall SataConfig_8(__int64 a1, __int64 a2, __int64 a3, unsigned __int64 n8_1); -// Address: sub_C5FC -__int64 __fastcall sub_C5FC(unsigned int *a1, unsigned int *a2, __int64 a3); +// Address: 0xC5FC +__int64 __fastcall BnModExp(unsigned int *a1, unsigned int *a2, __int64 a3); -// Address: sub_D658 -__int64 __fastcall sub_D658(_DWORD *a1, int *a2); +// Address: 0xD658 +__int64 __fastcall BnSqrWords(_DWORD *a1, int *a2); -// Address: sub_5D94 -__int64 __fastcall sub_5D94(__int64 a1, char a2, _QWORD *a3, _QWORD *a4); +// Address: 0x5D94 +__int64 __fastcall GetInfo_1(__int64 a1, char a2, _QWORD *a3, _QWORD *a4); -// Address: sub_8664 -__int64 __fastcall sub_8664(__int64 n3, _QWORD *a2, __int64 a3, _BYTE *a4); +// Address: 0x8664 +__int64 __fastcall GetInfo_2(__int64 n3, _QWORD *a2, __int64 a3, _BYTE *a4); -// Address: sub_CAEC -__int64 __fastcall sub_CAEC(int *a1, __int128 *a2); +// Address: 0xCAEC +__int64 __fastcall BnSqrWords_simple(int *a1, __int128 *a2); -// Address: sub_7378 -__int64 __fastcall sub_7378(_DWORD *a1, unsigned __int8 *a2, __int64 a3); +// Address: 0x7378 +__int64 __fastcall X509ParseBasicConstraints(_DWORD *a1, unsigned __int8 *a2, __int64 a3); -// Address: sub_C8F8 -__int64 __fastcall sub_C8F8(int *a1, __int64 a2, __int64 a3, int a4); +// Address: 0xC8F8 +__int64 __fastcall GetInfo_3(int *a1, __int64 a2, __int64 a3, int a4); -// Address: sub_6E9C -__int64 __fastcall sub_6E9C(__int64 a1, _BYTE *a2, __int64 a3, double a4); +// Address: 0x6E9C +__int64 __fastcall X509FormatDn(__int64 a1, _BYTE *a2, __int64 a3, double a4); -// Address: sub_5AC0 -__int64 __fastcall sub_5AC0(__int64 a1, _DWORD *a2); +// Address: 0x5AC0 +__int64 __fastcall Pkcs7ValidateTimestamp(__int64 a1, _DWORD *a2); -// Address: sub_C78C -__int64 __fastcall sub_C78C(int *a1, __int64 a2, __int64 a3, int n512); +// Address: 0xC78C +__int64 __fastcall BnMulSimple(int *a1, __int64 a2, __int64 a3, int n512); -// Address: sub_7228 -__int64 __fastcall sub_7228(unsigned __int8 *a1, __int64 a2, __int64 a3, _QWORD *a4); +// Address: 0x7228 +__int64 __fastcall X509ParseValidity(unsigned __int8 *a1, __int64 a2, __int64 a3, _QWORD *a4); -// Address: sub_D8CC -__int64 __fastcall sub_D8CC(__int64 a1, __int64 *a2, unsigned int *a3, __int64 a4); +// Address: 0xD8CC +__int64 __fastcall GetInfo_4(__int64 a1, __int64 *a2, unsigned int *a3, __int64 a4); -// Address: sub_2A00 -__int64 __fastcall sub_2A00(__int64 a1, unsigned __int8 *a2, void *va, _BYTE *a4, void **p_va); +// Address: 0x2A00 +__int64 __fastcall Pkcs1VerifyPadding(__int64 a1, unsigned __int8 *a2, void *va, _BYTE *a4, void **p_va); -// Address: sub_CF78 -__int64 __fastcall sub_CF78(int *a1, int *a2); +// Address: 0xCF78 +__int64 __fastcall BnModHalf(int *a1, int *a2); -// Address: sub_9B68 -__int64 __fastcall sub_9B68(__int64 a1, unsigned int a2, _BYTE *a3, int a4); +// Address: 0x9B68 +__int64 __fastcall MGF1Generate(__int64 a1, unsigned int a2, _BYTE *a3, int a4); -// Address: sub_CC64 -__int64 __fastcall sub_CC64(int *a1, __int64 a2, __int128 *a3, int n0x8000000); +// Address: 0xCC64 +__int64 __fastcall BnMulAdd(int *a1, __int64 a2, __int128 *a3, int n0x8000000); -// Address: sub_1534 -unsigned __int64 __fastcall sub_1534(__int64 a1, __int64 a2, __int64 n3, __int64 *a4, __int64 *p_n256, _BYTE *a6); +// Address: 0x1534 +unsigned __int64 __fastcall CryptoAlgorithmSelector(__int64 a1, __int64 a2, __int64 n3, __int64 *a4, __int64 *p_n256, _BYTE *a6); -// Address: sub_6980 -__int64 __fastcall sub_6980(unsigned __int8 *a1, __int64 a2, __int64 a3, unsigned __int8 **a4); +// Address: 0x6980 +__int64 __fastcall X509ParseSubjectPublicKeyInfo(unsigned __int8 *a1, __int64 a2, __int64 a3, unsigned __int8 **a4); -// Address: sub_ABAC -_UNKNOWN **__fastcall sub_ABAC(__int64 a1, __int64 a2, unsigned __int8 *a3, unsigned __int64 n0x20_1); +// Address: 0xABAC +_UNKNOWN **__fastcall DebugHexdumpAscii(__int64 a1, __int64 a2, unsigned __int8 *a3, unsigned __int64 n0x20_1); -// Address: sub_A2C8 -__int64 __fastcall sub_A2C8(__int64 a1, __int64 a2); +// Address: 0xA2C8 +__int64 __fastcall Sha512Final(__int64 a1, __int64 a2); -// Address: sub_9A48 -__int64 __fastcall sub_9A48(__int64 n3, _QWORD *a2, char *p_n256, __int64 a4); +// Address: 0x9A48 +__int64 __fastcall Sha384(__int64 n3, _QWORD *a2, char *p_n256, __int64 a4); -// Address: sub_E5EC -__int64 __fastcall sub_E5EC(__int64 a1, unsigned __int64 n2, double a3); +// Address: 0xE5EC +__int64 __fastcall BitStringToInt(__int64 a1, unsigned __int64 n2, double a3); -// Address: sub_ADE4 -__int64 __fastcall sub_ADE4(int *a1, int *a2, int *a3); +// Address: 0xADE4 +__int64 __fastcall BnAdd(int *a1, int *a2, int *a3); -// Address: sub_A4DC -unsigned __int64 __fastcall sub_A4DC(unsigned __int64 a1); +// Address: 0xA4DC +unsigned __int64 __fastcall MmgrAlloc(unsigned __int64 a1); -// Address: sub_A5E4 -unsigned __int64 __fastcall sub_A5E4(__int64 a1); +// Address: 0xA5E4 +unsigned __int64 __fastcall GetInfo_7(__int64 a1); -// Address: sub_A678 -__int64 sub_A678(); +// Address: 0xA678 +__int64 GetInfo_5(); -// Address: sub_A784 -__int64 __fastcall sub_A784(_QWORD *a1, __int64 _nASSERT_EFI_ERROR_(Status___%r)_n); +// Address: 0xA784 +__int64 __fastcall Assert(_QWORD *a1, __int64 _nASSERT_EFI_ERROR_(Status___%r)_n); -// Address: sub_A1D8 -__int64 __fastcall sub_A1D8(__int64 a1, __int64 a2, unsigned int n0x80_1); +// Address: 0xA1D8 +__int64 __fastcall Sha512Update(__int64 a1, __int64 a2, unsigned int n0x80_1); -// Address: sub_A3EC -__int64 __fastcall sub_A3EC(__int64 n3, __int64 *a2, char *p_n256, __int64 a4); +// Address: 0xA3EC +__int64 __fastcall Sha512(__int64 n3, __int64 *a2, char *p_n256, __int64 a4); -// Address: sub_AA00 -__int64 __fastcall sub_AA00(_DWORD *va); +// Address: 0xAA00 +__int64 __fastcall EpochTimeGet(_DWORD *va); -// Address: sub_AA74 -_UNKNOWN **sub_AA74(int n5, char *a2, ...); +// Address: 0xAA74 +_UNKNOWN **DebugLogPrint(int n5, char *a2, ...); -// Address: sub_AAE8 -_UNKNOWN **__fastcall sub_AAE8(__int64 a1, __int64 a2, __int64 a3, unsigned __int64 n16_2); +// Address: 0xAAE8 +_UNKNOWN **__fastcall DebugHexdumpFlat(__int64 a1, __int64 a2, __int64 a3, unsigned __int64 n16_2); -// Address: sub_B07C -unsigned __int64 __fastcall sub_B07C(__int64 a1); +// Address: 0xB07C +unsigned __int64 __fastcall BnFreeWords(__int64 a1); #endif /* __CRYPTODXE_H__ */ diff --git a/AmiCryptoPkg/CryptoSMM/CryptoSMM.c b/AmiCryptoPkg/CryptoSMM/CryptoSMM.c index cabc490..7a4f1e8 100644 --- a/AmiCryptoPkg/CryptoSMM/CryptoSMM.c +++ b/AmiCryptoPkg/CryptoSMM/CryptoSMM.c @@ -19,22 +19,22 @@ __int64 v4; // rax EFI_STATUS v5; // rbx - sub_584(ImageHandle); + InitializeCryptoContext(ImageHandle); qword_14598 = 0x8000000000000001uLL; - if ( !sub_2C0(&unk_144A0) ) + if ( !InitializeCryptoSmmLock(&unk_144A0) ) { - v4 = sub_15FC(v3, SystemTable); + v4 = InstallCryptoProtocol(v3, SystemTable); if ( v4 >= 0 || qword_14598 < 0 ) qword_14598 = v4; - sub_1780(&unk_144A0); - sub_360(&unk_144A0, -1); - sub_18E4( + CryptoServiceCleanup(&unk_144A0); + FinalizeCryptoSmmLock(&unk_144A0, -1); + DebugAssertLine( "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\AmiCryptoPkg\\CryptoProtocols\\CryptoSMM\\DEBUG\\AutoGen.c", 273, "((BOOLEAN)(0==1))"); - sub_18E4( + DebugAssertLine( "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\AmiCryptoPkg\\CryptoProtocols\\CryptoSMM\\DEBUG\\AutoGen.c", 288, "((BOOLEAN)(0==1))"); @@ -42,6 +42,6 @@ v5 = qword_14598; if ( qword_14598 < 0 ) - sub_1998(); + CryptoSmmDestructor(); return v5; } diff --git a/AmiCryptoPkg/CryptoSMM/CryptoSMM.h b/AmiCryptoPkg/CryptoSMM/CryptoSMM.h index 20cdbb3..ffe12b3 100644 --- a/AmiCryptoPkg/CryptoSMM/CryptoSMM.h +++ b/AmiCryptoPkg/CryptoSMM/CryptoSMM.h @@ -26,66 +26,66 @@ ); /// -/// sub_584 +/// InitializeCryptoContext /// EFI_STATUS EFIAPI -sub_584( +InitializeCryptoContext( VOID ); /// -/// sub_15FC +/// InstallCryptoProtocol /// EFI_STATUS EFIAPI -sub_15FC( +InstallCryptoProtocol( VOID ); /// -/// sub_1780 +/// CryptoServiceCleanup /// EFI_STATUS EFIAPI -sub_1780( +CryptoServiceCleanup( VOID ); /// -/// sub_360 +/// FinalizeCryptoSmmLock /// EFI_STATUS EFIAPI -sub_360( +FinalizeCryptoSmmLock( VOID ); /// -/// sub_18E4 +/// DebugAssertLine /// EFI_STATUS EFIAPI -sub_18E4( +DebugAssertLine( VOID ); /// -/// sub_2C0 +/// InitializeCryptoSmmLock /// EFI_STATUS EFIAPI -sub_2C0( +InitializeCryptoSmmLock( VOID ); /// -/// sub_1998 +/// CryptoSmmDestructor /// EFI_STATUS EFIAPI -sub_1998( +CryptoSmmDestructor( VOID ); -#endif /* __CRYPTOSMM_H__ */ \ No newline at end of file +#endif /* __CRYPTOSMM_H__ */ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrCopyS.c b/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrCopyS.c index 9013239..2949039 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrCopyS.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrCopyS.c @@ -9,13 +9,13 @@ if ( !Length ) /*0x8f8*/ return Destination; /*0x8fa*/ if ( !Destination ) /*0x915*/ - sub_788("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1033, "Destination != ((void *) 0)"); /*0x926*/ - if ( Destination_1 - Source <= (unsigned __int64)sub_9F0(Source) ) /*0x945*/ - sub_788("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1038, "(UINTN)(Destination - Source) > AsciiStrLen (Source)"); /*0x956*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1033, "Destination != ((void *) 0)"); /*0x926*/ + if ( Destination_1 - Source <= (unsigned __int64)AsciiStrLen(Source) ) /*0x945*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1038, "(UINTN)(Destination - Source) > AsciiStrLen (Source)"); /*0x956*/ if ( Source - Destination_1 < Length_1 ) /*0x96d*/ - sub_788("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1039, "(UINTN)(Source - Destination) >= Length"); /*0x97e*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1039, "(UINTN)(Source - Destination) >= Length"); /*0x97e*/ if ( Length_1 > 0xF4240 ) /*0x999*/ - sub_788( /*0x9aa*/ + DebugAssert( /*0x9aa*/ "e:\\hs\\MdePkg\\Library\\BaseLib\\String.c", 1042, "Length <= _gPcd_FixedAtBuild_PcdMaximumAsciiStringLength"); diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrHexToUint64.c b/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrHexToUint64.c index 9589e09..859b517 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrHexToUint64.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/AsciiStrHexToUint64.c @@ -18,20 +18,20 @@ v2 = a1; /*0xabe*/ if ( !a1 ) /*0xac8*/ { - sub_788("e:\\hs\\MdePkg\\Library\\BaseLib\\SafeString.c", 2561, "(String != ((void *) 0))"); /*0xadd*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BaseLib\\SafeString.c", 2561, "(String != ((void *) 0))"); /*0xadd*/ return v14; /*0xbc0*/ } - v3 = sub_D0C(a1, 1000001); /*0xb08*/ + v3 = AsciiStrnLenS(a1, 1000001); /*0xb08*/ if ( v3 > v4 ) /*0xb10*/ { - sub_788( /*0xb25*/ + DebugAssert( /*0xb25*/ "e:\\hs\\MdePkg\\Library\\BaseLib\\SafeString.c", 2568, "(AsciiStrnLenS (String, (_gPcd_FixedAtBuild_PcdMaximumAsciiStringLength) + 1) <= (_gPcd_FixedAtBuild_PcdMaximumAsc" "iiStringLength))"); LODWORD(v4) = 1000000; /*0xb2a*/ } - v5 = sub_D0C(v2, (int)v4 + 1); /*0xb38*/ + v5 = AsciiStrnLenS(v2, (int)v4 + 1); /*0xb38*/ v9 = v8; /*0xb3d*/ if ( v5 > v8 ) /*0xb43*/ return v14; /*0xb43*/ @@ -53,7 +53,7 @@ while ( (unsigned __int8)(*v2 - v7) <= 9u || (unsigned __int8)(*v2 - 65) <= 5u || (unsigned __int8)(*v2 - 97) <= 5u ) /*0xb97*/ { LOBYTE(v9) = *v2; /*0xb99*/ - v12 = sub_A7C(v9, v6, v7, v11); /*0xb9b*/ + v12 = HexCharToValue(v9, v6, v7, v11); /*0xb9b*/ v9 = (unsigned __int64)(v11 - v12) >> 4; /*0xba6*/ if ( v1 > v9 ) /*0xbad*/ return v11; /*0xbbe*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/BasePrintLibInternalFormat.c b/LenovoServerPkg/SystemInventory/SystemInventory/BasePrintLibInternalFormat.c index 37cc1b6..3289c5d 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/BasePrintLibInternalFormat.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/BasePrintLibInternalFormat.c @@ -116,7 +116,7 @@ v9 = a3 & 0x2000; /*0xe57*/ if ( (a3 & 0x2000) == 0 && !a1 ) /*0xe6b*/ { - sub_788("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 578, "(Buffer != ((void *) 0))"); /*0xe7c*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 578, "(Buffer != ((void *) 0))"); /*0xe7c*/ if ( !v8 ) /*0xe84*/ return 0; /*0xe84*/ } @@ -129,7 +129,7 @@ } if ( !v5 ) /*0xea1*/ { - sub_788("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 586, "(Format != ((void *) 0))"); /*0xeb2*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 586, "(Format != ((void *) 0))"); /*0xeb2*/ return 0; /*0xe88*/ } LABEL_9: @@ -137,7 +137,7 @@ { if ( n0xF4240 > 0xF4240 ) /*0xed8*/ { - sub_788( /*0xee9*/ + DebugAssert( /*0xee9*/ "e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 595, "(BufferSize <= (_gPcd_FixedAtBuild_PcdMaximumUnicodeStringLength))"); @@ -149,7 +149,7 @@ { if ( n0xF4240 > 0xF4240 ) /*0xf23*/ { - sub_788( /*0xf34*/ + DebugAssert( /*0xf34*/ "e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 600, "(BufferSize <= (_gPcd_FixedAtBuild_PcdMaximumAsciiStringLength))"); @@ -160,7 +160,7 @@ if ( (v6 & 0x100) != 0 ) /*0xf5e*/ { if ( (unsigned __int64)sub_C9C(v5, 1000001, a3, 1000000) > 0xF4240 ) /*0xf80*/ - sub_788( /*0xf91*/ + DebugAssert( /*0xf91*/ "e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 611, "(StrnLenS ((CHAR16 *)Format, (_gPcd_FixedAtBuild_PcdMaximumUnicodeStringLength) + 1) <= (_gPcd_FixedAtBuild_PcdM" @@ -172,17 +172,17 @@ } else { - n1000000_2 = sub_D0C(v5, 1000001); /*0xfdb*/ + n1000000_2 = AsciiStrnLenS(v5, 1000001); /*0xfdb*/ if ( n1000000_2 > n1000000_1 ) /*0xfe6*/ { - sub_788( /*0xff7*/ + DebugAssert( /*0xff7*/ "e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 617, "(AsciiStrnLenS (Format, (_gPcd_FixedAtBuild_PcdMaximumAsciiStringLength) + 1) <= (_gPcd_FixedAtBuild_PcdMaximumA" "sciiStringLength))"); n1000000_1 = 1000000; /*0xffc*/ } - v16 = sub_D0C(v5, n1000000_1 + 1); /*0x100a*/ + v16 = AsciiStrnLenS(v5, n1000000_1 + 1); /*0x100a*/ if ( v16 > v17 ) /*0x1015*/ return 0; /*0x1015*/ n2_1 = 1; /*0x101b*/ @@ -837,7 +837,7 @@ if ( (v6 & 0x2000) != 0 ) /*0x1c49*/ return v19 / n2; /*0x1c53*/ if ( !v8 ) /*0x1c64*/ - sub_788("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 1216, "Buffer != ((void *) 0)"); /*0x1c79*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\BasePrintLib\\PrintLibInternal.c", 1216, "Buffer != ((void *) 0)"); /*0x1c79*/ v85 = (_BYTE *)v8; /*0x1c81*/ for ( ii = 0; ii < 1; ++ii ) /*0x1c84*/ { diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/CheckDeviceVpd.c b/LenovoServerPkg/SystemInventory/SystemInventory/CheckDeviceVpd.c index aad6c5b..5941b50 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/CheckDeviceVpd.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/CheckDeviceVpd.c @@ -111,27 +111,27 @@ v22 = 0; /*0x3063*/ while ( 1 ) { - v25 = sub_5A7C((unsigned int)&n145, v22, 4, v46, v14); /*0x308a*/ + v25 = PciConfigReadVpd((unsigned int)&n145, v22, 4, v46, v14); /*0x308a*/ if ( v25 < 0 ) { if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) - sub_740(64, "CheckDeviceVpd: Error reading PciVpd - code = %r\n", v25); + DebugPrint(64, "CheckDeviceVpd: Error reading PciVpd - code = %r\n", v25); return v45; /*0x343a*/ } LOBYTE(v24) = n145; /*0x3096*/ switch ( n145 ) { case 0x78u: - if ( (unsigned __int8)sub_7F8(v24, v23, v26, v27) && (unsigned __int8)sub_804(64) ) - sub_740(64, "CheckDeviceVpd: Normal end tag found\n"); + if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "CheckDeviceVpd: Normal end tag found\n"); return v45; /*0x3416*/ case 0xFF: - if ( (unsigned __int8)sub_7F8(v24, v23, v26, v27) && (unsigned __int8)sub_804(64) ) - sub_740(64, "CheckDeviceVpd: Bad ID 0xff found. Done.\n"); + if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "CheckDeviceVpd: Bad ID 0xff found. Done.\n"); return v45; /*0x33f0*/ case 0u: - if ( (unsigned __int8)sub_7F8(v24, v23, v26, v27) && (unsigned __int8)sub_804(64) ) - sub_740(64, "CheckDeviceVpd: Bad ID 0x00 found. Done.\n"); + if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "CheckDeviceVpd: Bad ID 0x00 found. Done.\n"); return v45; /*0x33d2*/ } n4_3 = n4; /*0x30b7*/ @@ -139,7 +139,7 @@ break; /*0x30bf*/ if ( n4 < 4u ) { - if ( (unsigned __int8)sub_7F8(v24, v23, v26, v27) && (unsigned __int8)sub_804(64) ) + if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) { n2_1 = n4_3; /*0x3378*/ LABEL_72: @@ -179,14 +179,14 @@ p_n145_2 = p_n145; /*0x31c8*/ if ( !p_n145 ) { - if ( (unsigned __int8)sub_7F8(v40, v39, v41, v42) && (unsigned __int8)sub_804(64) ) - sub_740(64, "CheckDeviceVpd: Unable to allocate memory for resource Done.\n"); + if ( (unsigned __int8)DebugTraceEnabled(v40, v39, v41, v42) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "CheckDeviceVpd: Unable to allocate memory for resource Done.\n"); goto LABEL_63; /*0x31fc*/ } - if ( sub_5A7C(p_n145, v33, n4_1, v46, v14) >= 0 ) + if ( PciConfigReadVpd(p_n145, v33, n4_1, v46, v14) >= 0 ) { - if ( (unsigned __int8)sub_7F8(v35, v23, v26, v27) && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckDeviceVpd: type 0x90/91 - %a\n", p_n145_2); + if ( (unsigned __int8)DebugTraceEnabled(v35, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckDeviceVpd: type 0x90/91 - %a\n", p_n145_2); goto LABEL_60; /*0x324c*/ } } @@ -202,10 +202,10 @@ p_n145_2 = p_n145_1; /*0x3268*/ if ( p_n145_1 ) { - if ( sub_5A7C(p_n145_1, v33, n4_1, v46, v14) >= 0 ) + if ( PciConfigReadVpd(p_n145_1, v33, n4_1, v46, v14) >= 0 ) { - if ( (unsigned __int8)sub_7F8(v35, v23, v26, v27) && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckDeviceVpd: type 0x82 - %a\n", p_n145_2); + if ( (unsigned __int8)DebugTraceEnabled(v35, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckDeviceVpd: type 0x82 - %a\n", p_n145_2); LABEL_60: (*(void (__fastcall **)(__int64, __int64, __int64))(qword_96D8 + 352))(a3, p_n145_2, n4_2 + 1); /*0x32c2*/ v45 = 0; /*0x32e9*/ @@ -214,8 +214,8 @@ goto LABEL_61; /*0x32ee*/ } LABEL_63: - if ( (unsigned __int8)sub_7F8(v35, v23, v26, v27) && (unsigned __int8)sub_804(64) ) - sub_740(64, "CheckDeviceVpd: Done Processing VPD Section\n"); + if ( (unsigned __int8)DebugTraceEnabled(v35, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "CheckDeviceVpd: Done Processing VPD Section\n"); v22 = v31 + v50; /*0x332b*/ v50 += v31; /*0x332f*/ if ( !v31 || v45 != 0x8000000000000003uLL ) /*0x3350*/ @@ -229,7 +229,7 @@ v31 = n2 + 1; /*0x30f4*/ goto LABEL_32; /*0x30f4*/ } - if ( (unsigned __int8)sub_7F8(v24, v23, v26, v27) && (unsigned __int8)sub_804(64) ) /*0x33a0*/ + if ( (unsigned __int8)DebugTraceEnabled(v24, v23, v26, v27) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x33a0*/ { n2_1 = n2; /*0x33ad*/ goto LABEL_72; /*0x33b0*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/CheckVpdAndUpdateToBmc.c b/LenovoServerPkg/SystemInventory/SystemInventory/CheckVpdAndUpdateToBmc.c index 35e1d79..19fe948 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/CheckVpdAndUpdateToBmc.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/CheckVpdAndUpdateToBmc.c @@ -107,25 +107,25 @@ (*(void (__fastcall **)(_BYTE *, __int64, _QWORD))(qword_96D8 + 360))(v58, 0x10000, 0); /*0x3728*/ LOBYTE(v16) = -126; /*0x3733*/ n0xFF_1 = 0; /*0x3743*/ - if ( sub_2EA4(v50, v16, v58, v45) >= 0 ) + if ( CheckDeviceVpd(v50, v16, v58, v45) >= 0 ) { - v18 = sub_7F8(); /*0x374e*/ + v18 = DebugTraceEnabled(); /*0x374e*/ n0xFF = v45[0]; /*0x3753*/ - if ( v18 && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckVpdAndUpdateToBmc: RDBG VPD type 0x82 , Data Length = %x\n", n0xFF); + if ( v18 && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckVpdAndUpdateToBmc: RDBG VPD type 0x82 , Data Length = %x\n", n0xFF); if ( n0xFF ) /*0x3783*/ { do /*0x37be*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3795*/ - sub_740(0x80000000LL, "%x ", (unsigned __int8)v58[n0xFF_1]); /*0x37b1*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3795*/ + DebugPrint(0x80000000LL, "%x ", (unsigned __int8)v58[n0xFF_1]); /*0x37b1*/ ++n0xFF_1; /*0x37b6*/ } while ( n0xFF_1 < n0xFF ); /*0x37be*/ v8 = a4; /*0x37c0*/ } - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x37d3*/ - sub_740(0x80000000LL, "\n"); /*0x37e6*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x37d3*/ + DebugPrint(0x80000000LL, "\n"); /*0x37e6*/ v20 = (_BYTE *)AllocatePool((unsigned __int8)(n0xFF + 5)); /*0x37f7*/ n0xFF_2 = n0xFF; /*0x37fa*/ *v20 = 11; /*0x3806*/ @@ -153,30 +153,30 @@ } (*(void (__fastcall **)(_BYTE *, __int64, _QWORD))(qword_96D8 + 360))(v58, 0x10000, 0); /*0x3895*/ LOBYTE(v24) = -112; /*0x38a0*/ - i_1 = sub_2EA4(v50, v24, v58, v45); /*0x38ab*/ + i_1 = CheckDeviceVpd(v50, v24, v58, v45); /*0x38ab*/ if ( i_1 >= 0 ) { - v25 = sub_7F8(); /*0x38b9*/ + v25 = DebugTraceEnabled(); /*0x38b9*/ n0xFF_3 = v45[0]; /*0x38be*/ - if ( v25 && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckVpdAndUpdateToBmc: RDBG VPD type 0x90/0x91 , Data Length = %x\n", n0xFF_3); + if ( v25 && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckVpdAndUpdateToBmc: RDBG VPD type 0x90/0x91 , Data Length = %x\n", n0xFF_3); if ( n0xFF_3 ) /*0x38f3*/ { do /*0x392d*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3905*/ - sub_740(0x80000000LL, "%x ", (unsigned __int8)v58[n0xFF_1]); /*0x3921*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3905*/ + DebugPrint(0x80000000LL, "%x ", (unsigned __int8)v58[n0xFF_1]); /*0x3921*/ ++n0xFF_1; /*0x3926*/ } while ( n0xFF_1 < n0xFF_3 ); /*0x392d*/ v8 = a4; /*0x392f*/ } - i_1 = sub_7F8(); /*0x3936*/ + i_1 = DebugTraceEnabled(); /*0x3936*/ if ( (_BYTE)i_1 ) /*0x393f*/ { - i_1 = sub_804(0x80000000LL); /*0x3944*/ + i_1 = DebugLevelEnabled(0x80000000LL); /*0x3944*/ if ( (_BYTE)i_1 ) /*0x394b*/ - i_1 = sub_740(0x80000000LL, "\n"); /*0x3957*/ + i_1 = DebugPrint(0x80000000LL, "\n"); /*0x3957*/ } i_7 = 0; /*0x3960*/ i_2 = n0xFF_3 - 1; /*0x3963*/ @@ -202,21 +202,21 @@ &v58[i_8 + 3], (unsigned __int8)v58[v31]); v33 = 0; /*0x39fb*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckVpdAndUpdateToBmc: RDBG VPD PN Size = %x, IpmiVpdData= %a , \n", v30, v4); + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckVpdAndUpdateToBmc: RDBG VPD PN Size = %x, IpmiVpdData= %a , \n", v30, v4); if ( v30 ) /*0x3a2d*/ { do /*0x3a66*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3a3f*/ - sub_740(0x80000000LL, "%x ", *(unsigned __int8 *)(v33 + v32)); /*0x3a5a*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3a3f*/ + DebugPrint(0x80000000LL, "%x ", *(unsigned __int8 *)(v33 + v32)); /*0x3a5a*/ ++v33; /*0x3a5f*/ } while ( v33 < v30 ); /*0x3a66*/ i_2 = i_6; /*0x3a68*/ } - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3a7b*/ - sub_740(0x80000000LL, "\n"); /*0x3a8e*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3a7b*/ + DebugPrint(0x80000000LL, "\n"); /*0x3a8e*/ LOBYTE(v35) = 87; /*0x3a98*/ byte_9699 = 1; /*0x3a9b*/ LOBYTE(v34) = 46; /*0x3aab*/ @@ -255,21 +255,21 @@ &v58[i_3 + 3], (unsigned __int8)v58[v39]); v41 = 0; /*0x3b7b*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(2) ) - sub_740(2, "CheckVpdAndUpdateToBmc: RDBG VPD SN Size = %x, IpmiVpdData= %a , \n", v38, v4); + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(2) ) + DebugPrint(2, "CheckVpdAndUpdateToBmc: RDBG VPD SN Size = %x, IpmiVpdData= %a , \n", v38, v4); if ( v38 ) /*0x3bb1*/ { do /*0x3bee*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3bc6*/ - sub_740(0x80000000LL, "%x ", *(unsigned __int8 *)(v41 + v40)); /*0x3be1*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3bc6*/ + DebugPrint(0x80000000LL, "%x ", *(unsigned __int8 *)(v41 + v40)); /*0x3be1*/ ++v41; /*0x3be6*/ } while ( v41 < v38 ); /*0x3bee*/ v8 = a4; /*0x3bf5*/ } - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x3c0a*/ - sub_740(0x80000000LL, "\n"); /*0x3c1d*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x3c0a*/ + DebugPrint(0x80000000LL, "\n"); /*0x3c1d*/ LOBYTE(v43) = 87; /*0x3c27*/ byte_9699 = 1; /*0x3c2a*/ LOBYTE(v42) = 46; /*0x3c3a*/ @@ -291,34 +291,34 @@ } else { - i_1 = sub_7F8(); /*0x36d1*/ + i_1 = DebugTraceEnabled(); /*0x36d1*/ if ( (_BYTE)i_1 ) { - i_1 = sub_804(0x80000000LL); /*0x36e1*/ + i_1 = DebugLevelEnabled(0x80000000LL); /*0x36e1*/ if ( (_BYTE)i_1 ) - i_1 = sub_740(0x80000000LL, "CheckVpdAndUpdateToBmc: error reading Pci Locattion = %r\n", i_5); + i_1 = DebugPrint(0x80000000LL, "CheckVpdAndUpdateToBmc: error reading Pci Locattion = %r\n", i_5); } } } else { - i_1 = sub_7F8(); /*0x3670*/ + i_1 = DebugTraceEnabled(); /*0x3670*/ if ( (_BYTE)i_1 ) { - i_1 = sub_804(0x80000000LL); /*0x367c*/ + i_1 = DebugLevelEnabled(0x80000000LL); /*0x367c*/ if ( (_BYTE)i_1 ) - i_1 = sub_740(0x80000000LL, "CheckVpdAndUpdateToBmc: error reading Pci Config space. Code=%r\n", v14); + i_1 = DebugPrint(0x80000000LL, "CheckVpdAndUpdateToBmc: error reading Pci Config space. Code=%r\n", v14); } } } else { - i_1 = sub_7F8(); /*0x35ed*/ + i_1 = DebugTraceEnabled(); /*0x35ed*/ if ( (_BYTE)i_1 ) { - i_1 = sub_804(0x80000000LL); /*0x35f9*/ + i_1 = DebugLevelEnabled(0x80000000LL); /*0x35f9*/ if ( (_BYTE)i_1 ) - i_1 = sub_740( + i_1 = DebugPrint( 0x80000000LL, "CheckVpdAndUpdateToBmc: Error openning handle index %d. Code=%r\n", v9, @@ -334,23 +334,23 @@ } else { - i_1 = sub_7F8(); /*0x3562*/ + i_1 = DebugTraceEnabled(); /*0x3562*/ if ( (_BYTE)i_1 ) { - i_1 = sub_804(0x80000000LL); /*0x3576*/ + i_1 = DebugLevelEnabled(0x80000000LL); /*0x3576*/ if ( (_BYTE)i_1 ) - return sub_740(0x80000000LL, "CheckVpdAndUpdateToBmc: unable to find any PCI devices. Code=%r\n", i_4); + return DebugPrint(0x80000000LL, "CheckVpdAndUpdateToBmc: unable to find any PCI devices. Code=%r\n", i_4); } } } else { - i_1 = sub_7F8(); /*0x34fa*/ + i_1 = DebugTraceEnabled(); /*0x34fa*/ if ( (_BYTE)i_1 ) /*0x3501*/ { - i_1 = sub_804(64); /*0x350d*/ + i_1 = DebugLevelEnabled(64); /*0x350d*/ if ( (_BYTE)i_1 ) /*0x3514*/ - return sub_740(64, "CheckVpdAndUpdateToBmc Locating IPMI Dxe Protocol Status - %r\n", v10); /*0x3526*/ + return DebugPrint(64, "CheckVpdAndUpdateToBmc Locating IPMI Dxe Protocol Status - %r\n", v10); /*0x3526*/ } } return i_1; /*0x3635*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/CreateLegacyBootEventEx.c b/LenovoServerPkg/SystemInventory/SystemInventory/CreateLegacyBootEventEx.c index 3740ef6..ab00b8f 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/CreateLegacyBootEventEx.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/CreateLegacyBootEventEx.c @@ -7,7 +7,7 @@ __int64 (__fastcall *nullsub_2)(EFI_HANDLE, EFI_SYSTEM_TABLE *); // r8 if ( !a4 ) /*0x21f8*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 86, "LegacyBootEvent != ((void *) 0)"); /*0x220c*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 86, "LegacyBootEvent != ((void *) 0)"); /*0x220c*/ if ( SystemTable->Hdr.Revision >= 0x20000 ) /*0x2226*/ { nullsub_2 = nullsub_1; /*0x228e*/ @@ -23,8 +23,8 @@ } else { - sub_740(0x80000000LL, "EFI1.1 can't support LegacyBootEvent!"); /*0x2247*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 90, "((BOOLEAN)(0==1))"); /*0x226c*/ + DebugPrint(0x80000000LL, "EFI1.1 can't support LegacyBootEvent!"); /*0x2247*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 90, "((BOOLEAN)(0==1))"); /*0x226c*/ return 0x8000000000000003uLL; /*0x2271*/ } } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/CreateReadyToBootEventEx.c b/LenovoServerPkg/SystemInventory/SystemInventory/CreateReadyToBootEventEx.c index e4653dd..36c7f10 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/CreateReadyToBootEventEx.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/CreateReadyToBootEventEx.c @@ -7,7 +7,7 @@ __int64 (__fastcall *nullsub_2)(EFI_HANDLE, EFI_SYSTEM_TABLE *); // r8 if ( !a4 ) /*0x22fc*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 181, "ReadyToBootEvent != ((void *) 0)"); /*0x2311*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 181, "ReadyToBootEvent != ((void *) 0)"); /*0x2311*/ if ( SystemTable->Hdr.Revision >= 0x20000 ) /*0x232b*/ { nullsub_2 = nullsub_1; /*0x2393*/ @@ -23,8 +23,8 @@ } else { - sub_740(0x80000000LL, "EFI1.1 can't support ReadyToBootEvent!"); /*0x234c*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 185, "((BOOLEAN)(0==1))"); /*0x2371*/ + DebugPrint(0x80000000LL, "EFI1.1 can't support ReadyToBootEvent!"); /*0x234c*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiNotTiano.c", 185, "((BOOLEAN)(0==1))"); /*0x2371*/ return 0x8000000000000003uLL; /*0x2376*/ } } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/GetBmcVirtualCdDeviceNumber.c b/LenovoServerPkg/SystemInventory/SystemInventory/GetBmcVirtualCdDeviceNumber.c index 02d1879..e28f3ae 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/GetBmcVirtualCdDeviceNumber.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/GetBmcVirtualCdDeviceNumber.c @@ -19,8 +19,8 @@ char n4; // [rsp+70h] [rbp+18h] BYREF v0 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_9460, 0, &qword_9690); /*0x3f25*/ - if ( (unsigned __int8)sub_7F8(v2, v1, v3, v4) && (unsigned __int8)sub_804(64) ) /*0x3f3a*/ - sub_740(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v0); /*0x3f4f*/ + if ( (unsigned __int8)DebugTraceEnabled(v2, v1, v3, v4) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x3f3a*/ + DebugPrint(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v0); /*0x3f4f*/ if ( v0 < 0 ) /*0x3f57*/ return 0; /*0x3f59*/ n4 = 4; /*0x3f62*/ @@ -37,8 +37,8 @@ v13, &v14, &v15); - if ( (unsigned __int8)sub_7F8(v10, v9, v11, v12) && (unsigned __int8)sub_804(64) ) /*0x3fae*/ - sub_740(64, "Get the BMC virtual CD Device Number Status = %r, Number = %x \n", v8, v14); /*0x3fca*/ + if ( (unsigned __int8)DebugTraceEnabled(v10, v9, v11, v12) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x3fae*/ + DebugPrint(64, "Get the BMC virtual CD Device Number Status = %r, Number = %x \n", v8, v14); /*0x3fca*/ result = v14; /*0x3fcf*/ if ( v8 < 0 ) /*0x3fd7*/ return 0; /*0x3fd7*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/GetSystemConfigurationTableByGuid.c b/LenovoServerPkg/SystemInventory/SystemInventory/GetSystemConfigurationTableByGuid.c index 1a75c35..10a73d1 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/GetSystemConfigurationTableByGuid.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/GetSystemConfigurationTableByGuid.c @@ -5,15 +5,15 @@ __int64 i; // r14 if ( !a1 ) /*0x1f7c*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 97, "TableGuid != ((void *) 0)"); /*0x1f8f*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 97, "TableGuid != ((void *) 0)"); /*0x1f8f*/ if ( !a2 ) /*0x1fa1*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 98, "Table != ((void *) 0)"); /*0x1fb4*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 98, "Table != ((void *) 0)"); /*0x1fb4*/ SystemTable = SystemTable; /*0x1fb9*/ v5 = 0; /*0x1fc0*/ *a2 = 0; /*0x1fc2*/ if ( !SystemTable->NumberOfTableEntries ) /*0x1fc6*/ return 0x800000000000000EuLL; /*0x1fef*/ - for ( i = 0; !(unsigned __int8)sub_2ACC(a1, &SystemTable->ConfigurationTable[i]); ++i ) /*0x1fcc*/ + for ( i = 0; !(unsigned __int8)CompareGuid(a1, &SystemTable->ConfigurationTable[i]); ++i ) /*0x1fcc*/ { if ( ++v5 >= SystemTable->NumberOfTableEntries ) /*0x1fed*/ return 0x800000000000000EuLL; /*0x1fed*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeCpuInfo.c b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeCpuInfo.c index 67a1397..d7836f0 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeCpuInfo.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeCpuInfo.c @@ -46,8 +46,8 @@ int v47; // [rsp+90h] [rbp+18h] BYREF char v48; // [rsp+98h] [rbp+20h] BYREF - if ( (unsigned __int8)sub_7F8(a1, a2, a3, a4) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4873*/ - sub_740(0x80000000LL, "Enter InitializeCpuData ... \n"); /*0x4886*/ + if ( (unsigned __int8)DebugTraceEnabled(a1, a2, a3, a4) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4873*/ + DebugPrint(0x80000000LL, "Enter InitializeCpuData ... \n"); /*0x4886*/ *(_BYTE *)(qword_9680 + 86LL) = 2; /*0x4892*/ if ( qword_9670 /*0x48c3*/ || (v7 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96D8 + 320))(&unk_93F0, 0, &qword_9670), @@ -66,7 +66,7 @@ v18 = v44[0]; /*0x4939*/ *(_BYTE *)(v12 + qword_9680 + 88) = *(_BYTE *)(v44[0] + 35LL); /*0x4954*/ *(_BYTE *)(v12 + qword_9680 + 89) = *(_BYTE *)(v18 + 37); /*0x4962*/ - sub_D38(v12 + qword_9680 + 90LL, 13, "Intel"); /*0x4974*/ + AsciiSPrint(v12 + qword_9680 + 90LL, 13, "Intel"); /*0x4974*/ *(_DWORD *)(v12 + qword_9680 + 166) = *(unsigned __int16 *)(v18 + 20); /*0x49a2*/ ParsePciDevicePathLocation(*(_DWORD *)(v18 + 8), (unsigned int)&v48, (unsigned int)&v46, (unsigned int)&v47, 0); /*0x49ac*/ v19 = 0; /*0x49b6*/ @@ -76,33 +76,33 @@ if ( ++v19 >= 3u ) /*0x49d7*/ goto LABEL_17; /*0x49d7*/ } - sub_D38(v12 + qword_9680 + 103LL, 30, *(const char **)((char *)&unk_9518 + 10 * v19 + 2)); /*0x49fa*/ + AsciiSPrint(v12 + qword_9680 + 103LL, 30, *(const char **)((char *)&unk_9518 + 10 * v19 + 2)); /*0x49fa*/ LABEL_17: - sub_D38(v12 + qword_9680 + 133LL, 30, "%2Xh Model", v46); /*0x49ff*/ - sub_D38(v12 + qword_9680 + 163LL, 3, "%X", v47); /*0x4a4e*/ + AsciiSPrint(v12 + qword_9680 + 133LL, 30, "%2Xh Model", v46); /*0x49ff*/ + AsciiSPrint(v12 + qword_9680 + 163LL, 3, "%X", v47); /*0x4a4e*/ } - if ( (unsigned __int8)sub_7F8(v15, v14, v16, v17) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4a5f*/ - sub_740( /*0x4a83*/ + if ( (unsigned __int8)DebugTraceEnabled(v15, v14, v16, v17) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4a5f*/ + DebugPrint( /*0x4a83*/ 0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CoreCount = %x \n", v11, *(unsigned __int8 *)(v12 + qword_9680 + 88)); - if ( (unsigned __int8)sub_7F8(v21, v20, v22, v23) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4a94*/ - sub_740( /*0x4ab8*/ + if ( (unsigned __int8)DebugTraceEnabled(v21, v20, v22, v23) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4a94*/ + DebugPrint( /*0x4ab8*/ 0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.ThreadCount = %x \n", v11, *(unsigned __int8 *)(v12 + qword_9680 + 89)); - if ( (unsigned __int8)sub_7F8(v25, v24, v26, v27) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4ac9*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuVendor = %a \n", v11, v4); /*0x4aee*/ - if ( (unsigned __int8)sub_7F8(v29, v28, v30, v31) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4aff*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuFamilyName = %a \n", v11, v4); /*0x4b24*/ - if ( (unsigned __int8)sub_7F8(v33, v32, v34, v35) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4b35*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuModelIdName = %a \n", v11, v4); /*0x4b5d*/ - if ( (unsigned __int8)sub_7F8(v37, v36, v38, v39) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4b6e*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.Stepping = %a \n", v11, v4); /*0x4b96*/ - if ( (unsigned __int8)sub_7F8(v41, v40, v42, v43) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4ba7*/ - sub_740( /*0x4bcd*/ + if ( (unsigned __int8)DebugTraceEnabled(v25, v24, v26, v27) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4ac9*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuVendor = %a \n", v11, v4); /*0x4aee*/ + if ( (unsigned __int8)DebugTraceEnabled(v29, v28, v30, v31) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4aff*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuFamilyName = %a \n", v11, v4); /*0x4b24*/ + if ( (unsigned __int8)DebugTraceEnabled(v33, v32, v34, v35) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4b35*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.CpuModelIdName = %a \n", v11, v4); /*0x4b5d*/ + if ( (unsigned __int8)DebugTraceEnabled(v37, v36, v38, v39) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4b6e*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.Stepping = %a \n", v11, v4); /*0x4b96*/ + if ( (unsigned __int8)DebugTraceEnabled(v41, v40, v42, v43) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4ba7*/ + DebugPrint( /*0x4bcd*/ 0x80000000LL, "gSystemInventoryProtocol->CpuInfo[%d].SingleCpuInfo.MaxFrequency = %x \n", v11, @@ -115,12 +115,12 @@ } else { - result = sub_7F8(v6, v5, v8, v9); /*0x48c5*/ + result = DebugTraceEnabled(v6, v5, v8, v9); /*0x48c5*/ if ( (_BYTE)result ) /*0x48cc*/ { - result = sub_804(0x80000000LL); /*0x48d5*/ + result = DebugLevelEnabled(0x80000000LL); /*0x48d5*/ if ( (_BYTE)result ) /*0x48dc*/ - return sub_740(0x80000000LL, "LocateProtocol gAmiSmbiosProtocolGuid Status = %r ... \n", v7); /*0x48ef*/ + return DebugPrint(0x80000000LL, "LocateProtocol gAmiSmbiosProtocolGuid Status = %r ... \n", v7); /*0x48ef*/ } } return result; /*0x4bf2*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeDimmInfo.c b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeDimmInfo.c index dca7ab5..3c37234 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeDimmInfo.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeDimmInfo.c @@ -78,48 +78,48 @@ if ( (*(__int64 (__fastcall **)(__int64, __int64, __int64 *, char *))(qword_9678 + 64))(a1, a2, &v63, &v61) >= 0 ) /*0x4c92*/ break; /*0x4c92*/ LABEL_33: - if ( (unsigned __int8)sub_7F8(v9, v8, v10, v11) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4eb6*/ - sub_740( /*0x4edd*/ + if ( (unsigned __int8)DebugTraceEnabled(v9, v8, v10, v11) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4eb6*/ + DebugPrint( /*0x4edd*/ 0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DimmSlotIndex = %x \n", v5, *(unsigned __int8 *)(i + qword_9680 + 258)); - if ( (unsigned __int8)sub_7F8(v26, v25, v27, v28) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4eee*/ - sub_740( /*0x4f15*/ + if ( (unsigned __int8)DebugTraceEnabled(v26, v25, v27, v28) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4eee*/ + DebugPrint( /*0x4f15*/ 0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].NodeNumber = %x \n", v5, *(unsigned __int8 *)(i + qword_9680 + 259)); - if ( (unsigned __int8)sub_7F8(v30, v29, v31, v32) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4f26*/ - sub_740( /*0x4f4d*/ + if ( (unsigned __int8)DebugTraceEnabled(v30, v29, v31, v32) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4f26*/ + DebugPrint( /*0x4f4d*/ 0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].ChannelNumber = %x \n", v5, *(unsigned __int8 *)(i + qword_9680 + 260)); - if ( (unsigned __int8)sub_7F8(v34, v33, v35, v36) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4f5e*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DimmType = %a \n", v5, a4); /*0x4f86*/ - if ( (unsigned __int8)sub_7F8(v38, v37, v39, v40) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4f97*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DdrVoltage = %a \n", v5, a4); /*0x4fbf*/ - if ( (unsigned __int8)sub_7F8(v42, v41, v43, v44) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4fd0*/ - sub_740( /*0x4ff7*/ + if ( (unsigned __int8)DebugTraceEnabled(v34, v33, v35, v36) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4f5e*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DimmType = %a \n", v5, a4); /*0x4f86*/ + if ( (unsigned __int8)DebugTraceEnabled(v38, v37, v39, v40) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4f97*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DdrVoltage = %a \n", v5, a4); /*0x4fbf*/ + if ( (unsigned __int8)DebugTraceEnabled(v42, v41, v43, v44) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4fd0*/ + DebugPrint( /*0x4ff7*/ 0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DimmFreq = %d \n", v5, *(unsigned __int16 *)(i + qword_9680 + 281)); - if ( (unsigned __int8)sub_7F8(v46, v45, v47, v48) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x5008*/ - sub_740( /*0x502f*/ + if ( (unsigned __int8)DebugTraceEnabled(v46, v45, v47, v48) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x5008*/ + DebugPrint( /*0x502f*/ 0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].DimmSize = %d \n", v5, *(unsigned __int16 *)(i + qword_9680 + 283)); - if ( (unsigned __int8)sub_7F8(v50, v49, v51, v52) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x5040*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].ManufacturerIdName = %a \n", v5, a4); /*0x5068*/ - if ( (unsigned __int8)sub_7F8(v54, v53, v55, v56) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x5079*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].SerialNumber = %a \n", v5, a4); /*0x50a1*/ - if ( (unsigned __int8)sub_7F8(v58, v57, v59, v60) ) /*0x50a6*/ + if ( (unsigned __int8)DebugTraceEnabled(v50, v49, v51, v52) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x5040*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].ManufacturerIdName = %a \n", v5, a4); /*0x5068*/ + if ( (unsigned __int8)DebugTraceEnabled(v54, v53, v55, v56) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x5079*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].SerialNumber = %a \n", v5, a4); /*0x50a1*/ + if ( (unsigned __int8)DebugTraceEnabled(v58, v57, v59, v60) ) /*0x50a6*/ { - if ( (unsigned __int8)sub_804(0x80000000LL) ) /*0x50b2*/ - sub_740(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].PartNumber = %a \n", v5, a4); /*0x50da*/ + if ( (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x50b2*/ + DebugPrint(0x80000000LL, "gSystemInventoryProtocol->DimmInfo[%d].PartNumber = %a \n", v5, a4); /*0x50da*/ } (*(void (__fastcall **)(__int64))(qword_96D8 + 72))(v63); /*0x50ea*/ ++v5; /*0x50f1*/ @@ -138,8 +138,8 @@ *(_WORD *)(i + qword_9680 + 281) = v15; /*0x4ce4*/ while ( 1 ) /*0x4cec*/ { - if ( (unsigned __int8)sub_7F8(v15, v8, v10, v11) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4cf8*/ - sub_740( /*0x4d24*/ + if ( (unsigned __int8)DebugTraceEnabled(v15, v8, v10, v11) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4cf8*/ + DebugPrint( /*0x4d24*/ 0x80000000LL, "gSmbiosDimmTypeNameMapping[j].Value = %x, Type17->MemoryType = %x\n", *((unsigned __int16 *)&unk_9540 + 5 * v14), @@ -151,7 +151,7 @@ if ( ++v14 >= 0x1Eu ) /*0x4d49*/ goto LABEL_16; /*0x4d49*/ } - sub_D38(i + qword_9680 + 261, 10, *(_QWORD *)((char *)&unk_9540 + 10 * v14 + 2)); /*0x4d77*/ + AsciiSPrint(i + qword_9680 + 261, 10, *(_QWORD *)((char *)&unk_9540 + 10 * v14 + 2)); /*0x4d77*/ LABEL_16: switch ( *(_WORD *)(v12 + 38) ) /*0x4d89*/ { @@ -174,7 +174,7 @@ } v16 = qword_9680; /*0x4dcf*/ LABEL_26: - sub_D38(i + v16 + 271, 10, _1.2V); /*0x4dd6*/ + AsciiSPrint(i + v16 + 271, 10, _1.2V); /*0x4dd6*/ LOBYTE(v18) = *(_BYTE *)(v12 + 23); /*0x4de5*/ if ( !sub_27B8(v63, v18, &v62) ) /*0x4df0*/ (*(void (__fastcall **)(__int64, __int64, __int64))(qword_96D8 + 352))(i + qword_9680 + 285, v62, 30); /*0x4e1a*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/InitializePciInventory.c b/LenovoServerPkg/SystemInventory/SystemInventory/InitializePciInventory.c index 0af78c0..26a5b4d 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/InitializePciInventory.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/InitializePciInventory.c @@ -85,8 +85,8 @@ &v40, (char *)&v40 + 8, &v41); - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(64) ) /*0x5261*/ - sub_740( /*0x5285*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5261*/ + DebugPrint( /*0x5285*/ 64, "[System Inventory] Pci Device found in root bridge Bus = %x Dev = %x Fun = %x\n", (_DWORD)v40, @@ -96,13 +96,13 @@ LOBYTE(v6) = 16; /*0x528e*/ LOBYTE(v3) = BYTE8(v40); /*0x5291*/ LOBYTE(v4) = v40; /*0x5294*/ - v7 = sub_28CC(v4, v3, v5, v6); /*0x529c*/ - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(64) ) /*0x52ab*/ - sub_740(64, "[System Inventory] PciExpReg %x\n", v7); /*0x52c1*/ - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(64) ) /*0x52d2*/ - sub_740(64, "PciExpReg->SlotStatus.Bits.PresenceDetect = %x\n", (*(unsigned __int16 *)(v7 + 26) >> 6) & 1); /*0x52f2*/ - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(64) ) /*0x5303*/ - sub_740(64, "PciExpReg->SlotCapability.Bits.PhysicalSlotNumber = %x\n", *(_DWORD *)(v7 + 20) >> 19); /*0x531e*/ + v7 = PciRead32(v4, v3, v5, v6); /*0x529c*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x52ab*/ + DebugPrint(64, "[System Inventory] PciExpReg %x\n", v7); /*0x52c1*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x52d2*/ + DebugPrint(64, "PciExpReg->SlotStatus.Bits.PresenceDetect = %x\n", (*(unsigned __int16 *)(v7 + 26) >> 6) & 1); /*0x52f2*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5303*/ + DebugPrint(64, "PciExpReg->SlotCapability.Bits.PhysicalSlotNumber = %x\n", *(_DWORD *)(v7 + 20) >> 19); /*0x531e*/ if ( (*(_BYTE *)(v7 + 26) & 0x40) != 0 ) /*0x5327*/ { (*(void (__fastcall **)(__int64, _QWORD, __int64, __int64, unsigned __int8 *))(v34 + 48))( /*0x5347*/ @@ -116,18 +116,18 @@ *(_QWORD *)(v35 + 8 * i), &unk_9470, &v37); - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(64) ) /*0x537d*/ - sub_740(64, "Locate DevicePathProtocol Status - %r\n", v9); /*0x5393*/ - if ( (unsigned __int8)sub_7EC() && v9 < 0 ) /*0x53a4*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x537d*/ + DebugPrint(64, "Locate DevicePathProtocol Status - %r\n", v9); /*0x5393*/ + if ( (unsigned __int8)DebugAssertEnabled() && v9 < 0 ) /*0x53a4*/ { - if ( (unsigned __int8)((__int64 (*)(void))sub_7F8)() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x53b4*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); /*0x53cc*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1231, "!EFI_ERROR (Status)"); /*0x53e4*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x53b4*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); /*0x53cc*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1231, "!EFI_ERROR (Status)"); /*0x53e4*/ } if ( (*(_DWORD *)(v7 + 20) & 0xFFF80000) != 0 ) /*0x53f0*/ { v10 = 0; /*0x53f6*/ - while ( (unsigned __int16)sub_2500(((32LL * v8) | v10 & 0x1F) << 15) == 0xFFFF ) /*0x541e*/ + while ( (unsigned __int16)PciRead16(((32LL * v8) | v10 & 0x1F) << 15) == 0xFFFF ) /*0x541e*/ { if ( ++v10 > 0x1Fu ) /*0x5425*/ goto LABEL_48; /*0x5425*/ @@ -143,7 +143,7 @@ if ( __PAIR128__(*((unsigned __int8 *)v28 + v14 + 1), *((unsigned __int8 *)v28 + v14)) == v40 /*0x5493*/ && *((unsigned __int8 *)v28 + v14 + 2) == v41 ) { - if ( (unsigned __int8)sub_7F8(v14, v13, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)sub_804(64) ) /*0x56f0*/ + if ( (unsigned __int8)DebugTraceEnabled(v14, v13, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x56f0*/ { [System_Inventory]_Pci_Device_is_found_in_Pcie_Slot_is_of_Riser = "[System Inventory] Pci Device is f" /*0x56f9*/ "ound in Pcie Slot is of Riser Type" @@ -151,7 +151,7 @@ LABEL_53: LODWORD(v25) = 0; /*0x5700*/ LODWORD(v24) = v10; /*0x5712*/ - sub_740(64, [System_Inventory]_Pci_Device_is_found_in_Pcie_Slot_is_of_Riser, 0, v8, v24, v25); /*0x5716*/ + DebugPrint(64, [System_Inventory]_Pci_Device_is_found_in_Pcie_Slot_is_of_Riser, 0, v8, v24, v25); /*0x5716*/ } goto LABEL_54; /*0x5716*/ } @@ -177,10 +177,10 @@ v18 = 3 * v17; /*0x5508*/ if ( *((_BYTE *)v26 + 3 * v17 + 2) == 0xFF ) /*0x5511*/ { - if ( (unsigned __int8)sub_7F8(v18, v17, v41, *((_QWORD *)&v40 + 1)) ) /*0x5513*/ + if ( (unsigned __int8)DebugTraceEnabled(v18, v17, v41, *((_QWORD *)&v40 + 1)) ) /*0x5513*/ { - if ( (unsigned __int8)sub_804(64) ) /*0x5523*/ - sub_740( /*0x5542*/ + if ( (unsigned __int8)DebugLevelEnabled(64) ) /*0x5523*/ + DebugPrint( /*0x5542*/ 64, "[System Inventory] Pci Device found is in Onboard Slot, Location Bus = %x Dev = %x Fun = %x\n", v8, @@ -190,8 +190,8 @@ goto LABEL_47; /*0x5542*/ } } - if ( (unsigned __int8)sub_7F8(v18, v17, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)sub_804(64) ) /*0x5761*/ - sub_740( /*0x5780*/ + if ( (unsigned __int8)DebugTraceEnabled(v18, v17, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5761*/ + DebugPrint( /*0x5780*/ 64, "[System Inventory] Pci Device found is a MEZZ card, Location Bus = %x Dev = %x Fun = %x\n", v8, @@ -201,7 +201,7 @@ goto LABEL_47; /*0x5794*/ } } - if ( (unsigned __int8)sub_7F8(v16, v15, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)sub_804(64) ) /*0x573f*/ + if ( (unsigned __int8)DebugTraceEnabled(v16, v15, v41, *((_QWORD *)&v40 + 1)) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x573f*/ { [System_Inventory]_Pci_Device_is_found_in_Pcie_Slot_is_of_Riser = "[System Inventory] Pci Device is found" /*0x5748*/ " in NVME Slot is of Riser Type - %d, L" @@ -218,14 +218,14 @@ *(_BYTE *)(v12 + qword_9680 + 2278) &= 0xF8u; /*0x557e*/ v20 = ((32 * v8) | v10 & 0x1Fu) << 15; /*0x558f*/ v21 = (unsigned int)v20; /*0x5592*/ - *(_WORD *)(v12 + qword_9680 + 2279) = sub_2500(v20); /*0x55a0*/ - *(_WORD *)(v12 + qword_9680 + 2281) = sub_2500((unsigned int)v21 | 2LL); /*0x55ba*/ - *(_WORD *)(v12 + qword_9680 + 2283) = sub_2500((unsigned int)v21 | 0x2CLL); /*0x55d4*/ - *(_WORD *)(v12 + qword_9680 + 2285) = sub_2500((unsigned int)v21 | 0x2ELL); /*0x55ee*/ - *(_BYTE *)(v12 + qword_9680 + 2287) = sub_24F0((unsigned int)v21 | 9LL); /*0x560e*/ - *(_BYTE *)(v12 + qword_9680 + 2288) = sub_24F0((unsigned int)v21 | 0xALL); /*0x5628*/ - *(_BYTE *)(v12 + qword_9680 + 2289) = sub_24F0(v21 | 0xB); /*0x563b*/ - v22 = sub_2500(((v41 & 7 | (8 * (BYTE8(v40) & 0x1F | (32LL * (unsigned __int8)v40)))) << 12) | 0xA2); /*0x566d*/ + *(_WORD *)(v12 + qword_9680 + 2279) = PciRead16(v20); /*0x55a0*/ + *(_WORD *)(v12 + qword_9680 + 2281) = PciRead16((unsigned int)v21 | 2LL); /*0x55ba*/ + *(_WORD *)(v12 + qword_9680 + 2283) = PciRead16((unsigned int)v21 | 0x2CLL); /*0x55d4*/ + *(_WORD *)(v12 + qword_9680 + 2285) = PciRead16((unsigned int)v21 | 0x2ELL); /*0x55ee*/ + *(_BYTE *)(v12 + qword_9680 + 2287) = PciRead8((unsigned int)v21 | 9LL); /*0x560e*/ + *(_BYTE *)(v12 + qword_9680 + 2288) = PciRead8((unsigned int)v21 | 0xALL); /*0x5628*/ + *(_BYTE *)(v12 + qword_9680 + 2289) = PciRead8(v21 | 0xB); /*0x563b*/ + v22 = PciRead16(((v41 & 7 | (8 * (BYTE8(v40) & 0x1F | (32LL * (unsigned __int8)v40)))) << 12) | 0xA2); /*0x566d*/ ++v0; /*0x5684*/ *(_BYTE *)(v12 + qword_9680 + 2290) = v22 & 0xF; /*0x5687*/ *(_BYTE *)(v12 + qword_9680 + 2291) = (v22 >> 4) & 0x3F; /*0x5695*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeStorageInventory.c b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeStorageInventory.c index 863b07b..fc3d344 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeStorageInventory.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeStorageInventory.c @@ -70,21 +70,21 @@ *(_QWORD *)(v35 + 8 * i_1), &unk_9470, &j_3); - if ( (unsigned __int8)sub_7EC() && v3 < 0 ) /*0x40ae*/ + if ( (unsigned __int8)DebugAssertEnabled() && v3 < 0 ) /*0x40ae*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x40bc*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v3); /*0x40d2*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1393, "!EFI_ERROR (Status)"); /*0x40ea*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x40bc*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v3); /*0x40d2*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1393, "!EFI_ERROR (Status)"); /*0x40ea*/ } j_1 = j_3; /*0x40fa*/ if ( (*(__int64 (__fastcall **)(void *, __int64 *, __int64 *))(qword_96A8 + 184))(&unk_9400, &j_3, &v40) >= 0 ) /*0x4112*/ { v5 = (*(__int64 (__fastcall **)(__int64, void *, __int64 *))(qword_96A8 + 152))(v40, &unk_9400, &v31); /*0x4134*/ - if ( (unsigned __int8)sub_7EC() && v5 < 0 ) /*0x4143*/ + if ( (unsigned __int8)DebugAssertEnabled() && v5 < 0 ) /*0x4143*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4151*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v5); /*0x4167*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1404, "!EFI_ERROR (Status)"); /*0x417f*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4151*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v5); /*0x4167*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1404, "!EFI_ERROR (Status)"); /*0x417f*/ } v6 = (*(__int64 (__fastcall **)(__int64, _BYTE *, __int64 *, __int64 *, __int64 *))(v31 + 112))( /*0x41a3*/ v31, @@ -92,17 +92,17 @@ &v29, &v34, &v33); - if ( (unsigned __int8)sub_7EC() && v6 < 0 ) /*0x41b2*/ + if ( (unsigned __int8)DebugAssertEnabled() && v6 < 0 ) /*0x41b2*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x41c0*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v6); /*0x41d6*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1407, "!EFI_ERROR (Status)"); /*0x41ee*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x41c0*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v6); /*0x41d6*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1407, "!EFI_ERROR (Status)"); /*0x41ee*/ } - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x41ff*/ - sub_740(0x80000000LL, "Bus = %x, Dev = %x, Func = %x\n", v29, v34, v33); /*0x4223*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x41ff*/ + DebugPrint(0x80000000LL, "Bus = %x, Dev = %x, Func = %x\n", v29, v34, v33); /*0x4223*/ (*(void (__fastcall **)(__int64, __int64, _QWORD, __int64, unsigned __int16 *))(v31 + 48))(v31, 1, 0, 1, &v43); /*0x4241*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4250*/ - sub_740(0x80000000LL, "VendorID = %x\n", v43); /*0x4268*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4250*/ + DebugPrint(0x80000000LL, "VendorID = %x\n", v43); /*0x4268*/ for ( j = j_1; !(unsigned __int8)sub_1EF0(j); j = j_1 ) /*0x426d*/ { if ( (unsigned __int8)sub_1DB8(j_1) == 1 && (unsigned __int8)sub_1DF0(j_1) == 1 ) /*0x4291*/ @@ -116,8 +116,8 @@ LABEL_36: if ( j_1 ) /*0x42b0*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x42c2*/ - sub_740( /*0x42df*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x42c2*/ + DebugPrint( /*0x42df*/ 0x80000000LL, "PciDevicePath->Device = %x, PciDevicePath->Function = %x.\n", *(unsigned __int8 *)(j_1 + 5), @@ -128,22 +128,22 @@ *(_QWORD *)(v35 + 8 * i_1), &unk_93E0, &v32); - if ( (unsigned __int8)sub_7EC() && v9 < 0 ) /*0x4332*/ + if ( (unsigned __int8)DebugAssertEnabled() && v9 < 0 ) /*0x4332*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x4340*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); /*0x4356*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1437, "!EFI_ERROR (Status)"); /*0x436e*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x4340*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); /*0x4356*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1437, "!EFI_ERROR (Status)"); /*0x436e*/ } if ( (*(__int64 (__fastcall **)(__int64, int *, _BYTE *))(v32 + 40))(v32, &v45, v30) >= 0 ) /*0x4388*/ { n512 = 512; /*0x4395*/ - v10 = (_WORD *)sub_1D2C(512); /*0x43ab*/ + v10 = (_WORD *)AllocatePool(512); /*0x43ab*/ v11 = (*(__int64 (__fastcall **)(__int64, _WORD *, int *))(v32 + 24))(v32, v10, &n512); /*0x43b2*/ - if ( (unsigned __int8)sub_7EC() && v11 < 0 ) /*0x43c1*/ + if ( (unsigned __int8)DebugAssertEnabled() && v11 < 0 ) /*0x43c1*/ { - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x43cf*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v11); /*0x43e5*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1456, "!EFI_ERROR (Status)"); /*0x43fd*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x43cf*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v11); /*0x43e5*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1456, "!EFI_ERROR (Status)"); /*0x43fd*/ } (*(void (__fastcall **)(__int64, int *, _BYTE *))(v32 + 40))(v32, &v45, v30); /*0x4411*/ v12 = 0; /*0x4423*/ @@ -164,9 +164,9 @@ LABEL_65: if ( (__int16)*v10 >= 0 ) /*0x4471*/ { - v14 = (unsigned int)sub_2518(((v33 & 7 | (8 * (v34 & 0x1F | (32LL * (unsigned __int8)v29)))) << 12) | 0x24); /*0x44b2*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(0x80000000LL) ) /*0x44c0*/ - sub_740( /*0x44e8*/ + v14 = (unsigned int)PciRead32(((v33 & 7 | (8 * (v34 & 0x1F | (32LL * (unsigned __int8)v29)))) << 12) | 0x24); /*0x44b2*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x44c0*/ + DebugPrint( /*0x44e8*/ 0x80000000LL, "RDBG Inventory Bus %x, Dev %x, Func %x , SidpbaorAhciBaseAddr = %x\n", v29, @@ -201,8 +201,8 @@ if ( v10[217] == 1 ) /*0x45cf*/ { *(_BYTE *)(v24 + qword_9680 + 2421) = 1; /*0x45d1*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(64) ) /*0x45e6*/ - sub_740( /*0x45f6*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x45e6*/ + DebugPrint( /*0x45f6*/ 64, "[System Inventory] Hard Disk %d is found in slot %d is of type SSD\n", (unsigned int)v0 + 1, @@ -211,8 +211,8 @@ else { *(_BYTE *)(v24 + qword_9680 + 2421) = 0; /*0x45f8*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(64) ) /*0x460e*/ - sub_740( /*0x462e*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x460e*/ + DebugPrint( /*0x462e*/ 64, "[System Inventory] Hard Disk %d is found in slot %d is of type HDD\n", (unsigned int)v0 + 1, @@ -224,7 +224,7 @@ *(_BYTE *)(v24 + qword_9680 + 2422) = 3; /*0x465e*/ *(_BYTE *)(v24 + qword_9680 + 2424) = v15; /*0x466d*/ *(_BYTE *)(v24 + qword_9680 + 2425) = v25; /*0x467c*/ - n0x40 = sub_9F0(v10 + 27); /*0x4686*/ + n0x40 = AsciiStrLen(v10 + 27); /*0x4686*/ v27 = v10 + 27; /*0x4692*/ v28 = v24 + qword_9680 + 2353; /*0x469c*/ if ( n0x40 <= 0x40 ) /*0x46a3*/ @@ -233,10 +233,10 @@ AsciiStrCpyS(v28, v27, 62); /*0x46ab*/ sub_2720(v24 + qword_9680 + 2353, 64); /*0x46cf*/ sub_275C(v24 + qword_9680 + 2353, 64); /*0x46e7*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(64) ) /*0x46f7*/ - sub_740(64, "[System Inventory] Drive Size = %d MB\n", *(_DWORD *)(v24 + qword_9680 + 2417)); /*0x4718*/ - if ( (unsigned __int8)sub_7F8() && (unsigned __int8)sub_804(64) ) /*0x4729*/ - sub_740(64, "[System Inventory] Link Speed = %d\n", *(unsigned __int8 *)(v24 + qword_9680 + 2424)); /*0x474c*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x46f7*/ + DebugPrint(64, "[System Inventory] Drive Size = %d MB\n", *(_DWORD *)(v24 + qword_9680 + 2417)); /*0x4718*/ + if ( (unsigned __int8)DebugTraceEnabled() && (unsigned __int8)DebugLevelEnabled(64) ) /*0x4729*/ + DebugPrint(64, "[System Inventory] Link Speed = %d\n", *(unsigned __int8 *)(v24 + qword_9680 + 2424)); /*0x474c*/ (*(void (__fastcall **)(_WORD *))(qword_96A8 + 72))(v10); /*0x475b*/ ++v0; /*0x476a*/ } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeSystemInventory.c b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeSystemInventory.c index 305a6ed..179e0cf 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/InitializeSystemInventory.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/InitializeSystemInventory.c @@ -33,57 +33,57 @@ __int64 v34; // r9 v4 = sub_4B8(); /*0x2c94*/ - if ( (unsigned __int8)sub_7EC() && v4 < 0 ) /*0x2cbd*/ + if ( (unsigned __int8)DebugAssertEnabled() && v4 < 0 ) /*0x2cbd*/ { if ( (unsigned __int8)DebugTraceEnabled(v6, v5, v7, v8) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2cca*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v4); /*0x2cdb*/ - sub_788( /*0x2ceb*/ + DebugAssert( /*0x2ceb*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 306, "!EFI_ERROR (Status)"); } v9 = sub_554(ImageHandle, SystemTable); /*0x2cfb*/ - if ( (unsigned __int8)sub_7EC() && v9 < 0 ) /*0x2d0a*/ + if ( (unsigned __int8)DebugAssertEnabled() && v9 < 0 ) /*0x2d0a*/ { if ( (unsigned __int8)DebugTraceEnabled(v11, v10, v12, v13) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2d18*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); /*0x2d2a*/ - sub_788( /*0x2d3a*/ + DebugAssert( /*0x2d3a*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 309, "!EFI_ERROR (Status)"); } v14 = sub_1F4C(ImageHandle, SystemTable); /*0x2d4a*/ - if ( (unsigned __int8)sub_7EC() && v14 < 0 ) /*0x2d59*/ + if ( (unsigned __int8)DebugAssertEnabled() && v14 < 0 ) /*0x2d59*/ { if ( (unsigned __int8)DebugTraceEnabled(v16, v15, v17, v18) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2d67*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v14); /*0x2d79*/ - sub_788( /*0x2d89*/ + DebugAssert( /*0x2d89*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 312, "!EFI_ERROR (Status)"); } v19 = sub_247C(ImageHandle, SystemTable); /*0x2d99*/ - if ( (unsigned __int8)sub_7EC() && v19 < 0 ) /*0x2da8*/ + if ( (unsigned __int8)DebugAssertEnabled() && v19 < 0 ) /*0x2da8*/ { if ( (unsigned __int8)DebugTraceEnabled(v21, v20, v22, v23) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2db6*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v19); /*0x2dc8*/ - sub_788( /*0x2dd8*/ + DebugAssert( /*0x2dd8*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 315, "!EFI_ERROR (Status)"); } v24 = sub_248C(ImageHandle, SystemTable); /*0x2de8*/ - if ( (unsigned __int8)sub_7EC() && v24 < 0 ) /*0x2df7*/ + if ( (unsigned __int8)DebugAssertEnabled() && v24 < 0 ) /*0x2df7*/ { if ( (unsigned __int8)DebugTraceEnabled(v26, v25, v27, v28) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2e05*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v24); /*0x2e17*/ - sub_788( /*0x2e27*/ + DebugAssert( /*0x2e27*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 318, "!EFI_ERROR (Status)"); } v29 = sub_26D8(ImageHandle, SystemTable); /*0x2e37*/ - result = sub_7EC(); /*0x2e3a*/ + result = DebugAssertEnabled(); /*0x2e3a*/ if ( (_BYTE)result && v29 < 0 ) /*0x2e46*/ { if ( (unsigned __int8)DebugTraceEnabled(v32, v31, v33, v34) ) /*0x2e48*/ @@ -91,7 +91,7 @@ if ( (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x2e54*/ DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v29); /*0x2e66*/ } - return sub_788( /*0x2e76*/ + return DebugAssert( /*0x2e76*/ "e:\\hs\\Build\\HR6N0XMLK\\DEBUG_VS2015\\X64\\LenovoServerPkg\\SystemInventory\\SystemInventory\\DEBUG\\AutoGen.c", 321, "!EFI_ERROR (Status)"); diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/OnBmcVirtualCdProtocolNotify.c b/LenovoServerPkg/SystemInventory/SystemInventory/OnBmcVirtualCdProtocolNotify.c index 660efaf..88844cf 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/OnBmcVirtualCdProtocolNotify.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/OnBmcVirtualCdProtocolNotify.c @@ -18,12 +18,12 @@ char v15; // [rsp+78h] [rbp+20h] BYREF v0 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_9460, 0, &qword_9690); /*0x3e43*/ - result = sub_7F8(v2, v1, v3, v4); /*0x3e46*/ + result = DebugTraceEnabled(v2, v1, v3, v4); /*0x3e46*/ if ( (_BYTE)result ) /*0x3e52*/ { - result = sub_804(64); /*0x3e56*/ + result = DebugLevelEnabled(64); /*0x3e56*/ if ( (_BYTE)result ) /*0x3e5d*/ - result = sub_740(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v0); /*0x3e6b*/ + result = DebugPrint(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v0); /*0x3e6b*/ } if ( v0 >= 0 ) /*0x3e73*/ { @@ -41,12 +41,12 @@ n2, &v15, &v14); - result = sub_7F8(v9, v8, v10, v11); /*0x3eb9*/ + result = DebugTraceEnabled(v9, v8, v10, v11); /*0x3eb9*/ if ( (_BYTE)result ) /*0x3ec0*/ { - result = sub_804(64); /*0x3ec5*/ + result = DebugLevelEnabled(64); /*0x3ec5*/ if ( (_BYTE)result ) /*0x3ecc*/ - return sub_740(64, "Set the BMC virtual CD number to 0. \n"); /*0x3ed8*/ + return DebugPrint(64, "Set the BMC virtual CD number to 0. \n"); /*0x3ed8*/ } } return result; /*0x3ee2*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/OnIpmiDxeProtocolNotify.c b/LenovoServerPkg/SystemInventory/SystemInventory/OnIpmiDxeProtocolNotify.c index 1e1a1b6..60c5664 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/OnIpmiDxeProtocolNotify.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/OnIpmiDxeProtocolNotify.c @@ -61,16 +61,16 @@ unsigned __int8 v61; // [rsp+80h] [rbp+18h] BYREF v2 = (*(__int64 (__fastcall **)(__int64, __int64, _QWORD *))(qword_96A8 + 64))(4, 3402, &p_n145); /*0x6064*/ - if ( (unsigned __int8)sub_7EC() && v2 < 0 ) /*0x6086*/ + if ( (unsigned __int8)DebugAssertEnabled() && v2 < 0 ) /*0x6086*/ { - if ( (unsigned __int8)sub_7F8(v4, v3, v5, v6) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x6093*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v2); /*0x60a8*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1972, "!EFI_ERROR (Status)"); /*0x60b8*/ + if ( (unsigned __int8)DebugTraceEnabled(v4, v3, v5, v6) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x6093*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v2); /*0x60a8*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1972, "!EFI_ERROR (Status)"); /*0x60b8*/ } ZeroMem(p_n145, 3402); /*0x60c7*/ v7 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_9460, 0, &qword_9690); /*0x60e9*/ - if ( (unsigned __int8)sub_7F8(v9, v8, v10, v11) && (unsigned __int8)sub_804(64) ) /*0x60fe*/ - sub_740(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v7); /*0x6114*/ + if ( (unsigned __int8)DebugTraceEnabled(v9, v8, v10, v11) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x60fe*/ + DebugPrint(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v7); /*0x6114*/ if ( v7 >= 0 ) { v13 = GetBmcVirtualCdDeviceNumber(); /*0x6127*/ @@ -91,14 +91,14 @@ v7 = qword_94B0; /*0x617c*/ if ( qword_94B0 >= 0 ) /*0x6182*/ { - if ( (unsigned __int8)sub_7F8(v16, v15, v17, v18) && (unsigned __int8)sub_804(64) ) /*0x61bd*/ - sub_740(64, "Get the virtual USB Status = %x \n", v61); /*0x61d9*/ + if ( (unsigned __int8)DebugTraceEnabled(v16, v15, v17, v18) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x61bd*/ + DebugPrint(64, "Get the virtual USB Status = %x \n", v61); /*0x61d9*/ if ( v61 != 1 ) /*0x61e6*/ goto LABEL_42; /*0x61e6*/ } - else if ( (unsigned __int8)sub_7F8(v16, v15, v17, v18) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x6190*/ + else if ( (unsigned __int8)DebugTraceEnabled(v16, v15, v17, v18) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x6190*/ { - sub_740(0x80000000LL, "Get virtual USB status failed! Status = %r\n", qword_94B0); /*0x61aa*/ + DebugPrint(0x80000000LL, "Get virtual USB status failed! Status = %r\n", qword_94B0); /*0x61aa*/ } LOBYTE(v20) = -86; /*0x61fe*/ LOBYTE(v60) = 1; /*0x6208*/ @@ -112,33 +112,33 @@ v60, &v61, &byte_9699); - if ( (unsigned __int8)sub_7F8(v22, v21, v23, v24) && (unsigned __int8)sub_804(64) ) /*0x6237*/ - sub_740(64, "[System Inventory] Enabling BMC USB Interface by disabling Power saving in BMC - %r\n", qword_94B0); /*0x6251*/ + if ( (unsigned __int8)DebugTraceEnabled(v22, v21, v23, v24) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x6237*/ + DebugPrint(64, "[System Inventory] Enabling BMC USB Interface by disabling Power saving in BMC - %r\n", qword_94B0); /*0x6251*/ v27 = (*(__int64 (__fastcall **)(__int64, __int64, __int64 (__fastcall *)(__int64, __int64, __int64, __int64)))(qword_96A8 + 80))( /*0x6282*/ 513, 16, - sub_3C80); + OnBmcUsbProtocolNotify); if ( v27 < 0 ) { - if ( (unsigned __int8)sub_7F8(v26, v25, v28, v29) && (unsigned __int8)sub_804(0x80000000LL) ) - sub_740(0x80000000LL, "Create DisableBmcUsbInterface Event with exit_boot_service fail, Status: %r\n", v27); - if ( (unsigned __int8)sub_7EC() ) /*0x62b1*/ + if ( (unsigned __int8)DebugTraceEnabled(v26, v25, v28, v29) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) + DebugPrint(0x80000000LL, "Create DisableBmcUsbInterface Event with exit_boot_service fail, Status: %r\n", v27); + if ( (unsigned __int8)DebugAssertEnabled() ) /*0x62b1*/ { - if ( (unsigned __int8)sub_7F8(v31, v30, v32, v33) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x62c6*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v27); /*0x62dc*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2064, "!EFI_ERROR (Status)"); /*0x62ec*/ + if ( (unsigned __int8)DebugTraceEnabled(v31, v30, v32, v33) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x62c6*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v27); /*0x62dc*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2064, "!EFI_ERROR (Status)"); /*0x62ec*/ } } v7 = CreateLegacyBootEventEx(16, (__int64 (__fastcall *)(EFI_HANDLE, EFI_SYSTEM_TABLE *))OnBmcUsbProtocolNotify, 0, (__int64)&qword_9718); /*0x630a*/ if ( v7 < 0 ) { - if ( (unsigned __int8)sub_7F8(v35, v34, v36, v37) && (unsigned __int8)sub_804(0x80000000LL) ) - sub_740(0x80000000LL, "Create DisableBmcUsbInterface Event with legacy boot fail, Status: %r\n", v7); - if ( (unsigned __int8)sub_7EC() ) /*0x6339*/ + if ( (unsigned __int8)DebugTraceEnabled(v35, v34, v36, v37) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) + DebugPrint(0x80000000LL, "Create DisableBmcUsbInterface Event with legacy boot fail, Status: %r\n", v7); + if ( (unsigned __int8)DebugAssertEnabled() ) /*0x6339*/ { - if ( (unsigned __int8)sub_7F8(v39, v38, v40, v41) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x634e*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v7); /*0x6364*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2075, "!EFI_ERROR (Status)"); /*0x6374*/ + if ( (unsigned __int8)DebugTraceEnabled(v39, v38, v40, v41) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x634e*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v7); /*0x6364*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2075, "!EFI_ERROR (Status)"); /*0x6374*/ } } LABEL_42: @@ -147,30 +147,30 @@ v44 = (*(__int64 (__fastcall **)(__int64, __int64, __int64 (__fastcall *)(), _QWORD, void *))(qword_96A8 + 80))( /*0x63b2*/ 513, 16, - sub_3E1C, + OnBmcVirtualCdProtocolNotify, 0, &unk_9710); if ( v44 < 0 ) { - if ( (unsigned __int8)sub_7F8(v43, v42, v45, v46) && (unsigned __int8)sub_804(0x80000000LL) ) - sub_740(0x80000000LL, "Create DisableBmcVirtualCD Event with exit_boot_service fail, Status: %r\n", v44); - if ( (unsigned __int8)sub_7EC() ) /*0x63e1*/ + if ( (unsigned __int8)DebugTraceEnabled(v43, v42, v45, v46) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) + DebugPrint(0x80000000LL, "Create DisableBmcVirtualCD Event with exit_boot_service fail, Status: %r\n", v44); + if ( (unsigned __int8)DebugAssertEnabled() ) /*0x63e1*/ { - if ( (unsigned __int8)sub_7F8(v48, v47, v49, v50) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x63f6*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v44); /*0x640c*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2091, "!EFI_ERROR (Status)"); /*0x641c*/ + if ( (unsigned __int8)DebugTraceEnabled(v48, v47, v49, v50) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x63f6*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v44); /*0x640c*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2091, "!EFI_ERROR (Status)"); /*0x641c*/ } } v7 = CreateLegacyBootEventEx(16, (__int64 (__fastcall *)(EFI_HANDLE, EFI_SYSTEM_TABLE *))OnBmcVirtualCdProtocolNotify, 0, (__int64)&qword_9718); /*0x643a*/ if ( v7 < 0 ) { - if ( (unsigned __int8)sub_7F8(v52, v51, v53, v54) && (unsigned __int8)sub_804(0x80000000LL) ) - sub_740(0x80000000LL, "Create DisableBmcVirtualCD Event with legacy boot fail, Status: %r\n", v7); - if ( (unsigned __int8)sub_7EC() ) /*0x6469*/ + if ( (unsigned __int8)DebugTraceEnabled(v52, v51, v53, v54) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) + DebugPrint(0x80000000LL, "Create DisableBmcVirtualCD Event with legacy boot fail, Status: %r\n", v7); + if ( (unsigned __int8)DebugAssertEnabled() ) /*0x6469*/ { - if ( (unsigned __int8)sub_7F8(v56, v55, v57, v58) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x647e*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v7); /*0x6494*/ - sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2102, "!EFI_ERROR (Status)"); /*0x64a4*/ + if ( (unsigned __int8)DebugTraceEnabled(v56, v55, v57, v58) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x647e*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v7); /*0x6494*/ + DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2102, "!EFI_ERROR (Status)"); /*0x64a4*/ } } } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/OnReadyToBoot.c b/LenovoServerPkg/SystemInventory/SystemInventory/OnReadyToBoot.c index ac100ab..62f5c6d 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/OnReadyToBoot.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/OnReadyToBoot.c @@ -50,8 +50,8 @@ LODWORD(v48) = 0; /*0x57af*/ p_n145 = 0; /*0x57b6*/ - if ( (unsigned __int8)sub_7F8(ImageHandle, SystemTable, a3, a4) && (unsigned __int8)sub_804(64) ) /*0x57cd*/ - sub_740(64, "[System Inventory] OnReadyToBoot \n"); /*0x57e0*/ + if ( (unsigned __int8)DebugTraceEnabled(ImageHandle, SystemTable, a3, a4) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x57cd*/ + DebugPrint(64, "[System Inventory] OnReadyToBoot \n"); /*0x57e0*/ InitializeCpuInfo(v7, v6, v8, v9); /*0x57e5*/ InitializeDimmInfo(v11, v10, v12, v4); /*0x57ea*/ sub_47B4(); /*0x57ef*/ @@ -59,15 +59,15 @@ InitializeStorageInventory(); /*0x57f9*/ (*(void (__fastcall **)(void *, void *, _QWORD, _QWORD))(qword_96A8 + 328))(&unk_9688, &unk_93B0, ::p_n145, 0); /*0x581d*/ *(_BYTE *)::p_n145 = -64; /*0x582a*/ - if ( (unsigned __int8)sub_7F8(v14, v13, v15, v16) && (unsigned __int8)sub_804(64) ) /*0x5839*/ - sub_740(64, "[System Inventory] Version info size - %d \n", 85); /*0x5852*/ + if ( (unsigned __int8)DebugTraceEnabled(v14, v13, v15, v16) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5839*/ + DebugPrint(64, "[System Inventory] Version info size - %d \n", 85); /*0x5852*/ *(_BYTE *)(::p_n145 + 85LL) = -63; /*0x585e*/ p_n145_1 = ::p_n145; /*0x5862*/ v21 = 19 * *(unsigned __int8 *)(::p_n145 + 2274LL) + 2191; /*0x5873*/ if ( *(_BYTE *)(::p_n145 + 2351LL) ) /*0x5879*/ { v22 = (*(__int64 (__fastcall **)(__int64, __int64, __int64 *))(qword_96A8 + 64))(4, 3317, &p_n145); /*0x589e*/ - result = sub_7EC(); /*0x58a1*/ + result = DebugAssertEnabled(); /*0x58a1*/ if ( (_BYTE)result ) /*0x58a8*/ { if ( v22 >= 0 ) /*0x58ad*/ @@ -82,9 +82,9 @@ v21 = 75 * p_n145_1 + 1 + v29; /*0x595f*/ goto LABEL_17; /*0x5961*/ } - if ( (unsigned __int8)sub_7F8(v25, v24, v26, v27) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x58bf*/ - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v22); /*0x58d4*/ - result = sub_788("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1641, "!EFI_ERROR (Status)"); /*0x58ec*/ + if ( (unsigned __int8)DebugTraceEnabled(v25, v24, v26, v27) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x58bf*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v22); /*0x58d4*/ + result = DebugAssert("e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 1641, "!EFI_ERROR (Status)"); /*0x58ec*/ } if ( v22 < 0 ) /*0x58f4*/ return result; /*0x58f4*/ @@ -93,12 +93,12 @@ v28 = 0; /*0x5967*/ p_n145 = ::p_n145 + 85LL; /*0x596a*/ LABEL_17: - if ( (unsigned __int8)sub_7F8(p_n145_1, v17, v18, v19) && (unsigned __int8)sub_804(64) ) /*0x597a*/ - sub_740(64, "[System Inventory] Device Info command size - %d\n", v21); /*0x5990*/ + if ( (unsigned __int8)DebugTraceEnabled(p_n145_1, v17, v18, v19) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x597a*/ + DebugPrint(64, "[System Inventory] Device Info command size - %d\n", v21); /*0x5990*/ if ( qword_94B0 ) /*0x599d*/ { - if ( (unsigned __int8)sub_7F8(v31, v30, v32, v33) && (unsigned __int8)sub_804(64) ) /*0x59fe*/ - sub_740( /*0x5a18*/ + if ( (unsigned __int8)DebugTraceEnabled(v31, v30, v32, v33) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x59fe*/ + DebugPrint( /*0x5a18*/ 64, "[System Inventory] OnReadyToBoot No Sending BMC Device Info Command by USB IPMI Status - %r\n", qword_94B0); @@ -107,17 +107,17 @@ { LOBYTE(v32) = 88; /*0x59ac*/ LOBYTE(v31) = 6; /*0x59ba*/ - v34 = sub_2640(v31, 0, v32, p_n145, v21, (__int64)&v51, (__int64)&v48, (__int64)&v50); /*0x59ce*/ - if ( (unsigned __int8)sub_7F8(v36, v35, v37, v38) && (unsigned __int8)sub_804(64) ) /*0x59dd*/ - sub_740(64, "[System Inventory] OnReadyToBoot Sending BMC Device Info Command Status - %r\n", v34); /*0x59f0*/ + v34 = CallSystemInventoryProtocolMethod(v31, 0, v32, p_n145, v21, (__int64)&v51, (__int64)&v48, (__int64)&v50); /*0x59ce*/ + if ( (unsigned __int8)DebugTraceEnabled(v36, v35, v37, v38) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x59dd*/ + DebugPrint(64, "[System Inventory] OnReadyToBoot Sending BMC Device Info Command Status - %r\n", v34); /*0x59f0*/ } if ( v28 ) /*0x5a20*/ FreePool(p_n145); /*0x5a26*/ v43 = SaveSmbiosDataToBmc(v40, v39, v41, v42); /*0x5a30*/ - if ( (unsigned __int8)sub_7F8(v45, v44, v46, v47) ) /*0x5a33*/ + if ( (unsigned __int8)DebugTraceEnabled(v45, v44, v46, v47) ) /*0x5a33*/ { - if ( (unsigned __int8)sub_804(64) ) /*0x5a3f*/ - sub_740(64, "[System Inventory] OnReadyToBoot SaveSmbiosDataToBmc Status - %r\n", v43); /*0x5a55*/ + if ( (unsigned __int8)DebugLevelEnabled(64) ) /*0x5a3f*/ + DebugPrint(64, "[System Inventory] OnReadyToBoot SaveSmbiosDataToBmc Status - %r\n", v43); /*0x5a55*/ } return (*(__int64 (__fastcall **)(EFI_HANDLE))(qword_96A8 + 112))(ImageHandle); /*0x5a6f*/ } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/ParsePciDevicePathLocation.c b/LenovoServerPkg/SystemInventory/SystemInventory/ParsePciDevicePathLocation.c index debc820..79caee4 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/ParsePciDevicePathLocation.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/ParsePciDevicePathLocation.c @@ -6,27 +6,27 @@ v8 = a1; /*0x281f*/ if ( a5 ) /*0x2824*/ - *a5 = sub_2BDC(a1, 12, 13); /*0x2834*/ + *a5 = BitFieldRead32(a1, 12, 13); /*0x2834*/ if ( a4 ) /*0x283a*/ - *a4 = sub_2BDC(v8, 0, 3); /*0x2849*/ - n15 = sub_2BDC(v8, 8, 11); /*0x2856*/ + *a4 = BitFieldRead32(v8, 0, 3); /*0x2849*/ + n15 = BitFieldRead32(v8, 8, 11); /*0x2856*/ n6 = n15; /*0x285b*/ if ( a2 ) /*0x2860*/ { *a2 = n15; /*0x2862*/ if ( (_DWORD)n15 == 15 ) /*0x2868*/ { - n15 = sub_2BDC(v8, 20, 27); /*0x2873*/ + n15 = BitFieldRead32(v8, 20, 27); /*0x2873*/ *a2 += n15; /*0x2878*/ } } if ( a3 ) /*0x287e*/ { - n15 = sub_2BDC(v8, 4, 7); /*0x288b*/ + n15 = BitFieldRead32(v8, 4, 7); /*0x288b*/ *a3 = n15; /*0x2890*/ if ( n6 == 6 || n6 == 15 ) /*0x289a*/ { - n15 = 16 * (unsigned int)sub_2BDC(v8, 16, 19); /*0x28ac*/ + n15 = 16 * (unsigned int)BitFieldRead32(v8, 16, 19); /*0x28ac*/ *a3 += n15; /*0x28af*/ } } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/PciConfigReadVpd.c b/LenovoServerPkg/SystemInventory/SystemInventory/PciConfigReadVpd.c index 05e414d..ef98d91 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/PciConfigReadVpd.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/PciConfigReadVpd.c @@ -45,14 +45,14 @@ continue; /*0x5b5e*/ if ( (v24 & 0x8000) == 0 ) { - if ( (unsigned __int8)sub_7F8( + if ( (unsigned __int8)DebugTraceEnabled( "Create DisableBmcVirtualCD Event with legacy boot fail, Status: %r\n", v12, v15, v16) - && (unsigned __int8)sub_804(64) ) + && (unsigned __int8)DebugLevelEnabled(64) ) { - sub_740(64, "PciConfigReadVpd: Unable to see F bit go TRUE\n"); + DebugPrint(64, "PciConfigReadVpd: Unable to see F bit go TRUE\n"); } return 0x8000000000000007uLL; /*0x5c3e*/ } @@ -60,7 +60,7 @@ v14 = (*(__int64 (__fastcall **)(__int64, __int64, _QWORD, __int64, _BYTE *))(a4 + 48))(a4, 2, v26, 1, v25); /*0x5b8f*/ if ( v14 < 0 ) /*0x5b95*/ { - if ( (unsigned __int8)sub_7F8(0, v18, v19, v20) && (unsigned __int8)sub_804(64) ) /*0x5bff*/ + if ( (unsigned __int8)DebugTraceEnabled(0, v18, v19, v20) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5bff*/ { v23 = v17; /*0x5c08*/ goto LABEL_23; /*0x5c0b*/ @@ -83,11 +83,11 @@ return 0; /*0x5bcf*/ } } - if ( (unsigned __int8)sub_7F8(v13, v12, v15, v16) && (unsigned __int8)sub_804(64) ) + if ( (unsigned __int8)DebugTraceEnabled(v13, v12, v15, v16) && (unsigned __int8)DebugLevelEnabled(64) ) { v23 = v8; /*0x5c59*/ LABEL_23: - sub_740(64, "PciConfigReadVpd: Error reading PciIo space at offset %x - code = %r\n", v23, v14); + DebugPrint(64, "PciConfigReadVpd: Error reading PciIo space at offset %x - code = %r\n", v23, v14); } return v14; /*0x5bdf*/ } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterProtocolNotifyEx.c b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterProtocolNotifyEx.c index 89af876..e37b32f 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterProtocolNotifyEx.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterProtocolNotifyEx.c @@ -6,11 +6,11 @@ _QWORD v13[3]; // [rsp+30h] [rbp-18h] BYREF if ( !a1 ) /*0x2061*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 152, "ProtocolGuid != ((void *) 0)"); /*0x2072*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 152, "ProtocolGuid != ((void *) 0)"); /*0x2072*/ if ( !NotifyFunction ) /*0x2084*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 153, "NotifyFunction != ((void *) 0)"); /*0x2095*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 153, "NotifyFunction != ((void *) 0)"); /*0x2095*/ if ( !a5 ) /*0x20aa*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 154, "Registration != ((void *) 0)"); /*0x20bb*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 154, "Registration != ((void *) 0)"); /*0x20bb*/ if ( (*(__int64 (__fastcall **)(__int64, __int64, __int64 (__fastcall *)(__int64), __int64, _QWORD *))(qword_96A8 + 80))( /*0x20f7*/ 512, n8, @@ -18,15 +18,15 @@ a4, v13) < 0 ) { - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n"); /*0x2113*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 167, "!EFI_ERROR (Status)"); /*0x2127*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n"); /*0x2113*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 167, "!EFI_ERROR (Status)"); /*0x2127*/ } v9 = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64))(qword_96A8 + 168))(a1, v13[0], a5); /*0x2140*/ LOBYTE(v11) = 15; /*0x2146*/ if ( v9 < 0 ) /*0x2156*/ { - sub_740(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9, 1); /*0x217c*/ - sub_788("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 179, "!EFI_ERROR (Status)"); /*0x2190*/ + DebugPrint(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", v9, 1); /*0x217c*/ + DebugAssert("e:\\hs\\MdePkg\\Library\\UefiLib\\UefiLib.c", 179, "!EFI_ERROR (Status)"); /*0x2190*/ } (*(void (__fastcall **)(_QWORD, __int64, __int64))(qword_96A8 + 104))(v13[0], v10, v11); /*0x21a1*/ return v13[0]; /*0x21bd*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterReadyToBootHandler.c b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterReadyToBootHandler.c index a088b69..5164e22 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterReadyToBootHandler.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterReadyToBootHandler.c @@ -10,8 +10,8 @@ __int64 v9; // [rsp+60h] [rbp+18h] BYREF v2 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_93C0, 0, &v9); /*0x64fd*/ - if ( (unsigned __int8)sub_7F8(v4, v3, v5, v6) && (unsigned __int8)sub_804(0x80000000LL) ) /*0x6510*/ - sub_740(0x80000000LL, "[System Inventory] SystemInventoryEntryPoint EfiCreateEventReadyToBootEx - %r\n", v2); /*0x6525*/ + if ( (unsigned __int8)DebugTraceEnabled(v4, v3, v5, v6) && (unsigned __int8)DebugLevelEnabled(0x80000000LL) ) /*0x6510*/ + DebugPrint(0x80000000LL, "[System Inventory] SystemInventoryEntryPoint EfiCreateEventReadyToBootEx - %r\n", v2); /*0x6525*/ result = sub_C8C(97); /*0x6532*/ if ( v2 >= 0 ) /*0x653a*/ { @@ -23,14 +23,14 @@ 0, 0, 0); - result = sub_7EC(); /*0x6569*/ + result = DebugAssertEnabled(); /*0x6569*/ if ( (_BYTE)result ) /*0x6570*/ { if ( v8 ) /*0x6575*/ { result = 0x8000000000000013uLL; /*0x6577*/ if ( v8 != 0x8000000000000013uLL ) /*0x6584*/ - return sub_788( /*0x6599*/ + return DebugAssert( /*0x6599*/ "e:\\hs\\LenovoServerPkg\\SystemInventory\\SystemInventory.c", 2160, "MpStatus == 0 || MpStatus == ((RETURN_STATUS)(0x8000000000000000ULL | (19)))"); diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterSystemInventoryCallbacks.c b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterSystemInventoryCallbacks.c index 4d0953f..3f33e0f 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/RegisterSystemInventoryCallbacks.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/RegisterSystemInventoryCallbacks.c @@ -16,8 +16,8 @@ else RegisterProtocolNotifyEx((__int64)&unk_9420, 8, (__int64)OnIpmiDxeProtocolNotify, 0, (__int64)&v7); /*0x5faf*/ v0 = CreateReadyToBootEventEx(8, OnReadyToBoot, 0, (__int64)&v8); /*0x5fd6*/ - if ( (unsigned __int8)sub_7F8(v2, v1, v3, v4) && (unsigned __int8)sub_804(64) ) /*0x5fe7*/ - sub_740(64, "[System Inventory] SystemInventoryEntryPoint EfiCreateEventReadyToBootEx - %r\n", v0); /*0x5fff*/ + if ( (unsigned __int8)DebugTraceEnabled(v2, v1, v3, v4) && (unsigned __int8)DebugLevelEnabled(64) ) /*0x5fe7*/ + DebugPrint(64, "[System Inventory] SystemInventoryEntryPoint EfiCreateEventReadyToBootEx - %r\n", v0); /*0x5fff*/ CreateReadyToBootEventEx(8, RegisterReadyToBootHandler, 0, (__int64)&v8); /*0x6016*/ return 0; /*0x6022*/ } diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/SaveSmbiosDataToBmc.c b/LenovoServerPkg/SystemInventory/SystemInventory/SaveSmbiosDataToBmc.c index a52d19e..74508fb 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/SaveSmbiosDataToBmc.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/SaveSmbiosDataToBmc.c @@ -26,15 +26,15 @@ v20 = 0; /*0x5c8d*/ p_n145 = 0; /*0x5c92*/ v24 = 0; /*0x5c97*/ - if ( (unsigned __int8)sub_7F8(a1, a2, a3, a4) && (unsigned __int8)sub_804(64) ) - sub_740(64, "SaveSmbiosDataToBmc: Enter \n"); + if ( (unsigned __int8)DebugTraceEnabled(a1, a2, a3, a4) && (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "SaveSmbiosDataToBmc: Enter \n"); v6 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_9460, 0, &qword_9690); /*0x5ce2*/ if ( v6 < 0 ) /*0x5ce8*/ { - if ( (unsigned __int8)sub_7F8(v5, v4, v7, v8) ) /*0x5cea*/ + if ( (unsigned __int8)DebugTraceEnabled(v5, v4, v7, v8) ) /*0x5cea*/ { - if ( (unsigned __int8)sub_804(64) ) /*0x5cf6*/ - sub_740(64, "Locating IPMI Dxe Protocol Status - %r\n", v6); /*0x5d0c*/ + if ( (unsigned __int8)DebugLevelEnabled(64) ) /*0x5cf6*/ + DebugPrint(64, "Locating IPMI Dxe Protocol Status - %r\n", v6); /*0x5d0c*/ } return v6; /*0x5d14*/ } @@ -57,7 +57,7 @@ LOBYTE(v14) = 71; /*0x5e19*/ v15 = &v23; /*0x5e1c*/ LOBYTE(v15) = 46; /*0x5e27*/ - v6 = sub_2640( /*0x5e32*/ + v6 = CallSystemInventoryProtocolMethod( /*0x5e32*/ (_DWORD)v15, 0, v14, @@ -66,10 +66,10 @@ (__int64)&v23, (__int64)&v24, (__int64)&v22); - if ( (unsigned __int8)sub_7F8(v17, v16, v18, v19) ) + if ( (unsigned __int8)DebugTraceEnabled(v17, v16, v18, v19) ) { - if ( (unsigned __int8)sub_804(64) ) - sub_740(64, "SaveSmbiosDataToBmc: SendOemIpmiCommand Status = %r , CompletionCode = %x \n", v6, v22); + if ( (unsigned __int8)DebugLevelEnabled(64) ) + DebugPrint(64, "SaveSmbiosDataToBmc: SendOemIpmiCommand Status = %r , CompletionCode = %x \n", v6, v22); } } return v6; /*0x5e69*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/SetBmcVirtualCdDeviceNumber.c b/LenovoServerPkg/SystemInventory/SystemInventory/SetBmcVirtualCdDeviceNumber.c index 061109b..4feefd9 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/SetBmcVirtualCdDeviceNumber.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/SetBmcVirtualCdDeviceNumber.c @@ -19,12 +19,12 @@ char n2_1; // [rsp+79h] [rbp+21h] v2 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_96A8 + 320))(&unk_9460, 0, &qword_9690); /*0x5eb0*/ - result = sub_7F8(v4, v3, v5, v6); /*0x5eb3*/ + result = DebugTraceEnabled(v4, v3, v5, v6); /*0x5eb3*/ if ( (_BYTE)result ) /*0x5ebf*/ { - result = sub_804(64); /*0x5ec3*/ + result = DebugLevelEnabled(64); /*0x5ec3*/ if ( (_BYTE)result ) /*0x5eca*/ - result = sub_740(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v2); /*0x5ed8*/ + result = DebugPrint(64, "[System Inventory] Locating IPMI Dxe Protocol Status - %r\n", v2); /*0x5ed8*/ } if ( v2 >= 0 ) /*0x5ee0*/ { @@ -43,12 +43,12 @@ n2_2, &v16, &v15); - result = sub_7F8(v11, v10, v12, v13); /*0x5f29*/ + result = DebugTraceEnabled(v11, v10, v12, v13); /*0x5f29*/ if ( (_BYTE)result ) /*0x5f30*/ { - result = sub_804(64); /*0x5f35*/ + result = DebugLevelEnabled(64); /*0x5f35*/ if ( (_BYTE)result ) /*0x5f3c*/ - return sub_740(64, "Set CD Device Number to 2 for USB Data transferring.\n"); /*0x5f48*/ + return DebugPrint(64, "Set CD Device Number to 2 for USB Data transferring.\n"); /*0x5f48*/ } } return result; /*0x5f4d*/ diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.c b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.c index 0526bd5..989fd4a 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.c @@ -20,7 +20,7 @@ signed __int64 Status; InitializeSystemInventory(ImageHandle, SystemTable); - Status = sub_2E9C(ImageHandle, SystemTable); + Status = RegisterSystemInventoryCallbacks(); if ( Status < 0 ) nullsub_1(ImageHandle, SystemTable); return Status; diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.h b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.h index 8a25788..90c8a10 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.h +++ b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory.h @@ -22,11 +22,10 @@ ); #define DebugTraceEnabled(...) sub_7F8(__VA_ARGS__) -#define DebugLevelEnabled(...) sub_804(__VA_ARGS__) -#define DebugPrint(...) sub_740(__VA_ARGS__) -#define ZeroMemory(...) sub_65B0(__VA_ARGS__) -#define CopyMemory(...) sub_63C(__VA_ARGS__) -#define AsciiStrLen(...) sub_9F0(__VA_ARGS__) +#define DebugLevelEnabled(...) sub_804(__VA_ARGS__) +#define DebugPrint(...) sub_740(__VA_ARGS__) +#define DebugAssertEnabled(...) DebugAssertEnabled(__VA_ARGS__) +#define DebugAssert(...) DebugAssert(__VA_ARGS__) EFI_STATUS EFIAPI diff --git a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory_ModuleEntryPoint.c b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory_ModuleEntryPoint.c index b0b237b..e07c195 100644 --- a/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory_ModuleEntryPoint.c +++ b/LenovoServerPkg/SystemInventory/SystemInventory/SystemInventory_ModuleEntryPoint.c @@ -3,7 +3,7 @@ signed __int64 Status; // rsi InitializeSystemInventory(ImageHandle, SystemTable); /*0x3fb*/ - Status = sub_2E9C(ImageHandle, SystemTable); /*0x48f*/ + Status = RegisterSystemInventoryCallbacks(); /*0x48f*/ if ( Status < 0 ) /*0x495*/ nullsub_1(ImageHandle, SystemTable); /*0x49d*/ return Status; /*0x4af*/ diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Debug/Debug.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Debug/Debug.c index 1b01e30..165bb80 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Debug/Debug.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Debug/Debug.c @@ -26,7 +26,7 @@ ErrorLevel_1 = ErrorLevel; /*0xa8b*/ if ( !Format ) /*0xa91*/ DebugAssert("e:\\hs\\MdePkg\\Library\\BaseDebugLibSerialPort\\DebugLib.c", 0x4Fu, "Format != ((void *) 0)"); /*0xaa4*/ - if ( ((unsigned int)sub_12C24() & ErrorLevel_1) != 0 ) /*0xab4*/ + if ( ((unsigned int)GetDebugMask() & ErrorLevel_1) != 0 ) /*0xab4*/ { AsciiVSPrint((CHAR8 *)_r_n, 0x100u, 0, (VA_LIST)Format); /*0xad3*/ NumberOfBytes = Assert_41(_r_n, v5, v6, v2); /*0xadd*/ @@ -46,7 +46,7 @@ Assert_9(_r_n, 0x100u, "ASSERT [%a] %a(%d): %a\n", v3, *(double *)&FileName, LineNumber, *(double *)&Description); v6 = Assert_41(_r_n, v4, v5, v3); /*0xb34*/ - sub_12B7C(_r_n, v6); /*0xb41*/ + SerialPortWrite(_r_n, v6); /*0xb41*/ } diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/DxeMain/DxeMain.c index 014a6f4..66da5b5 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/DxeMain/DxeMain.c @@ -2031,7 +2031,7 @@ //===================================================================== // Firmware Volume Block Protocol -// Source: MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c (sub_B98) +// Source: MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c //===================================================================== //===================================================================== @@ -2296,4 +2296,4 @@ //===================================================================== // End of DxeCore.c -//===================================================================== \ No newline at end of file +//===================================================================== diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Event/Event.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Event/Event.c index ba52227..a19a95a 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/Event/Event.c @@ -8,12 +8,12 @@ // SetTimer // SetTimer -- Set a timer event (timer delta) // -unsigned __int64 __fastcall SetTimer(__int16 n512, __int64 n8, __int64 sub_A488, __int64 *i, __int64 *a5) +unsigned __int64 __fastcall SetTimer(__int16 n512, __int64 n8, __int64 notifyContext, __int64 *i, __int64 *a5) { if ( (n512 & 0x300) != 0 && (((n8 - 4) & 0xFFFFFFFFFFFFFFF3uLL) != 0 || n8 == 12) ) /*0xaa1c*/ return 0x8000000000000002uLL; /*0xaa1e*/ else - return RegRegister(n512, n8, sub_A488, (__int64)i, 0, a5); /*0xaa3a*/ + return RegRegister(n512, n8, notifyContext, (__int64)i, 0, a5); /*0xaa3a*/ } // SignalEvent diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/PeCoff/PeCoff.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/PeCoff/PeCoff.c index 06a0cbf..fb33d24 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/PeCoff/PeCoff.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction/PeCoff/PeCoff.c @@ -467,7 +467,7 @@ ExtendedDataSize_1 = &unk_22760; /*0x14914*/ if ( ExtendedDataSize ) /*0x1492a*/ ExtendedDataSize_1 = (void *)ExtendedDataSize; /*0x1492a*/ - v13 = sub_146F0(1u, Value, v11, (__int64)ExtendedDataSize_1, (__int64)v18); /*0x1493b*/ + v13 = ReportStatusCode(1u, Value, v11, (__int64)ExtendedDataSize_1, (__int64)v18); /*0x1493b*/ if ( v18 != v15 ) /*0x14946*/ (*((void (**)(void))buf_0 + 9))(); /*0x1494f*/ return v13; /*0x14971*/ diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/RomLayoutDxe/RomLayoutDxe.h b/MdeModulePkg/Core/Dxe/SectionExtraction/RomLayoutDxe/RomLayoutDxe.h index 3480ab1..30e7307 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/RomLayoutDxe/RomLayoutDxe.h +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/RomLayoutDxe/RomLayoutDxe.h @@ -183,7 +183,7 @@ * Module entry point for RomLayoutDxe. * * Initializes UEFI global variables (gImageHandle, gST, gBS, gRT), locates the - * HOB list via sub_5E0(), prints a debug banner via sub_518(), locates the UBA + * HOB list, prints a debug banner, locates the UBA * NeonCityFPGA board-type protocol, and registers the setup configuration data * by calling the protocol's registration function. * @@ -347,4 +347,4 @@ ); } UBA_NEONCITYFPGA_BOARD_TYPE_PROTOCOL; -#endif /* _ROM_LAYOUT_DXE_H_ */ \ No newline at end of file +#endif /* _ROM_LAYOUT_DXE_H_ */ diff --git a/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.c b/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.c index fbd5192..0abf886 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.c +++ b/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.c @@ -11,4 +11,4 @@ // Function: ModuleEntryPoint -EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) sub_15174( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) sub_15174( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) sub_15174( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) sub_15174( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); sub_18470(); return sub_454(); } +EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); InitializeHiiDatabase(); return ReturnStatus(); } diff --git a/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.h b/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.h index ca09b4f..ec46ef6 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.h +++ b/MdeModulePkg/Universal/PCD/Dxe/HiiDatabase/HiiDatabase.h @@ -24,30 +24,30 @@ ); /// -/// sub_15174 +/// DebugAssertPrint /// EFI_STATUS EFIAPI -sub_15174( +DebugAssertPrint( VOID ); /// -/// sub_18470 +/// InitializeHiiDatabase /// EFI_STATUS EFIAPI -sub_18470( +InitializeHiiDatabase( VOID ); /// -/// sub_454 +/// ReturnStatus /// EFI_STATUS EFIAPI -sub_454( +ReturnStatus( VOID ); -#endif /* __HIIDATABASE_H__ */ \ No newline at end of file +#endif /* __HIIDATABASE_H__ */ diff --git a/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.c b/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.c index 191c28c..2214b24 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.c +++ b/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.c @@ -11,4 +11,4 @@ // Function: ModuleEntryPoint -EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) sub_B88( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) sub_B88("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) sub_B88("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) sub_B88( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); sub_F30(); return sub_8D4(); } +EFI_STATUS ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) DebugAssertPrint("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) DebugAssertPrint("e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); InitializeHstiPlatform(); return ReturnStatus(); } diff --git a/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.h b/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.h index f8f2c5b..d656bd4 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.h +++ b/MdeModulePkg/Universal/PCD/Dxe/HstiPlatformDxe/HstiPlatformDxe.h @@ -24,30 +24,30 @@ ); /// -/// sub_B88 +/// DebugAssertPrint /// EFI_STATUS EFIAPI -sub_B88( +DebugAssertPrint( VOID ); /// -/// sub_F30 +/// InitializeHstiPlatform /// EFI_STATUS EFIAPI -sub_F30( +InitializeHstiPlatform( VOID ); /// -/// sub_8D4 +/// ReturnStatus /// EFI_STATUS EFIAPI -sub_8D4( +ReturnStatus( VOID ); -#endif /* __HSTIPLATFORMDXE_H__ */ \ No newline at end of file +#endif /* __HSTIPLATFORMDXE_H__ */ diff --git a/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.c b/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.c index 96645df..24fc07c 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.c +++ b/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.c @@ -15,28 +15,28 @@ { ::ImageHandle = (__int64)ImageHandle; if ( !ImageHandle ) - sub_880( + DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 51, "gImageHandle != ((void *) 0)"); ::SystemTable = (__int64)SystemTable; if ( !SystemTable ) - sub_880( + DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 57, "gST != ((void *) 0)"); BootServices = (__int64)SystemTable->BootServices; if ( !BootServices ) - sub_880( + DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiBootServicesTableLib\\UefiBootServicesTableLib.c", 63, "gBS != ((void *) 0)"); RuntimeServices = (__int64)SystemTable->RuntimeServices; if ( !RuntimeServices ) - sub_880( + DebugAssertPrint( "e:\\hs\\MdePkg\\Library\\UefiRuntimeServicesTableLib\\UefiRuntimeServicesTableLib.c", 47, "gRT != ((void *) 0)"); - sub_8CC(); - return sub_430(); + InitializeOemVtdRmrr(); + return ReturnStatus(); } diff --git a/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.h b/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.h index 280992d..016f55f 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.h +++ b/MdeModulePkg/Universal/PCD/Dxe/OemVtdRmrr/OemVtdRmrr.h @@ -24,30 +24,30 @@ ); /// -/// sub_880 +/// DebugAssertPrint /// EFI_STATUS EFIAPI -sub_880( +DebugAssertPrint( VOID ); /// -/// sub_8CC +/// InitializeOemVtdRmrr /// EFI_STATUS EFIAPI -sub_8CC( +InitializeOemVtdRmrr( VOID ); /// -/// sub_430 +/// ReturnStatus /// EFI_STATUS EFIAPI -sub_430( +ReturnStatus( VOID ); -#endif /* __OEMVTDRMRR_H__ */ \ No newline at end of file +#endif /* __OEMVTDRMRR_H__ */ diff --git a/MdeModulePkg/Universal/PCD/Dxe/PasswordCheck/PasswordCheck.c b/MdeModulePkg/Universal/PCD/Dxe/PasswordCheck/PasswordCheck.c index 4982352..bafcdab 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/PasswordCheck/PasswordCheck.c +++ b/MdeModulePkg/Universal/PCD/Dxe/PasswordCheck/PasswordCheck.c @@ -167,7 +167,7 @@ } // ============================================================================ -// Date/time to epoch seconds (sub_48C) +// Date/time to epoch seconds // ============================================================================ /** @@ -250,7 +250,7 @@ // ============================================================================ /** - * GetMinPasswordLength - sub_70C + * GetMinPasswordLength * * Reads the "Setup" UEFI variable (GUID unk_1B80, size 814 bytes) and returns * the minimum password length field from offset 12. Falls back to 8 if the @@ -306,7 +306,7 @@ } /** - * CheckTimeLockout - sub_7C8 + * CheckTimeLockout * * Reads the password save timestamp variable (PapSaveTimeStamp / PopSaveTimeStamp), * gets the current time, and determines whether the lockout period (configured @@ -415,7 +415,7 @@ } /** - * CheckPasswordHistory - sub_944 + * CheckPasswordHistory * * Searches the password history variable (PapSaveHistory / PopSaveHistory) for * a match against the proposed password. Each history entry is 40 bytes. @@ -535,7 +535,7 @@ } /** - * SavePasswordWithHistory - sub_AA0 + * SavePasswordWithHistory * * Saves a new password into history and records a timestamp. * - If password is empty string: deletes the timestamp variable. @@ -674,7 +674,7 @@ } /** - * GetRemainingLockoutDays - sub_CB4 + * GetRemainingLockoutDays * * Returns the number of lockout days remaining before the password can be * changed again. Compares the current time against the save timestamp and @@ -788,7 +788,7 @@ } /** - * GetRemainingLockoutMinutes - sub_E4C + * GetRemainingLockoutMinutes * * Reads the "HaltStamp" variable (set when max verify attempts is exceeded) * and checks whether the cooldown period has elapsed. If the cooldown has @@ -895,7 +895,7 @@ } /** - * GetRemainingVerifyCount - sub_FC4 + * GetRemainingVerifyCount * * Reads the verify counter variable (PapVerifyCnt / PopVerifyCnt) and returns * how many attempts remain before lockout. @@ -988,7 +988,7 @@ } /** - * ManageVerifyCounters - sub_10DC + * ManageVerifyCounters * * Manages the verify attempt counters and lockout mechanism. * @@ -1171,7 +1171,7 @@ } /** - * LocateDebugProtocol - sub_12C0 + * LocateDebugProtocol * * Locates the debug print protocol via gBS->LocateProtocol using GUID unk_1B60. * Caches the result in gDebugProtocol for subsequent calls. @@ -1222,7 +1222,7 @@ } /** - * DebugPrint - sub_1340 + * DebugPrint * * Prints a debug message using the debug protocol, subject to error level * filtering via CheckCmosReset(). @@ -1260,7 +1260,7 @@ } /** - * DebugAssertPrint - sub_1388 + * DebugAssertPrint * * Calls the debug protocol's assertion handler. Used by the ASSERT macros * from MdePkg. @@ -1290,7 +1290,7 @@ } /** - * GetHobList - sub_13C8 + * GetHobList * * Locates the HOB (Hand-Off Block) list by scanning the system table's * configuration table for a matching GUID (gHobListGuid). Caches the result @@ -1356,7 +1356,7 @@ } /** - * ReadUnaligned64 - sub_1560 + * ReadUnaligned64 * * Reads a 64-bit value from a potentially unaligned address. * From MdePkg BaseLib. @@ -1381,7 +1381,7 @@ } /** - * CompareGuid - sub_14F0 + * CompareGuid * * Compares two GUIDs by comparing their first and second 64-bit halves. * @@ -1400,7 +1400,7 @@ } /** - * CheckCmosReset - sub_14A0 + * CheckCmosReset * * Reads the CMOS status register (0x4B) to detect a system reset or CMOS * clear event. The returned value is an error level mask used by the debug @@ -1465,4 +1465,4 @@ // unk_1B80: GUID for password policy UEFI variables // unk_1B90: GUID for the protocol installed by this module // off_1BA0: Protocol interface structure pointer -// \ No newline at end of file +// diff --git a/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part2.c b/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part2.c index 55d3c0a..50109e7 100644 --- a/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part2.c +++ b/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part2.c @@ -24394,7 +24394,7 @@ return 0; /*0xffc69c69*/ } -// Function: sub_FFC69C71 @ 0xffc69c71 (0x17d bytes) +// Function: KtiTopologyTreeBuild @ 0xffc69c71 (0x17d bytes) // Index: 888/2560 // Function: KtiTopologyPathCheck @ 0xffc69dee (0x227 bytes) @@ -24943,7 +24943,7 @@ i = v7 & 0x3E | i & 0xFFFFF0C1 | (4 * (v7 & 0x3C0)); /*0xffc6abaa*/ if ( ProcCommonFuncA638(__return_address, a2 + 24 * (unsigned __int8)a3 + 132, &i) != 1 ) { - if ( sub_FFC69C71(__return_address, a2, a3, p_n66588417, &i, n4) ) + if ( KtiTopologyTreeBuild(__return_address, a2, a3, p_n66588417, &i, n4) ) { RcAssertPrint( /*0xffc6abf5*/ __return_address, @@ -25307,7 +25307,7 @@ return 0; /*0xffc6b16a*/ } -// Function: sub_FFC6B187 @ 0xffc6b187 (0x14f bytes) +// Function: KtiPortMaskUpdate @ 0xffc6b187 (0x14f bytes) // Index: 901/2560 // Function: KtiPortConnectionResolve @ 0xffc6b2d6 (0x1ff bytes) @@ -25576,7 +25576,7 @@ KtiDebugAssert((int)__return_address_1, 220, 9); /*0xffc6b77a*/ v19 = v25; /*0xffc6b77f*/ } - sub_FFC6B187(__return_address_1, n4_1, buf, (p_i >> 1) & 7, (*v9 >> 1) & 7, *(_DWORD *)ia, v19, p_p_i, 1, v26); /*0xffc6b791*/ + KtiPortMaskUpdate(__return_address_1, n4_1, buf, (p_i >> 1) & 7, (*v9 >> 1) & 7, *(_DWORD *)ia, v19, p_p_i, 1, v26); /*0xffc6b791*/ } else { @@ -25598,7 +25598,7 @@ "FALSE"); KtiDebugAssert((int)__return_address_1, 220, 9); /*0xffc6b7f4*/ } - sub_FFC6B187( /*0xffc6b82a*/ + KtiPortMaskUpdate( /*0xffc6b82a*/ __return_address_1, n4_1, buf, diff --git a/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part5.c b/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part5.c index 2b7c9e7..f4c8a83 100644 --- a/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part5.c +++ b/PurleySktPkg/Pei/UncoreInit/UncoreInit/UncoreInitPeim/UncoreInitPeim_part5.c @@ -13883,7 +13883,7 @@ { if ( ((1 << (char)bufa_1) & n2) != 0 ) /*0xffd0b66e*/ { - v9 = sub_FFD0B1AA(n6, buf, n6a, (_BYTE)v13, a5, a6); /*0xffd0b683*/ + v9 = IioTailX_FFD0B1AA(n6, buf, n6a, (_BYTE)v13, a5, a6); /*0xffd0b683*/ v10 = v12; /*0xffd0b688*/ if ( v12 == v9 ) /*0xffd0b691*/ { @@ -20297,7 +20297,7 @@ n4_1 = *(v7 - 2); /*0xffd159a9*/ if ( n4_1 == 4 || n4_1 == 5 ) /*0xffd159b6*/ { - sub_FFD15BDC((int)srca, n4, n0x15, n4_1, *(_DWORD *)(v7 + 2), *(_DWORD *)(v7 + 42)); /*0xffd15b66*/ + IioTailX_FFD15BDC((int)srca, n4, n0x15, n4_1, *(_DWORD *)(v7 + 2), *(_DWORD *)(v7 + 42)); /*0xffd15b66*/ LABEL_50: n0x15_1 = n0x15; /*0xffd15b6e*/ goto LABEL_51; /*0xffd15b6e*/ @@ -21003,7 +21003,7 @@ if ( !*(_BYTE *)(a2 + 6282) ) /*0xffd1672c*/ IioTailX_FFD1871B(i, a2 + 12, a2 + 36, a2 + 223, 0, (int *)(a2 + 2208)); /*0xffd1674c*/ - if ( IioTailX_FFD1CD6C(i, a2, a3, 53, 0) || (unsigned __int8)sub_FFD1664D(i, a2, 0, 0) ) /*0xffd1677c*/ + if ( IioTailX_FFD1CD6C(i, a2, a3, 53, 0) || (unsigned __int8)IioTailX_FFD1664D(i, a2, 0, 0) ) /*0xffd1677c*/ return 1; /*0xffd1677c*/ if ( a3 ) /*0xffd1678a*/ IioTailFunc7DEF(i, a2 + 12, a2 + 36, a2 + 2362, (int *)(a2 + 223)); /*0xffd167a3*/ @@ -21054,7 +21054,7 @@ if ( !*(_BYTE *)(a2 + 6282) ) /*0xffd1684e*/ IioTailX_FFD1871B(i, a2 + 12, a2 + 36, a2 + 223, 0, (int *)(a2 + 2208)); /*0xffd16870*/ - if ( IioTailX_FFD1CD6C(i, a2, a3, 104, 0) || (unsigned __int8)sub_FFD1664D(i, a2, 0, 0) ) /*0xffd1689c*/ + if ( IioTailX_FFD1CD6C(i, a2, a3, 104, 0) || (unsigned __int8)IioTailX_FFD1664D(i, a2, 0, 0) ) /*0xffd1689c*/ return 1; /*0xffd1689c*/ if ( !a5 ) /*0xffd168ab*/ *(_DWORD *)(a2 + 743) = 1; /*0xffd168ad*/ @@ -21094,7 +21094,7 @@ if ( IioTailX_FFD1CD6C(i, a2, 0, 104, 0) ) /*0xffd16951*/ return 1; /*0xffd1695d*/ IioTailX_FFD17FC0(i, a2 + 12, a2 + 36, (int *)(a2 + 223)); /*0xffd16975*/ - if ( (unsigned __int8)sub_FFD1664D(i, a2, 0, 0) ) /*0xffd1697e*/ + if ( (unsigned __int8)IioTailX_FFD1664D(i, a2, 0, 0) ) /*0xffd1697e*/ return 1; /*0xffd1697e*/ v3 = (_BYTE *)(a2 + 415); /*0xffd1698c*/ *(_BYTE *)(a2 + 2153) = 1; /*0xffd16992*/ @@ -21208,7 +21208,7 @@ IioTailX_FFD1816D((int)i, (int)v15, (int)buf_1, buf_2, 0, (int)v7); /*0xffd16c55*/ IioTailX_FFD1820F((int)i, (int)v15, (int)buf_1, buf_2, 0, (int)v6); /*0xffd16c79*/ IioTailFunc6DA4(buf_2, 0, 0x104u); /*0xffd16c8f*/ - if ( IioLateInitFuncE8A4(i, &buf__1, sub_FFD16844, sub_FFD1671F, sub_FFD16913, 0) ) /*0xffd16cad*/ + if ( IioLateInitFuncE8A4(i, &buf__1, IioTailX_FFD16844, IioTailX_FFD1671F, IioTailX_FFD16913, 0) ) /*0xffd16cad*/ return 1; /*0xffd16cad*/ IioTailX_FFD1871B((int)i, (int)v15, (int)buf_1, (int)buf_2, 1, v19); /*0xffd16cdf*/ if ( IioTailX_FFD1CD6C((int)i, (int)&buf__1, 0, 104, 0) ) /*0xffd16cf3*/ @@ -22731,11 +22731,11 @@ // Function: IioTailX_FFD182B1 @ 0xffd182b1 (0x15 bytes) // Index: 2475/2560 -char __cdecl IioTailX_FFD182B1(int a1, int sub_FFD1E74E, int a3) +char __cdecl IioTailX_FFD182B1(int a1, int iioTailState, int a3) { if ( !a3 ) /*0xffd182b7*/ return 1; /*0xffd182c3*/ - *(_DWORD *)(a3 + 57) = sub_FFD1E74E; /*0xffd182bd*/ + *(_DWORD *)(a3 + 57) = iioTailState; /*0xffd182bd*/ return 0; /*0xffd182c2*/ } @@ -24033,7 +24033,7 @@ int a4, _DWORD *a5, _DWORD *n4, - int sub_FFD1E74E, + int iioTailState, int a8, int a9, int a10, @@ -24069,7 +24069,7 @@ buf = (_BYTE *)*a14; /*0xffd1ae57*/ } *buf = a11; /*0xffd1ae6d*/ - *(_DWORD *)(buf + 57) = sub_FFD1E74E; /*0xffd1ae74*/ + *(_DWORD *)(buf + 57) = iioTailState; /*0xffd1ae74*/ *(_DWORD *)(buf + 61) = a8; /*0xffd1ae80*/ *(_DWORD *)(buf + 65) = a9; /*0xffd1ae87*/ buf[69] = a10; /*0xffd1ae8f*/ @@ -25384,7 +25384,7 @@ } } -// Function: sub_FFD1C315 @ 0xffd1c315 (0x529 bytes) +// Function: IioTailX_FFD1C315 @ 0xffd1c315 (0x529 bytes) // Index: 2511/2560 // Function: IioTailX_FFD1C83E @ 0xffd1c83e (0x35f bytes) @@ -25871,13 +25871,13 @@ return IioTailFunc71AF(__return_address, v5 + 12, v5 + 36, v6, *(_DWORD *)(v5 + 8)) != 0; /*0xffd1d032*/ } -// Function: sub_FFD1D03A @ 0xffd1d03a (0x1ec bytes) +// Function: IioTailX_FFD1D03A @ 0xffd1d03a (0x1ec bytes) // Index: 2516/2560 -// Function: sub_FFD1D226 @ 0xffd1d226 (0x275 bytes) +// Function: IioTailX_FFD1D226 @ 0xffd1d226 (0x275 bytes) // Index: 2517/2560 -// Function: sub_FFD1D49B @ 0xffd1d49b (0x4fd bytes) +// Function: IioTailX_FFD1D49B @ 0xffd1d49b (0x4fd bytes) // Index: 2518/2560 // Function: IioTailX_FFD1D998 @ 0xffd1d998 (0x11 bytes) @@ -25889,7 +25889,7 @@ return a1; /*0xffd1d9a8*/ } -// Function: sub_FFD1D9A9 @ 0xffd1d9a9 (0x668 bytes) +// Function: IioTailX_FFD1D9A9 @ 0xffd1d9a9 (0x668 bytes) // Index: 2520/2560 // Function: IioTailX_FFD1E011 @ 0xffd1e011 (0xdc bytes) @@ -26408,9 +26408,9 @@ bool __cdecl IioLateInitFuncE8A4( _DWORD *i, int *buf, - int (__cdecl *sub_FFD16844)(int, int, int, int, char), - int (__cdecl *sub_FFD1671F)(int, int, int, int), - int (__cdecl *sub_FFD16913)(int, int), + int (__cdecl *IioTailX_FFD16844)(int, int, int, int, char), + int (__cdecl *IioTailX_FFD1671F)(int, int, int, int), + int (__cdecl *IioTailX_FFD16913)(int, int), void (__cdecl *a6)(_DWORD *, int *)) { int *buf_1; // edi @@ -28727,7 +28727,7 @@ int a6, int a7, int a8, - int (__cdecl *sub_FFD1D998)(int, int, int, __int16), + int (__cdecl *IioTailX_FFD1D998)(int, int, int, __int16), int a10, bool (__cdecl *IioTailX_FFD1E011)(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8), int a12, @@ -28779,7 +28779,7 @@ *(_DWORD *)(buf_1 + 3507) = a6; /*0xffd228d0*/ *(_DWORD *)(buf_1 + 3511) = a7; /*0xffd228da*/ *(_DWORD *)(buf_1 + 3515) = a8; /*0xffd228e4*/ - *(_DWORD *)(buf_1 + 3519) = sub_FFD1D998; /*0xffd228ee*/ + *(_DWORD *)(buf_1 + 3519) = IioTailX_FFD1D998; /*0xffd228ee*/ *(_DWORD *)(buf_1 + 3523) = a10; /*0xffd228f8*/ *(_DWORD *)(buf_1 + 3527) = IioTailX_FFD1E011; /*0xffd22902*/ *(_DWORD *)(buf_1 + 3531) = a12; /*0xffd2290c*/ diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f6ec.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f6ec.c index 0ee3ac4..c617e8b 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f6ec.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f6ec.c @@ -1,2 +1,2 @@ // 0xffd7f6ec -{"addr":"0xffd7f6ec","code":"void *__cdecl sub_FFD7F6EC(void *buf, unsigned int count, char value)\n{\n memset(buf, value, count); /*0xffd7f6f9*/\n return buf; /*0xffd7f6ff*/\n}"} \ No newline at end of file +{"addr":"0xffd7f6ec","code":"void *__cdecl FillBuffer(void *buf, unsigned int count, char value)\n{\n memset(buf, value, count); /*0xffd7f6f9*/\n return buf; /*0xffd7f6ff*/\n}"} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f76c.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f76c.c index bdb5671..3626b7e 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f76c.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f76c.c @@ -1,2 +1,2 @@ // 0xffd7f76c -{"addr":"0xffd7f76c","code":"int __cdecl sub_FFD7F76C(int a1, int a2, int a3, int a4)\n{\n do /*0xffd7f785*/\n {\n *(_DWORD *)(a1 + 8 * a2 - 8) = a3; /*0xffd7f77d*/\n *(_DWORD *)(a1 + 8 * a2-- - 4) = a4; /*0xffd7f781*/\n }\n while ( a2 ); /*0xffd7f785*/\n return a1; /*0xffd7f789*/\n}"} \ No newline at end of file +{"addr":"0xffd7f76c","code":"int __cdecl StoreDwordPairs(int a1, int a2, int a3, int a4)\n{\n do /*0xffd7f785*/\n {\n *(_DWORD *)(a1 + 8 * a2 - 8) = a3; /*0xffd7f77d*/\n *(_DWORD *)(a1 + 8 * a2-- - 4) = a4; /*0xffd7f781*/\n }\n while ( a2 ); /*0xffd7f785*/\n return a1; /*0xffd7f789*/\n}"} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f78c.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f78c.c index 47655ce..0da2ac4 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f78c.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f78c.c @@ -1,2 +1,2 @@ // 0xffd7f78c -{"addr":"0xffd7f78c","code":"void *__cdecl sub_FFD7F78C(void *buf, unsigned int count, int value)\n{\n memset32(buf, value, count); /*0xffd7f799*/\n return buf; /*0xffd7f79f*/\n}"} \ No newline at end of file +{"addr":"0xffd7f78c","code":"void *__cdecl FillBuffer32(void *buf, unsigned int count, int value)\n{\n memset32(buf, value, count); /*0xffd7f799*/\n return buf; /*0xffd7f79f*/\n}"} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f9f7.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f9f7.c index 230206e..e496bda 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f9f7.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7f9f7.c @@ -1,2 +1,2 @@ // 0xffd7f9f7 -{"addr":"0xffd7f9f7","code":"int __fastcall sub_FFD7F9F7(unsigned int a1)\n{\n unsigned int v1; // esi\n int n0x400000; // edi\n int v3; // ebx\n int result; // eax\n\n v1 = a1 >> 22; /*0xffd7fa04*/\n n0x400000 = a1 & 0x3FFFFF; /*0xffd7fa07*/\n do /*0xffd7fa3f*/\n {\n v3 = n0x400000 + (sub_FFD8CD6B(1288) & 0xFFFFFF); /*0xffd7fa1c*/\n n0x400000 = 0x400000; /*0xffd7fa1e*/\n while ( ((v3 - sub_FFD8CD6B(1288)) & 0x800000) == 0 ) /*0xffd7fa38*/\n _mm_pause(); /*0xffd7fa25*/\n result = v1--; /*0xffd7fa3a*/\n }\n while ( result ); /*0xffd7fa3f*/\n return result; /*0xffd7fa41*/\n}","refs":[{"addr":"0xffd8cd6b","name":"sub_FFD8CD6B"}]} \ No newline at end of file +{"addr":"0xffd7f9f7","code":"int __fastcall StallForTicks(unsigned int a1)\n{\n unsigned int v1; // esi\n int n0x400000; // edi\n int v3; // ebx\n int result; // eax\n\n v1 = a1 >> 22; /*0xffd7fa04*/\n n0x400000 = a1 & 0x3FFFFF; /*0xffd7fa07*/\n do /*0xffd7fa3f*/\n {\n v3 = n0x400000 + (sub_FFD8CD6B(1288) & 0xFFFFFF); /*0xffd7fa1c*/\n n0x400000 = 0x400000; /*0xffd7fa1e*/\n while ( ((v3 - sub_FFD8CD6B(1288)) & 0x800000) == 0 ) /*0xffd7fa38*/\n _mm_pause(); /*0xffd7fa25*/\n result = v1--; /*0xffd7fa3a*/\n }\n while ( result ); /*0xffd7fa3f*/\n return result; /*0xffd7fa41*/\n}"} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fa46.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fa46.c index 9afceee..bfa4b5d 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fa46.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fa46.c @@ -1,2 +1,2 @@ // 0xffd7fa46 -{"addr":"0xffd7fa46","code":"unsigned int __fastcall sub_FFD7FA46(unsigned int a1)\n{\n unsigned int v2; // eax\n unsigned __int64 v3; // rtt\n\n v2 = (3579545 * (unsigned __int64)a1) >> 32; /*0xffd7fa6c*/\n LODWORD(v3) = 3579545 * a1; /*0xffd7fa7c*/\n HIDWORD(v3) = v2 % 0xF4240; /*0xffd7fa7c*/\n sub_FFD7F9F7(v3 / 0xF4240, v2 / 0xF4240); /*0xffd7fa81*/\n return a1; /*0xffd7fa88*/\n}","refs":[{"addr":"0xffd7f9f7","name":"sub_FFD7F9F7"}]} \ No newline at end of file +{"addr":"0xffd7fa46","code":"unsigned int __fastcall StallMicroseconds(unsigned int a1)\n{\n unsigned int v2; // eax\n unsigned __int64 v3; // rtt\n\n v2 = (3579545 * (unsigned __int64)a1) >> 32; /*0xffd7fa6c*/\n LODWORD(v3) = 3579545 * a1; /*0xffd7fa7c*/\n HIDWORD(v3) = v2 % 0xF4240; /*0xffd7fa7c*/\n StallForTicks(v3 / 0xF4240, v2 / 0xF4240); /*0xffd7fa81*/\n return a1; /*0xffd7fa88*/\n}","refs":[{"addr":"0xffd7f9f7","name":"StallForTicks"}]} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fb51.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fb51.c index f030b1c..6fd5251 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fb51.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/decompiled/ffd7fb51.c @@ -1,2 +1,2 @@ // 0xffd7fb51 -{"addr":"0xffd7fb51","code":"int __thiscall sub_FFD7FB51(unsigned int *this)\n{\n int v2; // esi\n unsigned int v3; // eax\n int v4; // ebx\n int v5; // ebp\n unsigned int v7; // [esp+8h] [ebp-4h]\n\n v2 = 0; /*0xffd7fb56*/\n v3 = *this; /*0xffd7fb58*/\n v7 = *this; /*0xffd7fb5a*/\n if ( *this ) /*0xffd7fb58*/\n {\n while ( 1 ) /*0xffd7fb68*/\n {\n v4 = v3 - v2 - 1; /*0xffd7fb68*/\n v5 = 40 * v4; /*0xffd7fb69*/\n if ( !*((_QWORD *)this + 5 * v4 + 5) /*0xffd7fba8*/\n && *(_UNKNOWN **)((char *)this + v5 + 8) == &unk_FFD97F8C\n && *(unsigned int *)((char *)this + v5 + 12) == (*(this + 10 * v4 + 11) | *(this + 10 * v4 + 10))\n && !sub_FFD8D0FF(7)\n && !sub_FFD8D0FF(7) )\n {\n break; /*0xffd7fba8*/\n }\n v3 = v7; /*0xffd7fbb2*/\n if ( ++v2 >= v7 ) /*0xffd7fbb9*/\n return v2; /*0xffd7fbb9*/\n }\n return v4; /*0xffd7fbbd*/\n }\n return v2; /*0xffd7fbc1*/\n}","refs":[{"addr":"0xffd97f8c","name":"unk_FFD97F8C"},{"addr":"0xffd8d0ff","name":"sub_FFD8D0FF"}]} \ No newline at end of file +{"addr":"0xffd7fb51","code":"int __thiscall FindLatestPerformanceEntry(unsigned int *this)\n{\n int v2; // esi\n unsigned int v3; // eax\n int v4; // ebx\n int v5; // ebp\n unsigned int v7; // [esp+8h] [ebp-4h]\n\n v2 = 0; /*0xffd7fb56*/\n v3 = *this; /*0xffd7fb58*/\n v7 = *this; /*0xffd7fb5a*/\n if ( *this ) /*0xffd7fb58*/\n {\n while ( 1 ) /*0xffd7fb68*/\n {\n v4 = v3 - v2 - 1; /*0xffd7fb68*/\n v5 = 40 * v4; /*0xffd7fb69*/\n if ( !*((_QWORD *)this + 5 * v4 + 5) /*0xffd7fba8*/\n && *(_UNKNOWN **)((char *)this + v5 + 8) == &unk_FFD97F8C\n && *(unsigned int *)((char *)this + v5 + 12) == (*(this + 10 * v4 + 11) | *(this + 10 * v4 + 10))\n && !sub_FFD8D0FF(7)\n && !sub_FFD8D0FF(7) )\n {\n break; /*0xffd7fba8*/\n }\n v3 = v7; /*0xffd7fbb2*/\n if ( ++v2 >= v7 ) /*0xffd7fbb9*/\n return v2; /*0xffd7fbb9*/\n }\n return v4; /*0xffd7fbbd*/\n }\n return v2; /*0xffd7fbc1*/\n}"}