UT NE A26

- NVRAM parsing code refactored
- Missing entries added to NVRAM-related infos
- Various small bugfixes here and there
This commit is contained in:
Nikolaj Schlej 2016-04-18 15:10:07 +02:00
parent dd0efa2410
commit 9c5818bb16
8 changed files with 777 additions and 632 deletions

View File

@ -299,7 +299,7 @@ void UEFITool::goToData()
for (int i = index.row(); i < model->rowCount(parent); i++) {
PARSING_DATA pdata = parsingDataFromQModelIndex(index);
UINT32 lastVariableFlag = pdata.emptyByte ? 0xFFFFFF : 0;
if (pdata.nvram.nvar.next == lastVariableFlag) {
if (pdata.nvar.next == lastVariableFlag) {
ui->structureTreeView->scrollTo(index, QAbstractItemView::PositionAtCenter);
ui->structureTreeView->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Rows | QItemSelectionModel::Clear);
}
@ -307,7 +307,7 @@ void UEFITool::goToData()
for (int j = i + 1; j < model->rowCount(parent); j++) {
QModelIndex currentIndex = parent.child(j, 0);
PARSING_DATA currentPdata = parsingDataFromQModelIndex(currentIndex);
if (currentPdata.offset == pdata.offset + pdata.nvram.nvar.next) {
if (currentPdata.offset == pdata.offset + pdata.nvar.next) {
index = currentIndex;
break;
}

View File

@ -511,12 +511,18 @@ Returns:
mText[i] = 0;
}
mLevel = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mLevel));
mChildCount = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mChildCount));
mPosition = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mPosition));
mParent = malloc (WNDSIZ * 2 * sizeof(*mParent));
mPrev = malloc (WNDSIZ * 2 * sizeof(*mPrev));
mNext = malloc ((MAX_HASH_VAL + 1) * sizeof(*mNext));
mLevel = malloc((WNDSIZ + UINT8_MAX + 1) * sizeof(*mLevel));
if (!mLevel) return EFI_OUT_OF_RESOURCES;
mChildCount = malloc((WNDSIZ + UINT8_MAX + 1) * sizeof(*mChildCount));
if (!mChildCount) return EFI_OUT_OF_RESOURCES;
mPosition = malloc((WNDSIZ + UINT8_MAX + 1) * sizeof(*mPosition));
if (!mPosition) return EFI_OUT_OF_RESOURCES;
mParent = malloc(WNDSIZ * 2 * sizeof(*mParent));
if (!mParent) return EFI_OUT_OF_RESOURCES;
mPrev = malloc(WNDSIZ * 2 * sizeof(*mPrev));
if (!mPrev) return EFI_OUT_OF_RESOURCES;
mNext = malloc((MAX_HASH_VAL + 1) * sizeof(*mNext));
if (!mNext) return EFI_OUT_OF_RESOURCES;
mBufSiz = 16 * 1024U;
while ((mBuf = malloc(mBufSiz)) == NULL) {

View File

@ -19,17 +19,13 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QString>
#include "basetypes.h"
// C++ functions
// GUID to QString routine
extern QString guidToQString(const EFI_GUID& guid);
// File type to QString routine
extern QString fileTypeToQString(const UINT8 type);
// Section type to QString routine
extern QString sectionTypeToQString(const UINT8 type);
// Make sure we use right packing rules
#pragma pack(push,1)
extern QString guidToQString(const EFI_GUID& guid);
extern QString fileTypeToQString(const UINT8 type);
extern QString sectionTypeToQString(const UINT8 type);
//*****************************************************************************
// EFI Capsule
//*****************************************************************************
@ -517,7 +513,7 @@ typedef struct EFI_FREEFORM_SUBTYPE_GUID_SECTION2_ {
EFI_GUID SubTypeGuid;
} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;
// Phoenix SCT and HP postcode section
// Phoenix SCT and Insyde postcode section
typedef struct POSTCODE_SECTION_ {
UINT8 Size[3];
UINT8 Type;
@ -563,13 +559,13 @@ typedef EFI_COMMON_SECTION_HEADER2 EFI_USER_INTERFACE_SECTION2;
///
/// If present, this must be the first and only opcode,
/// EFI_DEP_BEFORE is only used by DXE driver.
/// EFI_DEP_BEFORE is only used by DXE drivers
///
#define EFI_DEP_BEFORE 0x00
///
/// If present, this must be the first and only opcode,
/// EFI_DEP_AFTER is only used by DXE driver.
/// EFI_DEP_AFTER is only used by DXE drivers
///
#define EFI_DEP_AFTER 0x01

File diff suppressed because it is too large Load Diff

View File

@ -56,6 +56,10 @@ public:
private:
TreeModel *model;
std::vector<std::pair<QString, QModelIndex> > messagesVector;
void msg(const QString & message, const QModelIndex &index = QModelIndex()) {
messagesVector.push_back(std::pair<QString, QModelIndex>(message, index));
};
QModelIndex lastVtf;
UINT32 capsuleOffsetFixup;
@ -113,25 +117,21 @@ private:
STATUS parseStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseNvarStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseVssStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseFtwStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseFdcStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseFsysStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseEvsaStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseFlashMapStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseCmdbStore(const QByteArray & data, const QModelIndex & index);
//STATUS parseSlicData(const QByteArray & data, const QModelIndex & index);
//STATUS parseMicrocode(const QByteArray & data, const QModelIndex & index);
STATUS parseVssStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseFtwStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseFdcStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseFsysStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseEvsaStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseFlashMapStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseCmdbStoreHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseSlicPubkeyHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseSlicMarkerHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseIntelMicrocodeHeader(const QByteArray & store, const UINT32 parentOffset, const QModelIndex & parent, QModelIndex & index);
STATUS parseVssStoreBody(const QModelIndex & index);
STATUS parseFsysStoreBody(const QModelIndex & index);
STATUS parseEvsaStoreBody(const QModelIndex & index);
STATUS parseFlashMapBody(const QModelIndex & index);
// Message helper
void msg(const QString & message, const QModelIndex &index = QModelIndex()) {
messagesVector.push_back(std::pair<QString, QModelIndex>(message, index));
};
};
#endif // FFSPARSER_H

View File

@ -20,14 +20,57 @@ QString nvarAttributesToQString(const UINT8 attributes)
return QString();
QString str;
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_RUNTIME) str += QObject::tr(", Runtime");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_ASCII_NAME) str += QObject::tr(", AsciiName");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_GUID) str += QObject::tr(", Guid");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_DATA_ONLY) str += QObject::tr(", DataOnly");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_EXT_HEADER) str += QObject::tr(", ExtHeader");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_HW_ERROR_RECORD) str += QObject::tr(", HwErrorRecord");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_AUTH_WRITE) str += QObject::tr(", AuthWrite");
if (attributes & NVRAM_NVAR_ENTRY_ATTRIB_VALID) str += QObject::tr(", Valid");
if (attributes & NVRAM_NVAR_ENTRY_RUNTIME) str += QObject::tr(", Runtime");
if (attributes & NVRAM_NVAR_ENTRY_ASCII_NAME) str += QObject::tr(", AsciiName");
if (attributes & NVRAM_NVAR_ENTRY_GUID) str += QObject::tr(", Guid");
if (attributes & NVRAM_NVAR_ENTRY_DATA_ONLY) str += QObject::tr(", DataOnly");
if (attributes & NVRAM_NVAR_ENTRY_EXT_HEADER) str += QObject::tr(", ExtHeader");
if (attributes & NVRAM_NVAR_ENTRY_HW_ERROR_RECORD) str += QObject::tr(", HwErrorRecord");
if (attributes & NVRAM_NVAR_ENTRY_AUTH_WRITE) str += QObject::tr(", AuthWrite");
if (attributes & NVRAM_NVAR_ENTRY_VALID) str += QObject::tr(", Valid");
return str.mid(2); // Remove first comma and space
}
QString nvarExtendedAttributesToQString(const UINT8 attributes)
{
QString str;
if (attributes & NVRAM_NVAR_ENTRY_EXT_CHECKSUM) str += QObject::tr(", Checksum");
if (attributes & NVRAM_NVAR_ENTRY_EXT_AUTH_WRITE) str += QObject::tr(", AuthWrite");
if (attributes & NVRAM_NVAR_ENTRY_EXT_TIME_BASED) str += QObject::tr(", TimeBasedAuthWrite");
if (attributes & NVRAM_NVAR_ENTRY_EXT_UNKNOWN_MASK) str += QObject::tr(", Unknown");
return str.mid(2); // Remove first comma and space
}
extern QString vssAttributesToQString(const UINT32 attributes)
{
QString str;
if (attributes & NVRAM_VSS_VARIABLE_NON_VOLATILE) str += QObject::tr(", NonVolatile");
if (attributes & NVRAM_VSS_VARIABLE_BOOTSERVICE_ACCESS) str += QObject::tr(", BootService");
if (attributes & NVRAM_VSS_VARIABLE_RUNTIME_ACCESS) str += QObject::tr(", Runtime");
if (attributes & NVRAM_VSS_VARIABLE_HARDWARE_ERROR_RECORD) str += QObject::tr(", HwErrorRecord");
if (attributes & NVRAM_VSS_VARIABLE_AUTHENTICATED_WRITE_ACCESS) str += QObject::tr(", AuthWrite");
if (attributes & NVRAM_VSS_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) str += QObject::tr(", TimeBasedAuthWrite");
if (attributes & NVRAM_VSS_VARIABLE_APPEND_WRITE) str += QObject::tr(", AppendWrite");
if (attributes & NVRAM_VSS_VARIABLE_APPLE_DATA_CHECKSUM) str += QObject::tr(", AppleChecksum");
if (attributes & NVRAM_VSS_VARIABLE_UNKNOWN_MASK) str += QObject::tr(", Unknown");
return str.mid(2); // Remove first comma and space
}
QString evsaAttributesToQString(const UINT32 attributes)
{
QString str;
if (attributes & NVRAM_EVSA_DATA_NON_VOLATILE) str += QObject::tr(", NonVolatile");
if (attributes & NVRAM_EVSA_DATA_BOOTSERVICE_ACCESS) str += QObject::tr(", BootService");
if (attributes & NVRAM_EVSA_DATA_RUNTIME_ACCESS) str += QObject::tr(", Runtime");
if (attributes & NVRAM_EVSA_DATA_HARDWARE_ERROR_RECORD) str += QObject::tr(", HwErrorRecord");
if (attributes & NVRAM_EVSA_DATA_AUTHENTICATED_WRITE_ACCESS) str += QObject::tr(", AuthWrite");
if (attributes & NVRAM_EVSA_DATA_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) str += QObject::tr(", TimeBasedAuthWrite");
if (attributes & NVRAM_EVSA_DATA_APPEND_WRITE) str += QObject::tr(", AppendWrite");
if (attributes & NVRAM_EVSA_DATA_EXTENDED_HEADER) str += QObject::tr(", ExtendedHeader");
if (attributes & NVRAM_EVSA_DATA_UNKNOWN_MASK) str += QObject::tr(", Unknown");
return str.mid(2); // Remove first comma and space
}
@ -35,10 +78,10 @@ QString nvarAttributesToQString(const UINT8 attributes)
QString efiTimeToQString(const EFI_TIME & time)
{
return QObject::tr("%1-%2-%3T%4:%5:%6.%7")
.arg(time.Year, 4, 10, QLatin1Char('0'))
.arg(time.Month, 2, 10, QLatin1Char('0'))
.arg(time.Day, 2, 10, QLatin1Char('0'))
.arg(time.Hour, 2, 10, QLatin1Char('0'))
.arg(time.Year, 4, 10, QLatin1Char('0'))
.arg(time.Month, 2, 10, QLatin1Char('0'))
.arg(time.Day, 2, 10, QLatin1Char('0'))
.arg(time.Hour, 2, 10, QLatin1Char('0'))
.arg(time.Minute, 2, 10, QLatin1Char('0'))
.arg(time.Second, 2, 10, QLatin1Char('0'))
.arg(time.Nanosecond);

View File

@ -35,7 +35,7 @@ const QByteArray NVRAM_NVAR_EXTERNAL_DEFAULTS_FILE_GUID
("\x5B\x31\x21\x92\xBB\x30\xB5\x46\x81\x3E\x1B\x1B\xF4\x71\x2B\xD3", 16);
extern QString nvarAttributesToQString(const UINT8 attributes);
extern QString nvarExtendedAttributesToQString(const UINT8 attributes);
extern QString efiTimeToQString(const EFI_TIME & time);
typedef struct NVAR_ENTRY_HEADER_ {
@ -49,20 +49,20 @@ typedef struct NVAR_ENTRY_HEADER_ {
#define NVRAM_NVAR_ENTRY_SIGNATURE 0x5241564E
// Attributes
#define NVRAM_NVAR_ENTRY_ATTRIB_RUNTIME 0x01
#define NVRAM_NVAR_ENTRY_ATTRIB_ASCII_NAME 0x02
#define NVRAM_NVAR_ENTRY_ATTRIB_GUID 0x04
#define NVRAM_NVAR_ENTRY_ATTRIB_DATA_ONLY 0x08
#define NVRAM_NVAR_ENTRY_ATTRIB_EXT_HEADER 0x10
#define NVRAM_NVAR_ENTRY_ATTRIB_HW_ERROR_RECORD 0x20
#define NVRAM_NVAR_ENTRY_ATTRIB_AUTH_WRITE 0x40
#define NVRAM_NVAR_ENTRY_ATTRIB_VALID 0x80
#define NVRAM_NVAR_ENTRY_RUNTIME 0x01
#define NVRAM_NVAR_ENTRY_ASCII_NAME 0x02
#define NVRAM_NVAR_ENTRY_GUID 0x04
#define NVRAM_NVAR_ENTRY_DATA_ONLY 0x08
#define NVRAM_NVAR_ENTRY_EXT_HEADER 0x10
#define NVRAM_NVAR_ENTRY_HW_ERROR_RECORD 0x20
#define NVRAM_NVAR_ENTRY_AUTH_WRITE 0x40
#define NVRAM_NVAR_ENTRY_VALID 0x80
// Extended attributes
#define NVRAM_NVAR_ENTRY_EXT_ATTRIB_CHECKSUM 0x01
#define NVRAM_NVAR_ENTRY_EXT_ATTRIB_AUTH_WRITE 0x10
#define NVRAM_NVAR_ENTRY_EXT_ATTRIB_TIME_BASED 0x20
#define NVRAM_NVAR_ENTRY_EXT_CHECKSUM 0x01
#define NVRAM_NVAR_ENTRY_EXT_AUTH_WRITE 0x10
#define NVRAM_NVAR_ENTRY_EXT_TIME_BASED 0x20
#define NVRAM_NVAR_ENTRY_EXT_UNKNOWN_MASK 0xCE
//
// TianoCore VSS store and variables
//
@ -107,7 +107,7 @@ typedef struct VSS_VARIABLE_HEADER_ {
UINT8 State; // Variable state
UINT8 : 8;
UINT32 Attributes; // Variable attributes
UINT32 NameSize; // Size of variable name, null-terminated UCS2 string
UINT32 NameSize; // Size of variable name, stored as null-terminated UCS2 string
UINT32 DataSize; // Size of variable data without header and name
EFI_GUID VendorGuid; // Variable vendor GUID
} VSS_VARIABLE_HEADER;
@ -118,7 +118,7 @@ typedef struct VSS_APPLE_VARIABLE_HEADER_ {
UINT8 State; // Variable state
UINT8 : 8;
UINT32 Attributes; // Variable attributes
UINT32 NameSize; // Size of variable name, null-terminated UCS2 string
UINT32 NameSize; // Size of variable name, stored as null-terminated UCS2 string
UINT32 DataSize; // Size of variable data without header and name
EFI_GUID VendorGuid; // Variable vendor GUID
UINT32 DataCrc32; // CRC32 of the data
@ -133,7 +133,7 @@ typedef struct VSS_AUTH_VARIABLE_HEADER_ {
UINT64 MonotonicCounter; // Monotonic counter against replay attack
EFI_TIME Timestamp; // Time stamp against replay attack
UINT32 PubKeyIndex; // Index in PubKey database
UINT32 NameSize; // Size of variable name, null-terminated UCS2 string
UINT32 NameSize; // Size of variable name, stored as null-terminated UCS2 string
UINT32 DataSize; // Size of variable data without header and name
EFI_GUID VendorGuid; // Variable vendor GUID
} VSS_AUTH_VARIABLE_HEADER;
@ -154,15 +154,18 @@ typedef struct VSS_AUTH_VARIABLE_HEADER_ {
#define NVRAM_VSS_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
#define NVRAM_VSS_VARIABLE_APPEND_WRITE 0x00000040
#define NVRAM_VSS_VARIABLE_APPLE_DATA_CHECKSUM 0x80000000
#define NVRAM_VSS_VARIABLE_UNKNOWN_MASK 0x7FFFFF80
extern QString vssAttributesToQString(const UINT32 attributes);
//
// FDC region
// _FDC region
//
#define NVRAM_FDC_VOLUME_SIGNATURE 0x4344465F
typedef struct FDC_VOLUME_HEADER_ {
UINT32 Signature; //_FDC
UINT32 Signature; //_FDC signature
UINT32 Size; // Size of the whole region
//EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
//EFI_FV_BLOCK_MAP_ENTRY FvBlockMap[2];
@ -192,7 +195,7 @@ typedef struct EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER32_ {
} EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER32;
typedef struct EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER64_ {
EFI_GUID Signature; // NVRAM_MAIN_STORE_VOLUME_GUID
EFI_GUID Signature; // NVRAM_MAIN_STORE_VOLUME_GUID or EDKII_WORKING_BLOCK_SIGNATURE_GUID
UINT32 Crc; // Crc32 of the header with empty Crc and State fields
UINT8 State;
UINT8 Reserved[3];
@ -205,8 +208,9 @@ typedef struct EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER64_ {
//
typedef struct APPLE_FSYS_STORE_HEADER_ {
UINT32 Signature; // Fsys signature
UINT8 Unknown[5]; // Still unknown
UINT32 Signature; // Fsys or Gaid signature
UINT8 Unknown0; // Still unknown
UINT32 Unknown1; // Still unknown
UINT16 Size; // Size of variable store
} APPLE_FSYS_STORE_HEADER;
@ -220,18 +224,18 @@ typedef struct APPLE_FSYS_STORE_HEADER_ {
// Has CRC32 of the whole store without checksum field at the end
//
// EVSA store and variables
// EVSA store and entries
//
#define NVRAM_EVSA_STORE_SIGNATURE 0x41535645
#define NVRAM_EVSA_ENTRY_TYPE_STORE 0xEC
#define NVRAM_EVSA_ENTRY_TYPE_GUID1 0xED
#define NVRAM_EVSA_ENTRY_TYPE_GUID2 0xE1
#define NVRAM_EVSA_ENTRY_TYPE_NAME1 0xEE
#define NVRAM_EVSA_ENTRY_TYPE_NAME2 0xE2
#define NVRAM_EVSA_ENTRY_TYPE_DATA1 0xEF
#define NVRAM_EVSA_ENTRY_TYPE_DATA2 0xE3
#define NVRAM_EVSA_ENTRY_TYPE_STORE 0xEC
#define NVRAM_EVSA_ENTRY_TYPE_GUID1 0xED
#define NVRAM_EVSA_ENTRY_TYPE_GUID2 0xE1
#define NVRAM_EVSA_ENTRY_TYPE_NAME1 0xEE
#define NVRAM_EVSA_ENTRY_TYPE_NAME2 0xE2
#define NVRAM_EVSA_ENTRY_TYPE_DATA1 0xEF
#define NVRAM_EVSA_ENTRY_TYPE_DATA2 0xE3
#define NVRAM_EVSA_ENTRY_TYPE_DATA_INVALID 0x83
typedef struct EVSA_ENTRY_HEADER_ {
@ -242,7 +246,7 @@ typedef struct EVSA_ENTRY_HEADER_ {
typedef struct EVSA_STORE_ENTRY_ {
EVSA_ENTRY_HEADER Header;
UINT32 Signature; // EVSA
UINT32 Signature; // EVSA signature
UINT32 Attributes;
UINT32 StoreSize;
UINT32 : 32;
@ -268,7 +272,16 @@ typedef struct EVSA_DATA_ENTRY_ {
//UINT8 Data[];
} EVSA_DATA_ENTRY;
#define NVRAM_EVSA_DATA_ATTRIBUTE_EXTENDED_HEADER 0x10000000
// VSS variable attributes
#define NVRAM_EVSA_DATA_NON_VOLATILE 0x00000001
#define NVRAM_EVSA_DATA_BOOTSERVICE_ACCESS 0x00000002
#define NVRAM_EVSA_DATA_RUNTIME_ACCESS 0x00000004
#define NVRAM_EVSA_DATA_HARDWARE_ERROR_RECORD 0x00000008
#define NVRAM_EVSA_DATA_AUTHENTICATED_WRITE_ACCESS 0x00000010
#define NVRAM_EVSA_DATA_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
#define NVRAM_EVSA_DATA_APPEND_WRITE 0x00000040
#define NVRAM_EVSA_DATA_EXTENDED_HEADER 0x10000000
#define NVRAM_EVSA_DATA_UNKNOWN_MASK 0xEFFFFF80
typedef struct EVSA_DATA_ENTRY_EXTENDED_ {
EVSA_ENTRY_HEADER Header;
@ -279,6 +292,8 @@ typedef struct EVSA_DATA_ENTRY_EXTENDED_ {
//UINT8 Data[];
} EVSA_DATA_ENTRY_EXTENDED;
extern QString evsaAttributesToQString(const UINT32 attributes);
//
// Phoenix SCT Flash Map
//
@ -381,7 +396,7 @@ typedef struct OEM_ACTIVATION_PUBKEY_ {
UINT8 Version;
UINT16 Reserved;
UINT32 Algorithm;
UINT32 Magic; // RSA1
UINT32 Magic; // RSA1 signature
UINT32 BitLength;
UINT32 Exponent;
UINT8 Modulus[128];
@ -396,7 +411,7 @@ typedef struct OEM_ACTIVATION_MARKER_ {
UINT32 Version;
UINT8 OemId[6];
UINT8 OemTableId[8];
UINT64 WindowsFlag;
UINT64 WindowsFlag; // WINDOWS signature
UINT32 SlicVersion;
UINT8 Reserved[16];
UINT8 Signature[128];
@ -412,7 +427,7 @@ typedef struct OEM_ACTIVATION_MARKER_ {
//
typedef struct PHOENIX_CMDB_HEADER_ {
UINT32 Signature; // CMDB
UINT32 Signature; // CMDB signature
UINT32 HeaderSize; // Size of this header
UINT32 TotalSize; // Total size of header and chunks, without strings
// UINT8 StartChunk[3];

View File

@ -82,21 +82,10 @@ typedef struct SECTION_PARSING_DATA_ {
};
} SECTION_PARSING_DATA;
typedef struct NVRAM_NVAR_PARSING_DATA_ {
typedef struct NVAR_ENTRY_PARSING_DATA_ {
BOOLEAN isValid;
UINT32 next;
UINT8 attributes;
UINT8 extendedAttributes;
UINT64 timestamp;
UINT8 hash[SHA256_HASH_SIZE]; //SHA256
} NVRAM_NVAR_PARSING_DATA;
typedef struct NVRAM_PARSING_DATA_ {
//union {
NVRAM_NVAR_PARSING_DATA nvar;
//};
} NVRAM_PARSING_DATA;
// TODO: add more NVRAM-related PD
} NVAR_ENTRY_PARSING_DATA;
typedef struct PARSING_DATA_ {
UINT8 emptyByte;
@ -104,14 +93,10 @@ typedef struct PARSING_DATA_ {
UINT32 offset;
UINT32 address;
union {
//CAPSULE_PARSING_DATA capsule;
//IMAGE_PARSING_DATA image;
//PADDING_PARSING_DATA padding;
VOLUME_PARSING_DATA volume;
//FREE_SPACE_PARSING_DATA freeSpace;
FILE_PARSING_DATA file;
SECTION_PARSING_DATA section;
NVRAM_PARSING_DATA nvram;
VOLUME_PARSING_DATA volume;
FILE_PARSING_DATA file;
SECTION_PARSING_DATA section;
NVAR_ENTRY_PARSING_DATA nvar;
};
} PARSING_DATA;