mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-09 13:52:01 -04:00
Add Phoenix CMDB parser
This commit is contained in:
parent
01e2e0877b
commit
fd0faea9ea
2 changed files with 42 additions and 3 deletions
|
@ -414,7 +414,7 @@ typedef struct PHOENIX_CMDB_HEADER_ {
|
|||
} PHOENIX_CMDB_HEADER;
|
||||
|
||||
#define NVRAM_PHOENIX_CMDB_HEADER_SIGNATURE 0x42444D43
|
||||
#define NVRAM_PHOENIX_CMDB_SIZE 0x100;
|
||||
#define NVRAM_PHOENIX_CMDB_SIZE 0x100
|
||||
|
||||
// Zero GUID
|
||||
extern const UByteArray ZERO_GUID;
|
||||
|
|
|
@ -1216,9 +1216,48 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
|
|||
} catch (...) {
|
||||
// Parsing failed, try something else
|
||||
}
|
||||
// Phoenix CMDB
|
||||
|
||||
// Phoenix SLIC Pubkey/Marker
|
||||
// Phoenix CMDB
|
||||
try {
|
||||
if (volumeBodySize - storeOffset < NVRAM_PHOENIX_CMDB_SIZE) {
|
||||
// No need to parse further, the rest of the volume is too small
|
||||
throw 0;
|
||||
}
|
||||
|
||||
UINT32 storeSize = NVRAM_PHOENIX_CMDB_SIZE;
|
||||
UByteArray cmdb = volumeBody.mid(storeOffset, storeSize);
|
||||
|
||||
// Get store header
|
||||
const PHOENIX_CMDB_HEADER* cmdbHeader = (const PHOENIX_CMDB_HEADER*)cmdb.constData();
|
||||
|
||||
if (cmdbHeader->Signature != NVRAM_PHOENIX_CMDB_HEADER_SIGNATURE) {
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// Construct header and body
|
||||
header = cmdb.left(cmdbHeader->TotalSize);
|
||||
body = cmdb.mid(cmdbHeader->TotalSize, storeSize - cmdbHeader->TotalSize);
|
||||
|
||||
// Add info
|
||||
name = UString("CMDB store");
|
||||
info = usprintf("Signature: CMDB\nFull size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)",
|
||||
storeSize, storeSize,
|
||||
(UINT32)header.size(), (UINT32)header.size(),
|
||||
(UINT32)body.size(), (UINT32)body.size());
|
||||
|
||||
// Add tree item
|
||||
model->addItem(storeOffset, Types::CmdbStore, 0, name, UString(), info, header, body, UByteArray(), Fixed, index);
|
||||
|
||||
storeOffset += storeSize - 1;
|
||||
previousStoreEndOffset = storeOffset + 1;
|
||||
continue;
|
||||
} catch (...) {
|
||||
// Parsing failed, try something else
|
||||
}
|
||||
|
||||
// Phoenix SLIC Pubkey
|
||||
|
||||
// Phoenix SLIC Marker
|
||||
|
||||
// Intel uCode
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue