Address review comments

This commit is contained in:
Nikolaj Schlej 2025-03-13 19:19:17 +07:00
parent 9719b0cf03
commit a12be6bfc7
2 changed files with 4 additions and 3 deletions

View file

@ -329,6 +329,7 @@ typedef struct PHOENIX_FLASH_MAP_ENTRY_ {
UINT32 Offset; UINT32 Offset;
} PHOENIX_FLASH_MAP_ENTRY; } PHOENIX_FLASH_MAP_ENTRY;
#define NVRAM_PHOENIX_FLASH_MAP_TOTAL_SIZE 0x1000 #define NVRAM_PHOENIX_FLASH_MAP_TOTAL_SIZE 0x1000
#define NVRAM_PHOENIX_FLASH_MAP_MAX_ENTRIES 113
#define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_VOLUME 0x0000 #define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_VOLUME 0x0000
#define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_DATA_BLOCK 0x0001 #define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_DATA_BLOCK 0x0001

View file

@ -494,7 +494,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
+ (variable->attributes()->time_based_auth() << 5) + (variable->attributes()->time_based_auth() << 5)
+ (variable->attributes()->append_write() << 6) + (variable->attributes()->append_write() << 6)
+ (UINT32)(variable->attributes()->reserved() << 7) + (UINT32)(variable->attributes()->reserved() << 7)
+ (variable->attributes()->apple_data_checksum() << 31); + (UINT32)(variable->attributes()->apple_data_checksum() << 31);
// Add generic info // Add generic info
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nReserved: %02Xh\nAttributes: %08Xh (", info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nReserved: %02Xh\nAttributes: %08Xh (",
@ -976,7 +976,7 @@ not_sysf:
// Perform initial sanity check // Perform initial sanity check
const PHOENIX_FLASH_MAP_HEADER* storeHeader = (const PHOENIX_FLASH_MAP_HEADER*)(volumeBody.constData() + storeOffset); const PHOENIX_FLASH_MAP_HEADER* storeHeader = (const PHOENIX_FLASH_MAP_HEADER*)(volumeBody.constData() + storeOffset);
if (UByteArray((const char*)storeHeader->Signature, NVRAM_PHOENIX_FLASH_MAP_SIGNATURE_LENGTH) != NVRAM_PHOENIX_FLASH_MAP_SIGNATURE if (UByteArray((const char*)storeHeader->Signature, NVRAM_PHOENIX_FLASH_MAP_SIGNATURE_LENGTH) != NVRAM_PHOENIX_FLASH_MAP_SIGNATURE
|| storeHeader->NumEntries > 113) { || storeHeader->NumEntries > NVRAM_PHOENIX_FLASH_MAP_MAX_ENTRIES) {
// No need to parse further, not a Phoenix Flash Map // No need to parse further, not a Phoenix Flash Map
goto not_flm; goto not_flm;
} }