mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-09 13:52:01 -04:00
Engine 0.20.1
-reverted some changes done in 0.20.0 update -added proper handling of non-standard data in volume's free space - new type "Free space" added - added machine type information - solved a typo in DOS/PE signature check
This commit is contained in:
parent
64a7c2ce2c
commit
2ec7ce1c30
14 changed files with 554 additions and 398 deletions
88
types.cpp
88
types.cpp
|
@ -19,15 +19,15 @@ QString regionTypeToQString(const UINT8 type)
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case ATTR_REGION_TYPE_DESCRIPTOR:
|
||||
case Subtypes::DescriptorRegion:
|
||||
return QObject::tr("Descriptor");
|
||||
case ATTR_REGION_TYPE_GBE:
|
||||
case Subtypes::GbeRegion:
|
||||
return QObject::tr("GbE");
|
||||
case ATTR_REGION_TYPE_ME:
|
||||
case Subtypes::MeRegion:
|
||||
return QObject::tr("ME/TXE");
|
||||
case ATTR_REGION_TYPE_BIOS:
|
||||
case Subtypes::BiosRegion:
|
||||
return QObject::tr("BIOS");
|
||||
case ATTR_REGION_TYPE_PDR:
|
||||
case Subtypes::PdrRegion:
|
||||
return QObject::tr("PDR");
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
|
@ -53,77 +53,61 @@ QString itemTypeToQString(const UINT8 type)
|
|||
return QObject::tr("File");
|
||||
case Types::Section:
|
||||
return QObject::tr("Section");
|
||||
case Types::FreeSpace:
|
||||
return QObject::tr("Free space");
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
QString itemAttributesToQString(const UINT8 type, const UINT8 attributes)
|
||||
QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype)
|
||||
{
|
||||
switch (type) {
|
||||
case Types::Root:
|
||||
case Types::Image:
|
||||
if (attributes == ATTR_IMAGE_TYPE_DESCRIPTOR)
|
||||
if (subtype == Subtypes::IntelImage)
|
||||
return QObject::tr("Intel");
|
||||
else if (attributes == ATTR_IMAGE_TYPE_UEFI)
|
||||
else if (Subtypes::UefiImage)
|
||||
return QObject::tr("UEFI");
|
||||
else
|
||||
return QObject::tr("Unknown");
|
||||
return QObject::tr("Unknown subtype");
|
||||
case Types::Padding:
|
||||
if (attributes == ATTR_PADDING_ZERO_EMPTY)
|
||||
if (subtype == Subtypes::ZeroPadding)
|
||||
return QObject::tr("Empty (0x00)");
|
||||
else if (attributes == ATTR_PADDING_ONE_EMPTY)
|
||||
else if (subtype == Subtypes::OnePadding)
|
||||
return QObject::tr("Empty (0xFF)");
|
||||
else if (attributes == ATTR_PADDING_DATA)
|
||||
else if (subtype == Subtypes::DataPadding)
|
||||
return QObject::tr("Non-empty");
|
||||
else
|
||||
return QObject::tr("Unknown subtype");
|
||||
case Types::Volume:
|
||||
if (subtype == Subtypes::UnknownVolume)
|
||||
return QObject::tr("Unknown");
|
||||
case Types::Volume: {
|
||||
QString string;
|
||||
VOLUME_ATTRIBUTES* volumeAttr = (VOLUME_ATTRIBUTES*)&attributes;
|
||||
if (volumeAttr->ZeroVectorCrc)
|
||||
string += QObject::tr("ZVCRC ");
|
||||
|
||||
if (volumeAttr->VtfPresent)
|
||||
string += QObject::tr("Boot ");
|
||||
|
||||
if (volumeAttr->Unknown) {
|
||||
string += QObject::tr("Unknown");
|
||||
return string;
|
||||
}
|
||||
|
||||
if (volumeAttr->FsVersion == 2 || volumeAttr->FsVersion == 3)
|
||||
string += QObject::tr("FFSv%1").arg(volumeAttr->FsVersion);
|
||||
else if (subtype == Subtypes::Ffs2Volume)
|
||||
return QObject::tr("FFSv2");
|
||||
else if (subtype == Subtypes::Ffs3Volume)
|
||||
return QObject::tr("FFSv3");
|
||||
else
|
||||
return QObject::tr("Unknown FFS version");
|
||||
|
||||
return string;
|
||||
}
|
||||
case Types::Capsule: {
|
||||
QString string;
|
||||
CAPSULE_ATTRIBUTES* capsuleAttr = (CAPSULE_ATTRIBUTES*)&attributes;
|
||||
if (capsuleAttr->Type == ATTR_CAPSULE_TYPE_APTIO)
|
||||
string += QObject::tr("Aptio ");
|
||||
else if (capsuleAttr->Type == ATTR_CAPSULE_TYPE_UEFI20)
|
||||
string += QObject::tr("UEFI 2.0 ");
|
||||
return QObject::tr("Unknown subtype");
|
||||
case Types::Capsule:
|
||||
if (subtype == Subtypes::AptioSignedCapsule)
|
||||
return QObject::tr("Aptio signed");
|
||||
else if (subtype == Subtypes::AptioUnsignedCapsule)
|
||||
return QObject::tr("Aptio unsigned");
|
||||
else if (subtype == Subtypes::UefiCapsule)
|
||||
return QObject::tr("UEFI 2.0 ");
|
||||
else
|
||||
return QObject::tr("Unknown type");
|
||||
|
||||
if (capsuleAttr->Signed)
|
||||
string += QObject::tr("signed");
|
||||
else
|
||||
string += QObject::tr("unsigned");
|
||||
|
||||
return string;
|
||||
}
|
||||
return QObject::tr("Unknown subtype");
|
||||
case Types::Region:
|
||||
return regionTypeToQString(attributes);
|
||||
return regionTypeToQString(subtype);
|
||||
case Types::File:
|
||||
return fileTypeToQString(attributes);
|
||||
return fileTypeToQString(subtype);
|
||||
case Types::Section:
|
||||
return sectionTypeToQString(attributes);
|
||||
return sectionTypeToQString(subtype);
|
||||
case Types::FreeSpace:
|
||||
return QString();
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
return QObject::tr("Unknown subtype");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue