mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
Add support for x86 recovery startup AP data entries in special padding files
This commit is contained in:
parent
06653d024b
commit
a4a455d0ff
@ -215,6 +215,7 @@ void UEFITool::populateUi(const QModelIndex ¤t)
|
|||||||
|| type == Types::CpdEntry
|
|| type == Types::CpdEntry
|
||||||
|| type == Types::CpdExtension
|
|| type == Types::CpdExtension
|
||||||
|| type == Types::CpdSpiEntry
|
|| type == Types::CpdSpiEntry
|
||||||
|
|| type == Types::StartupApDataEntry
|
||||||
);
|
);
|
||||||
ui->menuStoreActions->setEnabled(type == Types::VssStore
|
ui->menuStoreActions->setEnabled(type == Types::VssStore
|
||||||
|| type == Types::Vss2Store
|
|| type == Types::Vss2Store
|
||||||
@ -441,7 +442,6 @@ void UEFITool::replaceBody()
|
|||||||
void UEFITool::replace(const UINT8 mode)
|
void UEFITool::replace(const UINT8 mode)
|
||||||
{
|
{
|
||||||
U_UNUSED_PARAMETER(mode);
|
U_UNUSED_PARAMETER(mode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UEFITool::extractAsIs()
|
void UEFITool::extractAsIs()
|
||||||
@ -534,6 +534,7 @@ void UEFITool::extract(const UINT8 mode)
|
|||||||
case Types::VssEntry:
|
case Types::VssEntry:
|
||||||
case Types::EvsaEntry:
|
case Types::EvsaEntry:
|
||||||
case Types::FlashMapEntry:
|
case Types::FlashMapEntry:
|
||||||
|
case Types::StartupApDataEntry:
|
||||||
case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save entry body to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)")); break;
|
case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save entry body to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)")); break;
|
||||||
case Types::VssStore:
|
case Types::VssStore:
|
||||||
case Types::Vss2Store:
|
case Types::Vss2Store:
|
||||||
@ -578,17 +579,23 @@ void UEFITool::remove()
|
|||||||
|
|
||||||
void UEFITool::about()
|
void UEFITool::about()
|
||||||
{
|
{
|
||||||
QMessageBox::about(this, tr("About UEFITool"), tr(
|
QMessageBox::about(this, tr("About UEFITool"),
|
||||||
"Copyright (c) 2019, Nikolaj Schlej.<br>"
|
tr("Copyright (c) 2013-2022, Nikolaj Schlej.<br><br>"
|
||||||
"Program icon made by <a href=https://www.behance.net/alzhidkov>Alexander Zhidkov</a>.<br>"
|
"Program icon made by <a href=https://www.behance.net/alzhidkov>Alexander Zhidkov</a>.<br><br>"
|
||||||
"The program uses QHexEdit2 library made by <a href=https://github.com/Simsys/>Simsys</a>.<br>"
|
"GUI uses QHexEdit2 library made by <a href=https://github.com/Simsys>Simsys</a>.<br>"
|
||||||
"Qt-less engine is using Bstrlib made by <a href=https://github.com/websnarf/>Paul Hsieh</a>.<br><br>"
|
"Qt-less engine uses Bstrlib made by <a href=https://github.com/websnarf>Paul Hsieh</a>.<br>"
|
||||||
|
"Engine uses Tiano compression code made by <a href=https://github.com/tianocore>TianoCore developers</a>.<br>"
|
||||||
|
"Engine uses LZMA compression code made by <a href=https://www.7-zip.org/sdk.html>Igor Pavlov</a>.<br>"
|
||||||
|
"Engine uses zlib compression code made by <a href=https://github.com/madler>Mark Adler</a>.<br>"
|
||||||
|
"Engine uses LibTomCrypt hashing code made by <a href=https://github.com/libtom>LibTom developers</a>.<br>"
|
||||||
|
"Engine uses KaitaiStruct runtime made by <a href=https://github.com/kaitai-io>Kaitai team</a>.<br><br>"
|
||||||
"The program is dedicated to <b>RevoGirl</b>. Rest in peace, young genius.<br><br>"
|
"The program is dedicated to <b>RevoGirl</b>. Rest in peace, young genius.<br><br>"
|
||||||
"The program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License.<br>"
|
"The program and the accompanying materials are licensed and made available under the terms and conditions of the BSD-2-Clause License.<br>"
|
||||||
"The full text of the license may be found at <a href=http://opensource.org/licenses/bsd-license.php>OpenSource.org</a>.<br><br>"
|
"The full text of the license may be found at <a href=https://opensource.org/licenses/BSD-2-Clause>OpenSource.org</a>.<br><br>"
|
||||||
"<b>THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS, "
|
"<b>THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS, "
|
||||||
"WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, "
|
"WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, "
|
||||||
"EITHER EXPRESS OR IMPLIED.</b>"));
|
"EITHER EXPRESS OR IMPLIED.</b>"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UEFITool::aboutQt()
|
void UEFITool::aboutQt()
|
||||||
@ -801,10 +808,11 @@ void UEFITool::showParserMessages()
|
|||||||
#if QT_VERSION_MAJOR < 6
|
#if QT_VERSION_MAJOR < 6
|
||||||
std::pair<QString, QModelIndex> msg;
|
std::pair<QString, QModelIndex> msg;
|
||||||
|
|
||||||
foreach (msg, messages) {
|
foreach (msg, messages)
|
||||||
#else
|
#else
|
||||||
for (const auto &msg : messages) {
|
for (const auto &msg : messages)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
||||||
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));
|
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));
|
||||||
ui->parserMessagesListWidget->addItem(item);
|
ui->parserMessagesListWidget->addItem(item);
|
||||||
@ -825,10 +833,11 @@ void UEFITool::showParserMessages()
|
|||||||
#if QT_VERSION_MAJOR < 6
|
#if QT_VERSION_MAJOR < 6
|
||||||
std::pair<QString, QModelIndex> msg;
|
std::pair<QString, QModelIndex> msg;
|
||||||
|
|
||||||
foreach (msg, messages) {
|
foreach (msg, messages)
|
||||||
#else
|
#else
|
||||||
for (const auto &msg : messages) {
|
for (const auto &msg : messages)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
||||||
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));;
|
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));;
|
||||||
ui->finderMessagesListWidget->addItem(item);
|
ui->finderMessagesListWidget->addItem(item);
|
||||||
@ -850,10 +859,11 @@ void UEFITool::showParserMessages()
|
|||||||
#if QT_VERSION_MAJOR < 6
|
#if QT_VERSION_MAJOR < 6
|
||||||
std::pair<QString, QModelIndex> msg;
|
std::pair<QString, QModelIndex> msg;
|
||||||
|
|
||||||
foreach (msg, messages) {
|
foreach (msg, messages)
|
||||||
#else
|
#else
|
||||||
for (const auto &msg : messages) {
|
for (const auto &msg : messages)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
QListWidgetItem* item = new QListWidgetItem(msg.first, NULL, 0);
|
||||||
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));
|
item->setData(Qt::UserRole, QByteArray((const char*)&msg.second, sizeof(msg.second)));
|
||||||
ui->builderMessagesListWidget->addItem(item);
|
ui->builderMessagesListWidget->addItem(item);
|
||||||
|
@ -72,7 +72,7 @@ extern const UByteArray EFI_DXE_APRIORI_FILE_GUID // FC510EE7-FFDC-11D4-BD41-008
|
|||||||
// Volume top file
|
// Volume top file
|
||||||
extern const UByteArray EFI_FFS_VOLUME_TOP_FILE_GUID // 1BA0062E-C779-4582-8566-336AE8F78F09
|
extern const UByteArray EFI_FFS_VOLUME_TOP_FILE_GUID // 1BA0062E-C779-4582-8566-336AE8F78F09
|
||||||
("\x2E\x06\xA0\x1B\x79\xC7\x82\x45\x85\x66\x33\x6A\xE8\xF7\x8F\x09", 16);
|
("\x2E\x06\xA0\x1B\x79\xC7\x82\x45\x85\x66\x33\x6A\xE8\xF7\x8F\x09", 16);
|
||||||
// Pad file GUID
|
// Padding file GUID
|
||||||
extern const UByteArray EFI_FFS_PAD_FILE_GUID // E4536585-7909-4A60-B5C6-ECDEA6EBFB5
|
extern const UByteArray EFI_FFS_PAD_FILE_GUID // E4536585-7909-4A60-B5C6-ECDEA6EBFB5
|
||||||
("\x85\x65\x53\xE4\x09\x79\x60\x4A\xB5\xC6\xEC\xDE\xA6\xEB\xFB\x54", 16);
|
("\x85\x65\x53\xE4\x09\x79\x60\x4A\xB5\xC6\xEC\xDE\xA6\xEB\xFB\x54", 16);
|
||||||
// AMI DXE core file
|
// AMI DXE core file
|
||||||
@ -125,6 +125,9 @@ const UINT8 ffsAlignmentTable[] =
|
|||||||
const UINT8 ffsAlignment2Table[] =
|
const UINT8 ffsAlignment2Table[] =
|
||||||
{ 17, 18, 19, 20, 21, 22, 23, 24 };
|
{ 17, 18, 19, 20, 21, 22, 23, 24 };
|
||||||
|
|
||||||
|
extern const UByteArray RECOVERY_STARTUP_AP_DATA_X86_128K // jmp far F000:FFD0, EAD0FF00F0
|
||||||
|
("\xEA\xD0\xFF\x00\xF0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x27\x2D", RECOVERY_STARTUP_AP_DATA_X86_SIZE);
|
||||||
|
|
||||||
VOID uint32ToUint24(UINT32 size, UINT8* ffsSize)
|
VOID uint32ToUint24(UINT32 size, UINT8* ffsSize)
|
||||||
{
|
{
|
||||||
ffsSize[2] = (UINT8)((size) >> 16U);
|
ffsSize[2] = (UINT8)((size) >> 16U);
|
||||||
|
@ -348,7 +348,7 @@ extern const UByteArray EFI_DXE_APRIORI_FILE_GUID; // FC510EE7-FFDC-11D4-BD41-00
|
|||||||
// Volume top file
|
// Volume top file
|
||||||
extern const UByteArray EFI_FFS_VOLUME_TOP_FILE_GUID; // 1BA0062E-C779-4582-8566-336AE8F78F09
|
extern const UByteArray EFI_FFS_VOLUME_TOP_FILE_GUID; // 1BA0062E-C779-4582-8566-336AE8F78F09
|
||||||
|
|
||||||
// AMI pad file GUID
|
// AMI padding file GUID
|
||||||
extern const UByteArray EFI_FFS_PAD_FILE_GUID; // E4536585-7909-4A60-B5C6-ECDEA6EBFB5
|
extern const UByteArray EFI_FFS_PAD_FILE_GUID; // E4536585-7909-4A60-B5C6-ECDEA6EBFB5
|
||||||
|
|
||||||
// AMI DXE core file
|
// AMI DXE core file
|
||||||
@ -530,6 +530,13 @@ typedef struct POSTCODE_SECTION_ {
|
|||||||
///
|
///
|
||||||
#define EFI_DEP_SOR 0x09
|
#define EFI_DEP_SOR 0x09
|
||||||
|
|
||||||
|
//*****************************************************************************
|
||||||
|
// X86 Startup AP Data
|
||||||
|
//*****************************************************************************
|
||||||
|
#define RECOVERY_STARTUP_AP_DATA_X86_SIZE 0x10
|
||||||
|
extern const UByteArray RECOVERY_STARTUP_AP_DATA_X86_64K;
|
||||||
|
extern const UByteArray RECOVERY_STARTUP_AP_DATA_X86_128K;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
// X86 Reset Vector Data
|
// X86 Reset Vector Data
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
@ -1368,7 +1368,8 @@ USTATUS FfsParser::findNextRawAreaItem(const UModelIndex & index, const UINT32 l
|
|||||||
nextItemOffset = offset - EFI_FV_SIGNATURE_OFFSET;
|
nextItemOffset = offset - EFI_FV_SIGNATURE_OFFSET;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (readUnaligned(currentPos) == BPDT_GREEN_SIGNATURE || readUnaligned(currentPos) == BPDT_YELLOW_SIGNATURE) {
|
else if (readUnaligned(currentPos) == BPDT_GREEN_SIGNATURE
|
||||||
|
|| readUnaligned(currentPos) == BPDT_YELLOW_SIGNATURE) {
|
||||||
// Check data size
|
// Check data size
|
||||||
if (restSize < sizeof(BPDT_HEADER))
|
if (restSize < sizeof(BPDT_HEADER))
|
||||||
continue;
|
continue;
|
||||||
@ -1548,8 +1549,8 @@ USTATUS FfsParser::parseVolumeBody(const UModelIndex & index)
|
|||||||
|
|
||||||
// We aren't at the end of empty space
|
// We aren't at the end of empty space
|
||||||
// Check that the remaining space can still have a file in it
|
// Check that the remaining space can still have a file in it
|
||||||
if (volumeBodySize - fileOffset < sizeof(EFI_FFS_FILE_HEADER) || // Remaining space is smaller than the smallest possible file
|
if (volumeBodySize - fileOffset < sizeof(EFI_FFS_FILE_HEADER) // Remaining space is smaller than the smallest possible file
|
||||||
volumeBodySize - fileOffset < fileSize) { // Remaining space is smaller than non-empty file size
|
|| volumeBodySize - fileOffset < fileSize) { // Remaining space is smaller than non-empty file size
|
||||||
// Parse non-UEFI data
|
// Parse non-UEFI data
|
||||||
parseVolumeNonUefiData(volumeBody.mid(fileOffset), volumeHeaderSize + fileOffset, index);
|
parseVolumeNonUefiData(volumeBody.mid(fileOffset), volumeHeaderSize + fileOffset, index);
|
||||||
|
|
||||||
@ -1573,8 +1574,9 @@ USTATUS FfsParser::parseVolumeBody(const UModelIndex & index)
|
|||||||
for (int i = 0; i < model->rowCount(index); i++) {
|
for (int i = 0; i < model->rowCount(index); i++) {
|
||||||
UModelIndex current = index.model()->index(i, 0, index);
|
UModelIndex current = index.model()->index(i, 0, index);
|
||||||
|
|
||||||
// Skip non-file entries and pad files
|
// Skip non-file entries and padding files
|
||||||
if (model->type(current) != Types::File || model->subtype(current) == EFI_FV_FILETYPE_PAD) {
|
if (model->type(current) != Types::File
|
||||||
|
|| model->subtype(current) == EFI_FV_FILETYPE_PAD) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1755,7 +1757,7 @@ USTATUS FfsParser::parseFileHeader(const UByteArray & file, const UINT32 localOf
|
|||||||
if (fileHeader->Type != EFI_FV_FILETYPE_PAD) {
|
if (fileHeader->Type != EFI_FV_FILETYPE_PAD) {
|
||||||
name = guidToUString(fileHeader->Name);
|
name = guidToUString(fileHeader->Name);
|
||||||
} else {
|
} else {
|
||||||
name = UString("Pad-file");
|
name = UString("Padding file");
|
||||||
}
|
}
|
||||||
|
|
||||||
info = UString("File GUID: ") + guidToUString(fileHeader->Name, false) +
|
info = UString("File GUID: ") + guidToUString(fileHeader->Name, false) +
|
||||||
@ -1864,7 +1866,7 @@ USTATUS FfsParser::parseFileBody(const UModelIndex & index)
|
|||||||
if (model->type(index) != Types::File)
|
if (model->type(index) != Types::File)
|
||||||
return U_SUCCESS;
|
return U_SUCCESS;
|
||||||
|
|
||||||
// Parse pad-file body
|
// Parse padding file body
|
||||||
if (model->subtype(index) == EFI_FV_FILETYPE_PAD)
|
if (model->subtype(index) == EFI_FV_FILETYPE_PAD)
|
||||||
return parsePadFileBody(index);
|
return parsePadFileBody(index);
|
||||||
|
|
||||||
@ -1915,7 +1917,7 @@ USTATUS FfsParser::parsePadFileBody(const UModelIndex & index)
|
|||||||
emptyByte = pdata->emptyByte;
|
emptyByte = pdata->emptyByte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the while PAD file is empty
|
// Check if the while padding file is empty
|
||||||
if (body.size() == body.count(emptyByte))
|
if (body.size() == body.count(emptyByte))
|
||||||
return U_SUCCESS;
|
return U_SUCCESS;
|
||||||
|
|
||||||
@ -1950,6 +1952,22 @@ USTATUS FfsParser::parsePadFileBody(const UModelIndex & index)
|
|||||||
// ... and all bytes after as a padding
|
// ... and all bytes after as a padding
|
||||||
UByteArray padding = body.mid(nonEmptyByteOffset);
|
UByteArray padding = body.mid(nonEmptyByteOffset);
|
||||||
|
|
||||||
|
// Check for that data to be recovery startup AP data for x86
|
||||||
|
// https://github.com/tianocore/edk2/blob/stable/202011/BaseTools/Source/C/GenFv/GenFvInternalLib.c#L106
|
||||||
|
if (padding.left(RECOVERY_STARTUP_AP_DATA_X86_SIZE) == RECOVERY_STARTUP_AP_DATA_X86_128K) {
|
||||||
|
// Get info
|
||||||
|
UString info = usprintf("Full size: %Xh (%u)", (UINT32)padding.size(), (UINT32)padding.size());
|
||||||
|
|
||||||
|
// Add tree item
|
||||||
|
(void)model->addItem(headerSize + nonEmptyByteOffset, Types::StartupApDataEntry, Subtypes::x86128kStartupApDataEntry, UString("Startup AP data"), UString(), info, UByteArray(), padding, UByteArray(), Fixed, index);
|
||||||
|
|
||||||
|
// Rename the file
|
||||||
|
model->setName(index, UString("Startup AP data padding file"));
|
||||||
|
|
||||||
|
// Do not parse contents
|
||||||
|
return U_SUCCESS;
|
||||||
|
}
|
||||||
|
else { // Not a data array
|
||||||
// Get info
|
// Get info
|
||||||
UString info = usprintf("Full size: %Xh (%u)", (UINT32)padding.size(), (UINT32)padding.size());
|
UString info = usprintf("Full size: %Xh (%u)", (UINT32)padding.size(), (UINT32)padding.size());
|
||||||
|
|
||||||
@ -1957,13 +1975,16 @@ USTATUS FfsParser::parsePadFileBody(const UModelIndex & index)
|
|||||||
UModelIndex dataIndex = model->addItem(headerSize + nonEmptyByteOffset, Types::Padding, Subtypes::DataPadding, UString("Non-UEFI data"), UString(), info, UByteArray(), padding, UByteArray(), Fixed, index);
|
UModelIndex dataIndex = model->addItem(headerSize + nonEmptyByteOffset, Types::Padding, Subtypes::DataPadding, UString("Non-UEFI data"), UString(), info, UByteArray(), padding, UByteArray(), Fixed, index);
|
||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
msg(usprintf("%s: non-UEFI data found in pad-file", __FUNCTION__), dataIndex);
|
msg(usprintf("%s: non-UEFI data found in padding file", __FUNCTION__), dataIndex);
|
||||||
|
|
||||||
// Rename the file
|
// Rename the file
|
||||||
model->setName(index, UString("Non-empty pad-file"));
|
model->setName(index, UString("Non-empty padding file"));
|
||||||
|
|
||||||
// Parse contents as RAW area
|
// Do not parse contents
|
||||||
return parseRawArea(dataIndex);
|
return U_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return U_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
USTATUS FfsParser::parseSections(const UByteArray & sections, const UModelIndex & index, const bool insertIntoTree)
|
USTATUS FfsParser::parseSections(const UByteArray & sections, const UModelIndex & index, const bool insertIntoTree)
|
||||||
|
@ -66,7 +66,6 @@ UString itemTypeToUString(const UINT8 type)
|
|||||||
case Types::FlashMapEntry: return UString("FlashMap entry");
|
case Types::FlashMapEntry: return UString("FlashMap entry");
|
||||||
case Types::Microcode: return UString("Microcode");
|
case Types::Microcode: return UString("Microcode");
|
||||||
case Types::SlicData: return UString("SLIC data");
|
case Types::SlicData: return UString("SLIC data");
|
||||||
// ME-specific
|
|
||||||
case Types::FptStore: return UString("FPT store");
|
case Types::FptStore: return UString("FPT store");
|
||||||
case Types::FptEntry: return UString("FPT entry");
|
case Types::FptEntry: return UString("FPT entry");
|
||||||
case Types::IfwiHeader: return UString("IFWI header");
|
case Types::IfwiHeader: return UString("IFWI header");
|
||||||
@ -80,6 +79,7 @@ UString itemTypeToUString(const UINT8 type)
|
|||||||
case Types::CpdPartition: return UString("CPD partition");
|
case Types::CpdPartition: return UString("CPD partition");
|
||||||
case Types::CpdExtension: return UString("CPD extension");
|
case Types::CpdExtension: return UString("CPD extension");
|
||||||
case Types::CpdSpiEntry: return UString("CPD SPI entry");
|
case Types::CpdSpiEntry: return UString("CPD SPI entry");
|
||||||
|
case Types::StartupApDataEntry: return UString("Startup AP data");
|
||||||
}
|
}
|
||||||
|
|
||||||
return usprintf("Unknown %02Xh", type);
|
return usprintf("Unknown %02Xh", type);
|
||||||
@ -90,81 +90,82 @@ UString itemSubtypeToUString(const UINT8 type, const UINT8 subtype)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case Types::Image:
|
case Types::Image:
|
||||||
if (subtype == Subtypes::IntelImage) return UString("Intel");
|
if (subtype == Subtypes::IntelImage) return UString("Intel");
|
||||||
if (subtype == Subtypes::UefiImage) return UString("UEFI");
|
else if (subtype == Subtypes::UefiImage) return UString("UEFI");
|
||||||
break;
|
break;
|
||||||
case Types::Padding:
|
case Types::Padding:
|
||||||
if (subtype == Subtypes::ZeroPadding) return UString("Empty (0x00)");
|
if (subtype == Subtypes::ZeroPadding) return UString("Empty (0x00)");
|
||||||
if (subtype == Subtypes::OnePadding) return UString("Empty (0xFF)");
|
else if (subtype == Subtypes::OnePadding) return UString("Empty (0xFF)");
|
||||||
if (subtype == Subtypes::DataPadding) return UString("Non-empty");
|
else if (subtype == Subtypes::DataPadding) return UString("Non-empty");
|
||||||
break;
|
break;
|
||||||
case Types::Volume:
|
case Types::Volume:
|
||||||
if (subtype == Subtypes::UnknownVolume) return UString("Unknown");
|
if (subtype == Subtypes::UnknownVolume) return UString("Unknown");
|
||||||
if (subtype == Subtypes::Ffs2Volume) return UString("FFSv2");
|
else if (subtype == Subtypes::Ffs2Volume) return UString("FFSv2");
|
||||||
if (subtype == Subtypes::Ffs3Volume) return UString("FFSv3");
|
else if (subtype == Subtypes::Ffs3Volume) return UString("FFSv3");
|
||||||
if (subtype == Subtypes::NvramVolume) return UString("NVRAM");
|
else if (subtype == Subtypes::NvramVolume) return UString("NVRAM");
|
||||||
if (subtype == Subtypes::MicrocodeVolume) return UString("Microcode");
|
else if (subtype == Subtypes::MicrocodeVolume) return UString("Microcode");
|
||||||
break;
|
break;
|
||||||
case Types::Capsule:
|
case Types::Capsule:
|
||||||
if (subtype == Subtypes::AptioSignedCapsule) return UString("Aptio signed");
|
if (subtype == Subtypes::AptioSignedCapsule) return UString("Aptio signed");
|
||||||
if (subtype == Subtypes::AptioUnsignedCapsule) return UString("Aptio unsigned");
|
else if (subtype == Subtypes::AptioUnsignedCapsule) return UString("Aptio unsigned");
|
||||||
if (subtype == Subtypes::UefiCapsule) return UString("UEFI 2.0");
|
else if (subtype == Subtypes::UefiCapsule) return UString("UEFI 2.0");
|
||||||
if (subtype == Subtypes::ToshibaCapsule) return UString("Toshiba");
|
else if (subtype == Subtypes::ToshibaCapsule) return UString("Toshiba");
|
||||||
break;
|
break;
|
||||||
case Types::Region: return regionTypeToUString(subtype);
|
case Types::Region: return regionTypeToUString(subtype);
|
||||||
case Types::File: return fileTypeToUString(subtype);
|
case Types::File: return fileTypeToUString(subtype);
|
||||||
case Types::Section: return sectionTypeToUString(subtype);
|
case Types::Section: return sectionTypeToUString(subtype);
|
||||||
case Types::NvarEntry:
|
case Types::NvarEntry:
|
||||||
if (subtype == Subtypes::InvalidNvarEntry) return UString("Invalid");
|
if (subtype == Subtypes::InvalidNvarEntry) return UString("Invalid");
|
||||||
if (subtype == Subtypes::InvalidLinkNvarEntry) return UString("Invalid link");
|
else if (subtype == Subtypes::InvalidLinkNvarEntry) return UString("Invalid link");
|
||||||
if (subtype == Subtypes::LinkNvarEntry) return UString("Link");
|
else if (subtype == Subtypes::LinkNvarEntry) return UString("Link");
|
||||||
if (subtype == Subtypes::DataNvarEntry) return UString("Data");
|
else if (subtype == Subtypes::DataNvarEntry) return UString("Data");
|
||||||
if (subtype == Subtypes::FullNvarEntry) return UString("Full");
|
else if (subtype == Subtypes::FullNvarEntry) return UString("Full");
|
||||||
break;
|
break;
|
||||||
case Types::VssEntry:
|
case Types::VssEntry:
|
||||||
if (subtype == Subtypes::InvalidVssEntry) return UString("Invalid");
|
if (subtype == Subtypes::InvalidVssEntry) return UString("Invalid");
|
||||||
if (subtype == Subtypes::StandardVssEntry) return UString("Standard");
|
else if (subtype == Subtypes::StandardVssEntry) return UString("Standard");
|
||||||
if (subtype == Subtypes::AppleVssEntry) return UString("Apple");
|
else if (subtype == Subtypes::AppleVssEntry) return UString("Apple");
|
||||||
if (subtype == Subtypes::AuthVssEntry) return UString("Auth");
|
else if (subtype == Subtypes::AuthVssEntry) return UString("Auth");
|
||||||
if (subtype == Subtypes::IntelVssEntry) return UString("Intel");
|
else if (subtype == Subtypes::IntelVssEntry) return UString("Intel");
|
||||||
break;
|
break;
|
||||||
case Types::FsysEntry:
|
case Types::FsysEntry:
|
||||||
if (subtype == Subtypes::InvalidFsysEntry) return UString("Invalid");
|
if (subtype == Subtypes::InvalidFsysEntry) return UString("Invalid");
|
||||||
if (subtype == Subtypes::NormalFsysEntry) return UString("Normal");
|
else if (subtype == Subtypes::NormalFsysEntry) return UString("Normal");
|
||||||
break;
|
break;
|
||||||
case Types::EvsaEntry:
|
case Types::EvsaEntry:
|
||||||
if (subtype == Subtypes::InvalidEvsaEntry) return UString("Invalid");
|
if (subtype == Subtypes::InvalidEvsaEntry) return UString("Invalid");
|
||||||
if (subtype == Subtypes::UnknownEvsaEntry) return UString("Unknown");
|
else if (subtype == Subtypes::UnknownEvsaEntry) return UString("Unknown");
|
||||||
if (subtype == Subtypes::GuidEvsaEntry) return UString("GUID");
|
else if (subtype == Subtypes::GuidEvsaEntry) return UString("GUID");
|
||||||
if (subtype == Subtypes::NameEvsaEntry) return UString("Name");
|
else if (subtype == Subtypes::NameEvsaEntry) return UString("Name");
|
||||||
if (subtype == Subtypes::DataEvsaEntry) return UString("Data");
|
else if (subtype == Subtypes::DataEvsaEntry) return UString("Data");
|
||||||
break;
|
break;
|
||||||
case Types::FlashMapEntry:
|
case Types::FlashMapEntry:
|
||||||
if (subtype == Subtypes::VolumeFlashMapEntry) return UString("Volume");
|
if (subtype == Subtypes::VolumeFlashMapEntry) return UString("Volume");
|
||||||
if (subtype == Subtypes::DataFlashMapEntry) return UString("Data");
|
else if (subtype == Subtypes::DataFlashMapEntry) return UString("Data");
|
||||||
break;
|
break;
|
||||||
case Types::Microcode:
|
case Types::Microcode:
|
||||||
if (subtype == Subtypes::IntelMicrocode) return UString("Intel");
|
if (subtype == Subtypes::IntelMicrocode) return UString("Intel");
|
||||||
if (subtype == Subtypes::AmdMicrocode) return UString("AMD");
|
else if (subtype == Subtypes::AmdMicrocode) return UString("AMD");
|
||||||
break;
|
break;
|
||||||
// ME-specific
|
|
||||||
case Types::FptEntry:
|
case Types::FptEntry:
|
||||||
if (subtype == Subtypes::ValidFptEntry) return UString("Valid");
|
if (subtype == Subtypes::ValidFptEntry) return UString("Valid");
|
||||||
if (subtype == Subtypes::InvalidFptEntry) return UString("Invalid");
|
else if (subtype == Subtypes::InvalidFptEntry) return UString("Invalid");
|
||||||
break;
|
break;
|
||||||
case Types::FptPartition:
|
case Types::FptPartition:
|
||||||
if (subtype == Subtypes::CodeFptPartition) return UString("Code");
|
if (subtype == Subtypes::CodeFptPartition) return UString("Code");
|
||||||
if (subtype == Subtypes::DataFptPartition) return UString("Data");
|
else if (subtype == Subtypes::DataFptPartition) return UString("Data");
|
||||||
if (subtype == Subtypes::GlutFptPartition) return UString("GLUT");
|
else if (subtype == Subtypes::GlutFptPartition) return UString("GLUT");
|
||||||
break;
|
break;
|
||||||
case Types::IfwiPartition:
|
case Types::IfwiPartition:
|
||||||
if (subtype == Subtypes::BootIfwiPartition) return UString("Boot");
|
if (subtype == Subtypes::BootIfwiPartition) return UString("Boot");
|
||||||
if (subtype == Subtypes::DataIfwiPartition) return UString("Data");
|
else if (subtype == Subtypes::DataIfwiPartition) return UString("Data");
|
||||||
break;
|
break;
|
||||||
case Types::CpdPartition:
|
case Types::CpdPartition:
|
||||||
if (subtype == Subtypes::ManifestCpdPartition) return UString("Manifest");
|
if (subtype == Subtypes::ManifestCpdPartition) return UString("Manifest");
|
||||||
if (subtype == Subtypes::MetadataCpdPartition) return UString("Metadata");
|
else if (subtype == Subtypes::MetadataCpdPartition) return UString("Metadata");
|
||||||
if (subtype == Subtypes::KeyCpdPartition) return UString("Key");
|
else if (subtype == Subtypes::KeyCpdPartition) return UString("Key");
|
||||||
if (subtype == Subtypes::CodeCpdPartition) return UString("Code");
|
else if (subtype == Subtypes::CodeCpdPartition) return UString("Code");
|
||||||
|
case Types::StartupApDataEntry:
|
||||||
|
if (subtype == Subtypes::x86128kStartupApDataEntry) return UString("X86 128K");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace Actions
|
|||||||
Replace,
|
Replace,
|
||||||
Remove,
|
Remove,
|
||||||
Rebuild,
|
Rebuild,
|
||||||
Rebase
|
Rebase,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,6 @@ namespace Types {
|
|||||||
FlashMapEntry,
|
FlashMapEntry,
|
||||||
Microcode,
|
Microcode,
|
||||||
SlicData,
|
SlicData,
|
||||||
// ME-specific
|
|
||||||
IfwiHeader,
|
IfwiHeader,
|
||||||
IfwiPartition,
|
IfwiPartition,
|
||||||
FptStore,
|
FptStore,
|
||||||
@ -71,21 +70,22 @@ namespace Types {
|
|||||||
CpdEntry,
|
CpdEntry,
|
||||||
CpdPartition,
|
CpdPartition,
|
||||||
CpdExtension,
|
CpdExtension,
|
||||||
CpdSpiEntry
|
CpdSpiEntry,
|
||||||
|
StartupApDataEntry,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Subtypes {
|
namespace Subtypes {
|
||||||
enum ImageSubtypes{
|
enum ImageSubtypes{
|
||||||
IntelImage = 90,
|
IntelImage = 90,
|
||||||
UefiImage
|
UefiImage,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CapsuleSubtypes {
|
enum CapsuleSubtypes {
|
||||||
AptioSignedCapsule = 100,
|
AptioSignedCapsule = 100,
|
||||||
AptioUnsignedCapsule,
|
AptioUnsignedCapsule,
|
||||||
UefiCapsule,
|
UefiCapsule,
|
||||||
ToshibaCapsule
|
ToshibaCapsule,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VolumeSubtypes {
|
enum VolumeSubtypes {
|
||||||
@ -93,7 +93,7 @@ namespace Subtypes {
|
|||||||
Ffs2Volume,
|
Ffs2Volume,
|
||||||
Ffs3Volume,
|
Ffs3Volume,
|
||||||
NvramVolume,
|
NvramVolume,
|
||||||
MicrocodeVolume
|
MicrocodeVolume,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RegionSubtypes {
|
enum RegionSubtypes {
|
||||||
@ -112,13 +112,13 @@ namespace Subtypes {
|
|||||||
Tgbe2Region,
|
Tgbe2Region,
|
||||||
Reserved1Region,
|
Reserved1Region,
|
||||||
Reserved2Region,
|
Reserved2Region,
|
||||||
PttRegion
|
PttRegion,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PaddingSubtypes {
|
enum PaddingSubtypes {
|
||||||
ZeroPadding = 120,
|
ZeroPadding = 120,
|
||||||
OnePadding,
|
OnePadding,
|
||||||
DataPadding
|
DataPadding,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum NvarEntrySubtypes {
|
enum NvarEntrySubtypes {
|
||||||
@ -126,7 +126,7 @@ namespace Subtypes {
|
|||||||
InvalidLinkNvarEntry,
|
InvalidLinkNvarEntry,
|
||||||
LinkNvarEntry,
|
LinkNvarEntry,
|
||||||
DataNvarEntry,
|
DataNvarEntry,
|
||||||
FullNvarEntry
|
FullNvarEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VssEntrySubtypes {
|
enum VssEntrySubtypes {
|
||||||
@ -134,12 +134,12 @@ namespace Subtypes {
|
|||||||
StandardVssEntry,
|
StandardVssEntry,
|
||||||
AppleVssEntry,
|
AppleVssEntry,
|
||||||
AuthVssEntry,
|
AuthVssEntry,
|
||||||
IntelVssEntry
|
IntelVssEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FsysEntrySubtypes {
|
enum FsysEntrySubtypes {
|
||||||
InvalidFsysEntry = 150,
|
InvalidFsysEntry = 150,
|
||||||
NormalFsysEntry
|
NormalFsysEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EvsaEntrySubtypes {
|
enum EvsaEntrySubtypes {
|
||||||
@ -152,41 +152,45 @@ namespace Subtypes {
|
|||||||
|
|
||||||
enum FlashMapEntrySubtypes {
|
enum FlashMapEntrySubtypes {
|
||||||
VolumeFlashMapEntry = 170,
|
VolumeFlashMapEntry = 170,
|
||||||
DataFlashMapEntry
|
DataFlashMapEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MicrocodeSubtypes {
|
enum MicrocodeSubtypes {
|
||||||
IntelMicrocode = 180,
|
IntelMicrocode = 180,
|
||||||
AmdMicrocode
|
AmdMicrocode,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SlicDataSubtypes {
|
enum SlicDataSubtypes {
|
||||||
PubkeySlicData = 190,
|
PubkeySlicData = 190,
|
||||||
MarkerSlicData
|
MarkerSlicData,
|
||||||
};
|
};
|
||||||
|
|
||||||
// ME-specific
|
// ME-specific
|
||||||
enum IfwiPartitionSubtypes {
|
enum IfwiPartitionSubtypes {
|
||||||
DataIfwiPartition = 200,
|
DataIfwiPartition = 200,
|
||||||
BootIfwiPartition
|
BootIfwiPartition,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FptEntrySubtypes {
|
enum FptEntrySubtypes {
|
||||||
ValidFptEntry = 210,
|
ValidFptEntry = 210,
|
||||||
InvalidFptEntry
|
InvalidFptEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FptPartitionSubtypes {
|
enum FptPartitionSubtypes {
|
||||||
CodeFptPartition = 220,
|
CodeFptPartition = 220,
|
||||||
DataFptPartition,
|
DataFptPartition,
|
||||||
GlutFptPartition
|
GlutFptPartition,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CpdPartitionSubtypes {
|
enum CpdPartitionSubtypes {
|
||||||
ManifestCpdPartition = 230,
|
ManifestCpdPartition = 230,
|
||||||
MetadataCpdPartition,
|
MetadataCpdPartition,
|
||||||
KeyCpdPartition,
|
KeyCpdPartition,
|
||||||
CodeCpdPartition
|
CodeCpdPartition,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum StartupApDataEntrySubtypes {
|
||||||
|
x86128kStartupApDataEntry = 240,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ UString uniqueItemName(const UModelIndex & index)
|
|||||||
{
|
{
|
||||||
// Sanity check
|
// Sanity check
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return UString("Invalid_index");
|
return UString("InvalidIndex");
|
||||||
|
|
||||||
// Get model from index
|
// Get model from index
|
||||||
const TreeModel* model = (const TreeModel*)index.model();
|
const TreeModel* model = (const TreeModel*)index.model();
|
||||||
|
Loading…
Reference in New Issue
Block a user