Version 0.17.5

-code refactored to compile on Qt 4.8.5 without name conflicts
This commit is contained in:
Nikolaj Schlej 2014-02-27 10:14:41 +01:00
parent e5d94b6479
commit b3c9466f58
13 changed files with 416 additions and 359 deletions

View File

@ -14,7 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef __BASETYPES_H__ #ifndef __BASETYPES_H__
#define __BASETYPES_H__ #define __BASETYPES_H__
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
@ -117,55 +116,6 @@ typedef uint16_t CHAR16;
#define SEARCH_MODE_BODY 2 #define SEARCH_MODE_BODY 2
#define SEARCH_MODE_ALL 3 #define SEARCH_MODE_ALL 3
// Actions
enum ActionTypes {
NoAction = 50,
Create,
Insert,
Replace,
Remove,
Rebuild,
Rebase
};
// Types
enum ItemTypes {
Root = 60,
Capsule,
Image,
Region,
Padding,
Volume,
File,
Section
};
// Subtypes
enum ImageSubtypes{
IntelImage = 70,
BiosImage
};
enum CapsuleSubtypes {
AptioCapsule = 80,
UefiCapsule
};
enum VolumeSubtypes {
NormalVolume = 90,
BootVolume,
UnknownVolume,
NvramVolume
};
enum RegionSubtypes {
DescriptorRegion = 100,
GbeRegion,
MeRegion,
BiosRegion,
PdrRegion
};
// EFI GUID // EFI GUID
typedef struct { typedef struct {
UINT8 Data[16]; UINT8 Data[16];

View File

@ -12,26 +12,6 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QObject> #include <QObject>
#include "descriptor.h" #include "descriptor.h"
#include "treeitem.h"
QString regionTypeToQString(const UINT8 type)
{
switch (type)
{
case DescriptorRegion:
return QObject::tr("Descriptor");
case GbeRegion:
return QObject::tr("GbE");
case MeRegion:
return QObject::tr("ME");
case BiosRegion:
return QObject::tr("BIOS");
case PdrRegion:
return QObject::tr("PDR");
default:
return QObject::tr("Unknown");
};
}
// Calculate address of data structure addressed by descriptor address format // Calculate address of data structure addressed by descriptor address format
// 8 bit base or limit // 8 bit base or limit

View File

@ -161,9 +161,6 @@ typedef struct {
// Restore previous packing rules // Restore previous packing rules
#pragma pack(pop) #pragma pack(pop)
// Returns name of region by it's type
extern QString regionTypeToQString(const UINT8 type);
// Calculate address of data structure addressed by descriptor address format // Calculate address of data structure addressed by descriptor address format
// 8 bit base or limit // 8 bit base or limit
extern UINT8* calculateAddress8(UINT8* baseAddress, const UINT8 baseOrLimit); extern UINT8* calculateAddress8(UINT8* baseAddress, const UINT8 baseOrLimit);

View File

@ -13,7 +13,7 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <math.h> #include <math.h>
#include "ffsengine.h" #include "ffsengine.h"
#include "treeitem.h" #include "types.h"
#include "treemodel.h" #include "treemodel.h"
#include "descriptor.h" #include "descriptor.h"
#include "ffs.h" #include "ffs.h"
@ -98,7 +98,7 @@ UINT8 FfsEngine::parseImageFile(const QByteArray & buffer)
.arg(capsuleHeader->Flags, 8, 16, QChar('0')) .arg(capsuleHeader->Flags, 8, 16, QChar('0'))
.arg(capsuleHeader->CapsuleImageSize, 8, 16, QChar('0')); .arg(capsuleHeader->CapsuleImageSize, 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem(Capsule, UefiCapsule, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body); index = model->addItem(Types::Capsule, Subtypes::UefiCapsule, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body);
} }
// Check buffer for being extended Aptio capsule header // Check buffer for being extended Aptio capsule header
@ -115,7 +115,7 @@ UINT8 FfsEngine::parseImageFile(const QByteArray & buffer)
.arg(aptioCapsuleHeader->CapsuleHeader.CapsuleImageSize - aptioCapsuleHeader->RomImageOffset, 8, 16, QChar('0')); .arg(aptioCapsuleHeader->CapsuleHeader.CapsuleImageSize - aptioCapsuleHeader->RomImageOffset, 8, 16, QChar('0'));
//!TODO: more info about Aptio capsule //!TODO: more info about Aptio capsule
// Add tree item // Add tree item
index = model->addItem(Capsule, AptioCapsule, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body); index = model->addItem(Types::Capsule, Subtypes::AptioCapsule, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body);
} }
// Skip capsule header to have flash chip image // Skip capsule header to have flash chip image
@ -140,7 +140,7 @@ UINT8 FfsEngine::parseImageFile(const QByteArray & buffer)
.arg(flashImage.size(), 8, 16, QChar('0')); .arg(flashImage.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem(Image, BiosImage, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), flashImage, QByteArray(), index); index = model->addItem(Types::Image, Subtypes::BiosImage, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), flashImage, QByteArray(), index);
return parseBios(flashImage, index); return parseBios(flashImage, index);
} }
@ -270,7 +270,7 @@ UINT8 FfsEngine::parseIntelImage(const QByteArray & intelImage, QModelIndex & in
.arg(descriptorMap->NumberOfIccTableEntries); .arg(descriptorMap->NumberOfIccTableEntries);
// Add Intel image tree item // Add Intel image tree item
index = model->addItem(Image, IntelImage, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), intelImage, QByteArray(), parent); index = model->addItem(Types::Image, Subtypes::IntelImage, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), intelImage, QByteArray(), parent);
// Descriptor // Descriptor
// Get descriptor info // Get descriptor info
@ -327,7 +327,7 @@ UINT8 FfsEngine::parseIntelImage(const QByteArray & intelImage, QModelIndex & in
// VSCC table // VSCC table
// Add descriptor tree item // Add descriptor tree item
model->addItem(Region, DescriptorRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), body, QByteArray(), index); model->addItem(Types::Region, Subtypes::DescriptorRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), body, QByteArray(), index);
// Sort regions in ascending order // Sort regions in ascending order
qSort(offsets); qSort(offsets);
@ -382,7 +382,7 @@ UINT8 FfsEngine::parseGbeRegion(const QByteArray & gbe, QModelIndex & index, con
.arg(version->minor); .arg(version->minor);
// Add tree item // Add tree item
index = model->addItem(Region, GbeRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), gbe, QByteArray(), parent, mode); index = model->addItem(Types::Region, Subtypes::GbeRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), gbe, QByteArray(), parent, mode);
return ERR_SUCCESS; return ERR_SUCCESS;
} }
@ -412,7 +412,7 @@ UINT8 FfsEngine::parseMeRegion(const QByteArray & me, QModelIndex & index, const
} }
// Add tree item // Add tree item
index = model->addItem(Region, MeRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), me, QByteArray(), parent, mode); index = model->addItem(Types::Region, Subtypes::MeRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), me, QByteArray(), parent, mode);
return ERR_SUCCESS; return ERR_SUCCESS;
} }
@ -428,7 +428,7 @@ UINT8 FfsEngine::parsePdrRegion(const QByteArray & pdr, QModelIndex & index, con
arg(pdr.size(), 8, 16, QChar('0')); arg(pdr.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem(Region, PdrRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), pdr, QByteArray(), parent, mode); index = model->addItem(Types::Region, Subtypes::PdrRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), pdr, QByteArray(), parent, mode);
return ERR_SUCCESS; return ERR_SUCCESS;
} }
@ -444,7 +444,7 @@ UINT8 FfsEngine::parseBiosRegion(const QByteArray & bios, QModelIndex & index, c
arg(bios.size(), 8, 16, QChar('0')); arg(bios.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem(Region, BiosRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), bios, QByteArray(), parent, mode); index = model->addItem(Types::Region, Subtypes::BiosRegion, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), bios, QByteArray(), parent, mode);
return parseBios(bios, index); return parseBios(bios, index);
} }
@ -468,7 +468,7 @@ UINT8 FfsEngine::parseBios(const QByteArray & bios, const QModelIndex & parent)
info = tr("Size: %1") info = tr("Size: %1")
.arg(padding.size(), 8, 16, QChar('0')); .arg(padding.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
model->addItem( Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent); model->addItem(Types::Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent);
} }
// Search for and parse all volumes // Search for and parse all volumes
@ -487,7 +487,7 @@ UINT8 FfsEngine::parseBios(const QByteArray & bios, const QModelIndex & parent)
info = tr("Size: %1") info = tr("Size: %1")
.arg(padding.size(), 8, 16, QChar('0')); .arg(padding.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
model->addItem( Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent); model->addItem(Types::Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent);
} }
// Get volume size // Get volume size
@ -606,7 +606,7 @@ UINT8 FfsEngine::parseBios(const QByteArray & bios, const QModelIndex & parent)
info = tr("Size: %2") info = tr("Size: %2")
.arg(padding.size(), 8, 16, QChar('0')); .arg(padding.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
model->addItem( Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent); model->addItem(Types::Padding, 0, COMPRESSION_ALGORITHM_NONE, name, "", info, QByteArray(), padding, QByteArray(), parent);
} }
break; break;
} }
@ -680,7 +680,7 @@ UINT8 FfsEngine::parseVolume(const QByteArray & volume, QModelIndex & index, co
// Check for volume structure to be known // Check for volume structure to be known
// Default volume subtype is "normal" // Default volume subtype is "normal"
UINT8 subtype = NormalVolume; UINT8 subtype = Subtypes::NormalVolume;
// FFS GUID v1 // FFS GUID v1
if (QByteArray((const char*) &volumeHeader->FileSystemGuid, sizeof(EFI_GUID)) == EFI_FIRMWARE_FILE_SYSTEM_GUID) { if (QByteArray((const char*) &volumeHeader->FileSystemGuid, sizeof(EFI_GUID)) == EFI_FIRMWARE_FILE_SYSTEM_GUID) {
// Code can be added here // Code can be added here
@ -695,12 +695,12 @@ UINT8 FfsEngine::parseVolume(const QByteArray & volume, QModelIndex & index, co
} }
// NVRAM volume // NVRAM volume
else if (QByteArray((const char*)volumeHeader + headerSize, EFI_FIRMWARE_VOLUME_NVRAM_SIGNATURE.length()) == EFI_FIRMWARE_VOLUME_NVRAM_SIGNATURE) { else if (QByteArray((const char*)volumeHeader + headerSize, EFI_FIRMWARE_VOLUME_NVRAM_SIGNATURE.length()) == EFI_FIRMWARE_VOLUME_NVRAM_SIGNATURE) {
subtype = NvramVolume; subtype = Subtypes::NvramVolume;
} }
// Other GUID // Other GUID
else { else {
msg(tr("parseVolume: Unknown file system (%1)").arg(guidToQString(volumeHeader->FileSystemGuid)), parent); msg(tr("parseVolume: Unknown file system (%1)").arg(guidToQString(volumeHeader->FileSystemGuid)), parent);
subtype = UnknownVolume; subtype = Subtypes::UnknownVolume;
} }
// Check attributes // Check attributes
@ -727,7 +727,7 @@ UINT8 FfsEngine::parseVolume(const QByteArray & volume, QModelIndex & index, co
volumeSize = volumeHeader->FvLength; volumeSize = volumeHeader->FvLength;
// Check header checksum by recalculating it // Check header checksum by recalculating it
if (subtype == NormalVolume && calculateChecksum16((UINT16*)volumeHeader, volumeHeader->HeaderLength)) { if (subtype == Subtypes::NormalVolume && calculateChecksum16((UINT16*)volumeHeader, volumeHeader->HeaderLength)) {
msg(tr("parseVolume: Volume header checksum is invalid"), parent); msg(tr("parseVolume: Volume header checksum is invalid"), parent);
} }
@ -742,10 +742,10 @@ UINT8 FfsEngine::parseVolume(const QByteArray & volume, QModelIndex & index, co
// Add tree item // Add tree item
QByteArray header = volume.left(headerSize); QByteArray header = volume.left(headerSize);
QByteArray body = volume.mid(headerSize, volumeSize - headerSize); QByteArray body = volume.mid(headerSize, volumeSize - headerSize);
index = model->addItem(Volume, subtype, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Volume, subtype, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Do not parse the contents of volumes other then normal // Do not parse the contents of volumes other then normal
if (subtype != NormalVolume) if (subtype != Subtypes::NormalVolume)
return ERR_SUCCESS; return ERR_SUCCESS;
// Search for and parse all files // Search for and parse all files
@ -904,11 +904,11 @@ UINT8 FfsEngine::parseFile(const QByteArray & file, QModelIndex & index, const U
break; break;
case EFI_FV_FILETYPE_SECURITY_CORE: case EFI_FV_FILETYPE_SECURITY_CORE:
// Set parent volume type to BootVolume // Set parent volume type to BootVolume
model->setSubtype(parent, BootVolume); model->setSubtype(parent, Subtypes::BootVolume);
break; break;
case EFI_FV_FILETYPE_PEI_CORE: case EFI_FV_FILETYPE_PEI_CORE:
// Set parent volume type to BootVolume // Set parent volume type to BootVolume
model->setSubtype(parent, BootVolume); model->setSubtype(parent, Subtypes::BootVolume);
break; break;
case EFI_FV_FILETYPE_DXE_CORE: case EFI_FV_FILETYPE_DXE_CORE:
break; break;
@ -956,7 +956,7 @@ UINT8 FfsEngine::parseFile(const QByteArray & file, QModelIndex & index, const U
.arg(fileHeader->State, 2, 16, QChar('0')); .arg(fileHeader->State, 2, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem(File, fileHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, tail, parent, mode); index = model->addItem(Types::File, fileHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, tail, parent, mode);
if (!parseCurrentFile) if (!parseCurrentFile)
return ERR_SUCCESS; return ERR_SUCCESS;
@ -1054,7 +1054,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(compressedSectionHeader->UncompressedLength, 8, 16, QChar('0')); .arg(compressedSectionHeader->UncompressedLength, 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, algorithm, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, algorithm, name, "", info, header, body, QByteArray(), parent, mode);
// Parse decompressed data // Parse decompressed data
if (parseCurrentSection) { if (parseCurrentSection) {
@ -1100,7 +1100,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(compressionTypeToQString(algorithm)); .arg(compressionTypeToQString(algorithm));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, algorithm, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, algorithm, name, "", info, header, body, QByteArray(), parent, mode);
// Parse decompressed data // Parse decompressed data
if (parseCurrentSection) { if (parseCurrentSection) {
@ -1121,7 +1121,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Parse section body // Parse section body
result = parseSections(body, index); result = parseSections(body, index);
@ -1150,7 +1150,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Special case of PEI Core // Special case of PEI Core
if ((sectionHeader->Type == EFI_SECTION_PE32 || sectionHeader->Type == EFI_SECTION_TE) && model->subtype(parent) == EFI_FV_FILETYPE_PEI_CORE) { if ((sectionHeader->Type == EFI_SECTION_PE32 || sectionHeader->Type == EFI_SECTION_TE) && model->subtype(parent) == EFI_FV_FILETYPE_PEI_CORE) {
@ -1170,11 +1170,11 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Rename parent file // Rename parent file
QString text = QString::fromUtf16((const ushort*)body.constData()); QString text = QString::fromUtf16((const ushort*)body.constData());
model->setTextString(model->findParentOfType(parent, File), text); model->setTextString(model->findParentOfType(parent, Types::File), text);
} }
break; break;
case EFI_SECTION_FIRMWARE_VOLUME_IMAGE: case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
@ -1187,7 +1187,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Parse section body as BIOS space // Parse section body as BIOS space
result = parseBios(body, index); result = parseBios(body, index);
@ -1206,7 +1206,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Parse section body as BIOS space // Parse section body as BIOS space
result = parseBios(body, index); result = parseBios(body, index);
@ -1224,7 +1224,7 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
.arg(body.size(), 8, 16, QChar('0')); .arg(body.size(), 8, 16, QChar('0'));
// Add tree item // Add tree item
index = model->addItem( Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode); index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
msg(tr("parseSection: Section with unknown type (%1)").arg(sectionHeader->Type, 2, 16, QChar('0')), index); msg(tr("parseSection: Section with unknown type (%1)").arg(sectionHeader->Type, 2, 16, QChar('0')), index);
} }
return ERR_SUCCESS; return ERR_SUCCESS;
@ -1247,19 +1247,19 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
parent = index; parent = index;
// Create item // Create item
if (type == Region) { if (type == Types::Region) {
UINT8 subtype = model->subtype(index); UINT8 subtype = model->subtype(index);
switch (subtype) { switch (subtype) {
case BiosRegion: case Subtypes::BiosRegion:
result = parseBiosRegion(body, fileIndex, index, mode); result = parseBiosRegion(body, fileIndex, index, mode);
break; break;
case MeRegion: case Subtypes::MeRegion:
result = parseMeRegion(body, fileIndex, index, mode); result = parseMeRegion(body, fileIndex, index, mode);
break; break;
case GbeRegion: case Subtypes::GbeRegion:
result = parseGbeRegion(body, fileIndex, index, mode); result = parseGbeRegion(body, fileIndex, index, mode);
break; break;
case PdrRegion: case Subtypes::PdrRegion:
result = parsePdrRegion(body, fileIndex, index, mode); result = parsePdrRegion(body, fileIndex, index, mode);
break; break;
default: default:
@ -1272,8 +1272,8 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Set action // Set action
model->setAction(fileIndex, action); model->setAction(fileIndex, action);
} }
else if (type == File) { else if (type == Types::File) {
if (model->type(parent) != Volume) if (model->type(parent) != Types::Volume)
return ERR_INVALID_FILE; return ERR_INVALID_FILE;
EFI_FIRMWARE_VOLUME_HEADER* volumeHeader = (EFI_FIRMWARE_VOLUME_HEADER*) model->header(parent).constData(); EFI_FIRMWARE_VOLUME_HEADER* volumeHeader = (EFI_FIRMWARE_VOLUME_HEADER*) model->header(parent).constData();
@ -1333,8 +1333,8 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
// Rebase all PEI-files that follow // Rebase all PEI-files that follow
rebasePeiFiles(fileIndex); rebasePeiFiles(fileIndex);
} }
else if (type == Section) { else if (type == Types::Section) {
if (model->type(parent) != File && model->type(parent) != Section) if (model->type(parent) != Types::File && model->type(parent) != Types::Section)
return ERR_INVALID_SECTION; return ERR_INVALID_SECTION;
if (header.size() < (int) sizeof(EFI_COMMON_SECTION_HEADER)) if (header.size() < (int) sizeof(EFI_COMMON_SECTION_HEADER))
@ -1382,7 +1382,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
model->setAction(sectionIndex, action); model->setAction(sectionIndex, action);
// Find parent file for rebase // Find parent file for rebase
fileIndex = model->findParentOfType(parent, File); fileIndex = model->findParentOfType(parent, Types::File);
} }
break; break;
case EFI_SECTION_GUID_DEFINED:{ case EFI_SECTION_GUID_DEFINED:{
@ -1408,7 +1408,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
model->setAction(sectionIndex, action); model->setAction(sectionIndex, action);
// Find parent file for rebase // Find parent file for rebase
fileIndex = model->findParentOfType(parent, File); fileIndex = model->findParentOfType(parent, Types::File);
} }
break; break;
default: default:
@ -1428,7 +1428,7 @@ UINT8 FfsEngine::create(const QModelIndex & index, const UINT8 type, const QByte
model->setAction(sectionIndex, action); model->setAction(sectionIndex, action);
// Find parent file for rebase // Find parent file for rebase
fileIndex = model->findParentOfType(parent, File); fileIndex = model->findParentOfType(parent, Types::File);
} }
// Rebase all PEI-files that follow // Rebase all PEI-files that follow
@ -1455,7 +1455,7 @@ void FfsEngine::rebasePeiFiles(const QModelIndex & index)
// If section stores PE32 or TE image // If section stores PE32 or TE image
if (model->subtype(currentSectionIndex) == EFI_SECTION_PE32 || model->subtype(currentSectionIndex) == EFI_SECTION_TE) if (model->subtype(currentSectionIndex) == EFI_SECTION_PE32 || model->subtype(currentSectionIndex) == EFI_SECTION_TE)
// Set rebase action // Set rebase action
model->setAction(currentSectionIndex, Rebase); model->setAction(currentSectionIndex, Actions::Rebase);
} }
} }
} }
@ -1475,24 +1475,24 @@ UINT8 FfsEngine::insert(const QModelIndex & index, const QByteArray & object, co
// Determine type of item to insert // Determine type of item to insert
UINT8 type; UINT8 type;
UINT32 headerSize; UINT32 headerSize;
if (model->type(parent) == Volume) { if (model->type(parent) == Types::Volume) {
type = File; type = Types::File;
headerSize = sizeof(EFI_FFS_FILE_HEADER); headerSize = sizeof(EFI_FFS_FILE_HEADER);
} }
else if (model->type(parent) == File) { else if (model->type(parent) == Types::File) {
type = Section; type = Types::Section;
EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData(); EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData();
headerSize = sizeOfSectionHeaderOfType(commonHeader->Type); headerSize = sizeOfSectionHeaderOfType(commonHeader->Type);
} }
else if (model->type(parent) == Section) { else if (model->type(parent) == Types::Section) {
type = Section; type = Types::Section;
EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData(); EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData();
headerSize = sizeOfSectionHeaderOfType(commonHeader->Type); headerSize = sizeOfSectionHeaderOfType(commonHeader->Type);
} }
else else
return ERR_NOT_IMPLEMENTED; return ERR_NOT_IMPLEMENTED;
return create(index, type, object.left(headerSize), object.right(object.size() - headerSize), mode, Insert); return create(index, type, object.left(headerSize), object.right(object.size() - headerSize), mode, Actions::Insert);
} }
UINT8 FfsEngine::replace(const QModelIndex & index, const QByteArray & object, const UINT8 mode) UINT8 FfsEngine::replace(const QModelIndex & index, const QByteArray & object, const UINT8 mode)
@ -1503,30 +1503,30 @@ UINT8 FfsEngine::replace(const QModelIndex & index, const QByteArray & object, c
// Determine type of item to replace // Determine type of item to replace
UINT32 headerSize; UINT32 headerSize;
UINT8 result; UINT8 result;
if (model->type(index) == Region) { if (model->type(index) == Types::Region) {
if (mode == REPLACE_MODE_AS_IS) if (mode == REPLACE_MODE_AS_IS)
result = create(index, Region, QByteArray(), object, CREATE_MODE_AFTER, Replace); result = create(index, Types::Region, QByteArray(), object, CREATE_MODE_AFTER, Actions::Replace);
else else
return ERR_NOT_IMPLEMENTED; return ERR_NOT_IMPLEMENTED;
} }
else if (model->type(index) == File) { else if (model->type(index) == Types::File) {
if (mode == REPLACE_MODE_AS_IS) { if (mode == REPLACE_MODE_AS_IS) {
headerSize = sizeof(EFI_FFS_FILE_HEADER); headerSize = sizeof(EFI_FFS_FILE_HEADER);
result = create(index, File, object.left(headerSize), object.right(object.size() - headerSize), CREATE_MODE_AFTER, Replace); result = create(index, Types::File, object.left(headerSize), object.right(object.size() - headerSize), CREATE_MODE_AFTER, Actions::Replace);
} }
else if (mode == REPLACE_MODE_BODY) else if (mode == REPLACE_MODE_BODY)
result = create(index, File, model->header(index), object, CREATE_MODE_AFTER, Replace); result = create(index, Types::File, model->header(index), object, CREATE_MODE_AFTER, Actions::Replace);
else else
return ERR_NOT_IMPLEMENTED; return ERR_NOT_IMPLEMENTED;
} }
else if (model->type(index) == Section) { else if (model->type(index) == Types::Section) {
if (mode == REPLACE_MODE_AS_IS) { if (mode == REPLACE_MODE_AS_IS) {
EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData(); EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) object.constData();
headerSize = sizeOfSectionHeaderOfType(commonHeader->Type); headerSize = sizeOfSectionHeaderOfType(commonHeader->Type);
result = create(index, Section, object.left(headerSize), object.right(object.size() - headerSize), CREATE_MODE_AFTER, Replace); result = create(index, Types::Section, object.left(headerSize), object.right(object.size() - headerSize), CREATE_MODE_AFTER, Actions::Replace);
} }
else if (mode == REPLACE_MODE_BODY) { else if (mode == REPLACE_MODE_BODY) {
result = create(index, Section, model->header(index), object, CREATE_MODE_AFTER, Replace, model->compression(index)); result = create(index, Types::Section, model->header(index), object, CREATE_MODE_AFTER, Actions::Replace, model->compression(index));
} }
else else
return ERR_NOT_IMPLEMENTED; return ERR_NOT_IMPLEMENTED;
@ -1539,7 +1539,7 @@ UINT8 FfsEngine::replace(const QModelIndex & index, const QByteArray & object, c
return result; return result;
// Set remove action to replaced item // Set remove action to replaced item
model->setAction(index, Remove); model->setAction(index, Actions::Remove);
return ERR_SUCCESS; return ERR_SUCCESS;
} }
@ -1561,7 +1561,7 @@ UINT8 FfsEngine::extract(const QModelIndex & index, QByteArray & extracted, cons
// Extract without header and tail // Extract without header and tail
extracted.clear(); extracted.clear();
// Special case of compressed bodies // Special case of compressed bodies
if (model->type(index) == Section) { if (model->type(index) == Types::Section) {
QByteArray decompressed; QByteArray decompressed;
UINT8 result; UINT8 result;
if (model->subtype(index) == EFI_SECTION_COMPRESSION) { if (model->subtype(index) == EFI_SECTION_COMPRESSION) {
@ -1604,16 +1604,16 @@ UINT8 FfsEngine::remove(const QModelIndex & index)
return ERR_INVALID_PARAMETER; return ERR_INVALID_PARAMETER;
// Set action for the item // Set action for the item
model->setAction(index, Remove); model->setAction(index, Actions::Remove);
QModelIndex fileIndex; QModelIndex fileIndex;
if (model->type(index) == Volume && model->rowCount(index) > 0) if (model->type(index) == Types::Volume && model->rowCount(index) > 0)
fileIndex = index.child(0, 0); fileIndex = index.child(0, 0);
else if(model->type(index) == File) else if (model->type(index) == Types::File)
fileIndex = index; fileIndex = index;
else if (model->type(index) == Section) else if (model->type(index) == Types::Section)
fileIndex = model->findParentOfType(index, File); fileIndex = model->findParentOfType(index, Types::File);
else else
return ERR_SUCCESS; return ERR_SUCCESS;
@ -1629,16 +1629,16 @@ UINT8 FfsEngine::rebuild(const QModelIndex & index)
return ERR_INVALID_PARAMETER; return ERR_INVALID_PARAMETER;
// Set action for the item // Set action for the item
model->setAction(index, Rebuild); model->setAction(index, Actions::Rebuild);
QModelIndex fileIndex; QModelIndex fileIndex;
if (model->type(index) == Volume && model->rowCount(index) > 0) if (model->type(index) == Types::Volume && model->rowCount(index) > 0)
fileIndex = index.child(0, 0); fileIndex = index.child(0, 0);
else if (model->type(index) == File) else if (model->type(index) == Types::File)
fileIndex = index; fileIndex = index;
else if (model->type(index) == Section) else if (model->type(index) == Types::Section)
fileIndex = model->findParentOfType(index, File); fileIndex = model->findParentOfType(index, Types::File);
else else
return ERR_SUCCESS; return ERR_SUCCESS;
@ -1875,13 +1875,13 @@ UINT8 FfsEngine::reconstructIntelImage(const QModelIndex& index, QByteArray& rec
UINT8 result; UINT8 result;
// No action // No action
if (model->action(index) == NoAction) { if (model->action(index) == Actions::NoAction) {
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
} }
// Other supported actions // Other supported actions
else if (model->action(index) == Rebuild) { else if (model->action(index) == Actions::Rebuild) {
reconstructed.clear(); reconstructed.clear();
// First child will always be descriptor for this type of image // First child will always be descriptor for this type of image
QByteArray descriptor; QByteArray descriptor;
@ -1916,28 +1916,28 @@ UINT8 FfsEngine::reconstructIntelImage(const QModelIndex& index, QByteArray& rec
switch(model->subtype(index.child(i, 0))) switch(model->subtype(index.child(i, 0)))
{ {
case GbeRegion: case Subtypes::GbeRegion:
gbe = region; gbe = region;
if (gbeBegin > offset) if (gbeBegin > offset)
reconstructed.append(QByteArray(gbeBegin - offset, empty)); reconstructed.append(QByteArray(gbeBegin - offset, empty));
reconstructed.append(gbe); reconstructed.append(gbe);
offset = gbeEnd; offset = gbeEnd;
break; break;
case MeRegion: case Subtypes::MeRegion:
me = region; me = region;
if (meBegin > offset) if (meBegin > offset)
reconstructed.append(QByteArray(meBegin - offset, empty)); reconstructed.append(QByteArray(meBegin - offset, empty));
reconstructed.append(me); reconstructed.append(me);
offset = meEnd; offset = meEnd;
break; break;
case BiosRegion: case Subtypes::BiosRegion:
bios = region; bios = region;
if (biosBegin > offset) if (biosBegin > offset)
reconstructed.append(QByteArray(biosBegin - offset, empty)); reconstructed.append(QByteArray(biosBegin - offset, empty));
reconstructed.append(bios); reconstructed.append(bios);
offset = biosEnd; offset = biosEnd;
break; break;
case PdrRegion: case Subtypes::PdrRegion:
pdr = region; pdr = region;
if (pdrBegin > offset) if (pdrBegin > offset)
reconstructed.append(QByteArray(pdrBegin - offset, empty)); reconstructed.append(QByteArray(pdrBegin - offset, empty));
@ -1982,16 +1982,16 @@ UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconst
UINT8 result; UINT8 result;
// No action // No action
if (model->action(index) == NoAction) { if (model->action(index) == Actions::NoAction) {
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Remove) { else if (model->action(index) == Actions::Remove) {
reconstructed.clear(); reconstructed.clear();
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Rebuild || else if (model->action(index) == Actions::Rebuild ||
model->action(index) == Replace) { model->action(index) == Actions::Replace) {
if (model->rowCount(index)) { if (model->rowCount(index)) {
reconstructed.clear(); reconstructed.clear();
// Reconstruct children // Reconstruct children
@ -2038,18 +2038,18 @@ UINT8 FfsEngine::reconstructVolume(const QModelIndex & index, QByteArray & recon
UINT8 result; UINT8 result;
// No action // No action
if (model->action(index) == NoAction) { if (model->action(index) == Actions::NoAction) {
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Remove) { else if (model->action(index) == Actions::Remove) {
reconstructed.clear(); reconstructed.clear();
EFI_FIRMWARE_VOLUME_HEADER* volumeHeader = (EFI_FIRMWARE_VOLUME_HEADER*) model->header(index).constData(); EFI_FIRMWARE_VOLUME_HEADER* volumeHeader = (EFI_FIRMWARE_VOLUME_HEADER*) model->header(index).constData();
char empty = volumeHeader->Attributes & EFI_FVB_ERASE_POLARITY ? '\xFF' : '\x00'; char empty = volumeHeader->Attributes & EFI_FVB_ERASE_POLARITY ? '\xFF' : '\x00';
reconstructed.fill(empty, model->header(index).size() + model->body(index).size() + model->tail(index).size()); reconstructed.fill(empty, model->header(index).size() + model->body(index).size() + model->tail(index).size());
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Rebuild) { else if (model->action(index) == Actions::Rebuild) {
//!TODO: add check for weak aligned volume //!TODO: add check for weak aligned volume
//!TODO: better return codes //!TODO: better return codes
QByteArray header = model->header(index); QByteArray header = model->header(index);
@ -2090,7 +2090,7 @@ UINT8 FfsEngine::reconstructVolume(const QModelIndex & index, QByteArray & recon
// Determine if volume is inside compressed item // Determine if volume is inside compressed item
if (!baseFound) { if (!baseFound) {
// Iterate up to the root, checking for compression type to be other then none // Iterate up to the root, checking for compression type to be other then none
for (QModelIndex parentIndex = index.parent(); model->type(parentIndex) != Root; parentIndex = parentIndex.parent()) for (QModelIndex parentIndex = index.parent(); model->type(parentIndex) != Types::Root; parentIndex = parentIndex.parent())
if (model->compression(parentIndex) != COMPRESSION_ALGORITHM_NONE) { if (model->compression(parentIndex) != COMPRESSION_ALGORITHM_NONE) {
// No rebase needed for compressed PEI files // No rebase needed for compressed PEI files
baseFound = true; baseFound = true;
@ -2115,7 +2115,7 @@ UINT8 FfsEngine::reconstructVolume(const QModelIndex & index, QByteArray & recon
model->subtype(peiFile.child(j,0)) == EFI_SECTION_TE) { model->subtype(peiFile.child(j,0)) == EFI_SECTION_TE) {
QModelIndex image = peiFile.child(j,0); QModelIndex image = peiFile.child(j,0);
// Check for correct action // Check for correct action
if (model->action(image) == Remove || model->action(image) == Insert) if (model->action(image) == Actions::Remove || model->action(image) == Actions::Insert)
continue; continue;
// Calculate relative base address // Calculate relative base address
UINT32 relbase = fileOffset + sectionOffset + model->header(image).size(); UINT32 relbase = fileOffset + sectionOffset + model->header(image).size();
@ -2270,7 +2270,7 @@ out:
// Check if volume can be grown // Check if volume can be grown
// Root volume can't be grown yet // Root volume can't be grown yet
UINT8 parentType = model->type(index.parent()); UINT8 parentType = model->type(index.parent());
if(parentType != File && parentType != Section) { if(parentType != Types::File && parentType != Types::Section) {
msg(tr("reconstructVolume: %1: root volume can't be grown").arg(guidToQString(volumeHeader->FileSystemGuid)), index); msg(tr("reconstructVolume: %1: root volume can't be grown").arg(guidToQString(volumeHeader->FileSystemGuid)), index);
return ERR_INVALID_VOLUME; return ERR_INVALID_VOLUME;
} }
@ -2315,17 +2315,17 @@ UINT8 FfsEngine::reconstructFile(const QModelIndex& index, const UINT8 revision,
UINT8 result; UINT8 result;
// No action // No action
if (model->action(index) == NoAction) { if (model->action(index) == Actions::NoAction) {
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Remove) { else if (model->action(index) == Actions::Remove) {
reconstructed.clear(); reconstructed.clear();
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Insert || else if (model->action(index) == Actions::Insert ||
model->action(index) == Replace || model->action(index) == Actions::Replace ||
model->action(index) == Rebuild) { model->action(index) == Actions::Rebuild) {
QByteArray header = model->header(index); QByteArray header = model->header(index);
EFI_FFS_FILE_HEADER* fileHeader = (EFI_FFS_FILE_HEADER*)header.data(); EFI_FFS_FILE_HEADER* fileHeader = (EFI_FFS_FILE_HEADER*)header.data();
@ -2475,18 +2475,18 @@ UINT8 FfsEngine::reconstructSection(const QModelIndex& index, const UINT32 base,
UINT8 result; UINT8 result;
// No action // No action
if (model->action(index) == NoAction) { if (model->action(index) == Actions::NoAction) {
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Remove) { else if (model->action(index) == Actions::Remove) {
reconstructed.clear(); reconstructed.clear();
return ERR_SUCCESS; return ERR_SUCCESS;
} }
else if (model->action(index) == Insert || else if (model->action(index) == Actions::Insert ||
model->action(index) == Replace || model->action(index) == Actions::Replace ||
model->action(index) == Rebuild || model->action(index) == Actions::Rebuild ||
model->action(index) == Rebase) { model->action(index) == Actions::Rebase) {
QByteArray header = model->header(index); QByteArray header = model->header(index);
EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) header.data(); EFI_COMMON_SECTION_HEADER* commonHeader = (EFI_COMMON_SECTION_HEADER*) header.data();
@ -2613,8 +2613,8 @@ UINT8 FfsEngine::reconstruct(const QModelIndex &index, QByteArray& reconstructed
UINT8 result; UINT8 result;
switch(model->type(index)) { switch(model->type(index)) {
case Image: case Types::Image:
if (model->subtype(index) == IntelImage) { if (model->subtype(index) == Subtypes::IntelImage) {
result = reconstructIntelImage(index, reconstructed); result = reconstructIntelImage(index, reconstructed);
if (result) if (result)
return result; return result;
@ -2627,8 +2627,8 @@ UINT8 FfsEngine::reconstruct(const QModelIndex &index, QByteArray& reconstructed
} }
break; break;
case Capsule: case Types::Capsule:
if (model->subtype(index) == AptioCapsule) if (model->subtype(index) == Subtypes::AptioCapsule)
msg(tr("reconstruct: Aptio capsule checksum and signature can now become invalid"), index); msg(tr("reconstruct: Aptio capsule checksum and signature can now become invalid"), index);
// Capsules can be reconstructed like regions // Capsules can be reconstructed like regions
result = reconstructRegion(index, reconstructed); result = reconstructRegion(index, reconstructed);
@ -2636,30 +2636,30 @@ UINT8 FfsEngine::reconstruct(const QModelIndex &index, QByteArray& reconstructed
return result; return result;
break; break;
case Region: case Types::Region:
result = reconstructRegion(index, reconstructed); result = reconstructRegion(index, reconstructed);
if (result) if (result)
return result; return result;
break; break;
case Padding: case Types::Padding:
// No reconstruction needed // No reconstruction needed
reconstructed = model->header(index).append(model->body(index)).append(model->tail(index)); reconstructed = model->header(index).append(model->body(index)).append(model->tail(index));
return ERR_SUCCESS; return ERR_SUCCESS;
break; break;
case Volume: case Types::Volume:
result = reconstructVolume(index, reconstructed); result = reconstructVolume(index, reconstructed);
if (result) if (result)
return result; return result;
break; break;
case File: //Must not be called that way case Types::File: //Must not be called that way
msg(tr("reconstruct: call of generic function is not supported for files").arg(model->type(index)), index); msg(tr("reconstruct: call of generic function is not supported for files").arg(model->type(index)), index);
return ERR_GENERIC_CALL_NOT_SUPPORTED; return ERR_GENERIC_CALL_NOT_SUPPORTED;
break; break;
case Section: case Types::Section:
result = reconstructSection(index, 0, reconstructed); result = reconstructSection(index, 0, reconstructed);
if (result) if (result)
return result; return result;

View File

@ -13,97 +13,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QObject> #include <QObject>
#include "treeitem.h" #include "treeitem.h"
#include "ffs.h" #include "types.h"
#include "descriptor.h"
QString itemTypeToQString(const UINT8 type)
{
switch (type) {
case Root:
return QObject::tr("Root");
case Image:
return QObject::tr("Image");
case Capsule:
return QObject::tr("Capsule");
case Region:
return QObject::tr("Region");
case Volume:
return QObject::tr("Volume");
case Padding:
return QObject::tr("Padding");
case File:
return QObject::tr("File");
case Section:
return QObject::tr("Section");
default:
return QObject::tr("Unknown");
}
}
QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype)
{
switch (type) {
case Root:
case Image:
if (subtype == IntelImage)
return QObject::tr("Intel");
else if (subtype == BiosImage)
return QObject::tr("BIOS");
else
return QObject::tr("Unknown");
case Padding:
return "";
case Volume:
if (subtype == BootVolume)
return QObject::tr("Boot");
else if (subtype == UnknownVolume)
return QObject::tr("Unknown");
else if (subtype == NvramVolume)
return QObject::tr("NVRAM");
else
return "";
case Capsule:
if (subtype == AptioCapsule)
return QObject::tr("AMI Aptio");
else if (subtype == UefiCapsule)
return QObject::tr("UEFI 2.0");
else
return QObject::tr("Unknown");
case Region:
return regionTypeToQString(subtype);
case File:
return fileTypeToQString(subtype);
case Section:
return sectionTypeToQString(subtype);
default:
return QObject::tr("Unknown");
}
}
QString compressionTypeToQString(UINT8 algorithm)
{
switch (algorithm) {
case COMPRESSION_ALGORITHM_NONE:
return QObject::tr("None");
case COMPRESSION_ALGORITHM_EFI11:
return QObject::tr("EFI 1.1");
case COMPRESSION_ALGORITHM_TIANO:
return QObject::tr("Tiano");
case COMPRESSION_ALGORITHM_LZMA:
return QObject::tr("LZMA");
case COMPRESSION_ALGORITHM_IMLZMA:
return QObject::tr("Intel modified LZMA");
default:
return QObject::tr("Unknown");
}
}
TreeItem::TreeItem(const UINT8 type, const UINT8 subtype, const UINT8 compression, TreeItem::TreeItem(const UINT8 type, const UINT8 subtype, const UINT8 compression,
const QString & name, const QString & text, const QString & info, const QString & name, const QString & text, const QString & info,
const QByteArray & header, const QByteArray & body, const QByteArray & tail, const QByteArray & header, const QByteArray & body, const QByteArray & tail,
TreeItem *parent) TreeItem *parent)
{ {
itemAction = NoAction; itemAction = Actions::NoAction;
itemType = type; itemType = type;
itemSubtype = subtype; itemSubtype = subtype;
itemCompression = compression; itemCompression = compression;
@ -180,19 +100,7 @@ QVariant TreeItem::data(int column) const
case 0: //Name case 0: //Name
return itemName; return itemName;
case 1: //Action case 1: //Action
if (itemAction == Create) return actionTypeToQString(itemAction);
return QObject::tr("Create");
if (itemAction == Insert)
return QObject::tr("Insert");
if (itemAction == Replace)
return QObject::tr("Replace");
if (itemAction == Remove)
return QObject::tr("Remove");
if (itemAction == Rebuild)
return QObject::tr("Rebuild");
if (itemAction == Rebase)
return QObject::tr("Rebase");
return QVariant();
case 2: //Type case 2: //Type
return itemTypeName; return itemTypeName;
case 3: //Subtype case 3: //Subtype
@ -297,14 +205,14 @@ void TreeItem::setAction(const UINT8 action)
itemAction = action; itemAction = action;
// On insert action, set insert action for children // On insert action, set insert action for children
if (action == Insert) if (action == Actions::Insert)
for(int i = 0; i < childCount(); i++) for(int i = 0; i < childCount(); i++)
child(i)->setAction(Insert); child(i)->setAction(Actions::Insert);
// Set rebuild action for parent, if it has no action now // Set rebuild action for parent, if it has no action now
if (parentItem && parentItem->type() != Root if (parentItem && parentItem->type() != Types::Root
&& parentItem->action() == NoAction) && parentItem->action() == Actions::NoAction)
parentItem->setAction(Rebuild); parentItem->setAction(Actions::Rebuild);
} }
void TreeItem::setSubtype(const UINT8 subtype) void TreeItem::setSubtype(const UINT8 subtype)

View File

@ -21,10 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "basetypes.h" #include "basetypes.h"
extern QString itemTypeToQString(const UINT8 type);
extern QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype);
extern QString compressionTypeToQString(UINT8 algorithm);
class TreeItem class TreeItem
{ {
public: public:

View File

@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
TreeModel::TreeModel(QObject *parent) TreeModel::TreeModel(QObject *parent)
: QAbstractItemModel(parent) : QAbstractItemModel(parent)
{ {
rootItem = new TreeItem(Root); rootItem = new TreeItem(Types::Root);
} }
TreeModel::~TreeModel() TreeModel::~TreeModel()
@ -207,7 +207,7 @@ QString TreeModel::info(const QModelIndex &index) const
UINT8 TreeModel::action(const QModelIndex &index) const UINT8 TreeModel::action(const QModelIndex &index) const
{ {
if(!index.isValid()) if(!index.isValid())
return NoAction; return Actions::NoAction;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer()); TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
return item->action(); return item->action();
} }

View File

@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QVariant> #include <QVariant>
#include "basetypes.h" #include "basetypes.h"
#include "types.h"
class TreeItem; class TreeItem;

141
types.cpp Normal file
View File

@ -0,0 +1,141 @@
/* types.cpp
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#include <QObject>
#include <QString>
#include "types.h"
#include "ffs.h"
QString regionTypeToQString(const UINT8 type)
{
switch (type)
{
case Subtypes::DescriptorRegion:
return QObject::tr("Descriptor");
case Subtypes::GbeRegion:
return QObject::tr("GbE");
case Subtypes::MeRegion:
return QObject::tr("ME");
case Subtypes::BiosRegion:
return QObject::tr("BIOS");
case Subtypes::PdrRegion:
return QObject::tr("PDR");
default:
return QObject::tr("Unknown");
};
}
QString itemTypeToQString(const UINT8 type)
{
switch (type) {
case Types::Root:
return QObject::tr("Root");
case Types::Image:
return QObject::tr("Image");
case Types::Capsule:
return QObject::tr("Capsule");
case Types::Region:
return QObject::tr("Region");
case Types::Volume:
return QObject::tr("Volume");
case Types::Padding:
return QObject::tr("Padding");
case Types::File:
return QObject::tr("File");
case Types::Section:
return QObject::tr("Section");
default:
return QObject::tr("Unknown");
}
}
QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype)
{
switch (type) {
case Types::Root:
case Types::Image:
if (subtype == Subtypes::IntelImage)
return QObject::tr("Intel");
else if (subtype == Subtypes::BiosImage)
return QObject::tr("BIOS");
else
return QObject::tr("Unknown");
case Types::Padding:
return "";
case Types::Volume:
if (subtype == Subtypes::BootVolume)
return QObject::tr("Boot");
else if (subtype == Subtypes::UnknownVolume)
return QObject::tr("Unknown");
else if (subtype == Subtypes::NvramVolume)
return QObject::tr("NVRAM");
else
return "";
case Types::Capsule:
if (subtype == Subtypes::AptioCapsule)
return QObject::tr("AMI Aptio");
else if (subtype == Subtypes::UefiCapsule)
return QObject::tr("UEFI 2.0");
else
return QObject::tr("Unknown");
case Types::Region:
return regionTypeToQString(subtype);
case Types::File:
return fileTypeToQString(subtype);
case Types::Section:
return sectionTypeToQString(subtype);
default:
return QObject::tr("Unknown");
}
}
QString compressionTypeToQString(UINT8 algorithm)
{
switch (algorithm) {
case COMPRESSION_ALGORITHM_NONE:
return QObject::tr("None");
case COMPRESSION_ALGORITHM_EFI11:
return QObject::tr("EFI 1.1");
case COMPRESSION_ALGORITHM_TIANO:
return QObject::tr("Tiano");
case COMPRESSION_ALGORITHM_LZMA:
return QObject::tr("LZMA");
case COMPRESSION_ALGORITHM_IMLZMA:
return QObject::tr("Intel modified LZMA");
default:
return QObject::tr("Unknown");
}
}
QString actionTypeToQString(UINT8 action)
{
switch (action) {
case Actions::NoAction:
return "";
case Actions::Create:
return QObject::tr("Create");
case Actions::Insert:
return QObject::tr("Insert");
case Actions::Replace:
return QObject::tr("Replace");
case Actions::Remove:
return QObject::tr("Remove");
case Actions::Rebuild:
return QObject::tr("Rebuild");
case Actions::Rebase:
return QObject::tr("Rebase");
default:
return QObject::tr("Unknown");
}
}

80
types.h Normal file
View File

@ -0,0 +1,80 @@
/* types.h
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#ifndef __TYPES_H__
#define __TYPES_H__
#include "basetypes.h"
// Actions
namespace Actions
{
enum ActionTypes {
NoAction = 50,
Create,
Insert,
Replace,
Remove,
Rebuild,
Rebase
};
}
// Types
namespace Types {
enum ItemTypes {
Root = 60,
Capsule,
Image,
Region,
Padding,
Volume,
File,
Section
};
}
namespace Subtypes {
enum ImageSubtypes{
IntelImage = 70,
BiosImage
};
enum CapsuleSubtypes {
AptioCapsule = 80,
UefiCapsule
};
enum VolumeSubtypes {
NormalVolume = 90,
BootVolume,
UnknownVolume,
NvramVolume
};
enum RegionSubtypes {
DescriptorRegion = 100,
GbeRegion,
MeRegion,
BiosRegion,
PdrRegion
};
};
// *ToQString conversion routines
extern QString actionTypeToQString(const UINT8 action);
extern QString itemTypeToQString(const UINT8 type);
extern QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype);
extern QString compressionTypeToQString(UINT8 algorithm);
extern QString regionTypeToQString(const UINT8 type);
#endif

View File

@ -99,26 +99,26 @@ void UEFITool::populateUi(const QModelIndex &current)
ui->infoEdit->setPlainText(model->info(current)); ui->infoEdit->setPlainText(model->info(current));
// Enable menus // Enable menus
ui->menuCapsuleActions->setEnabled(type == Capsule); ui->menuCapsuleActions->setEnabled(type == Types::Capsule);
ui->menuImageActions->setEnabled(type == Image); ui->menuImageActions->setEnabled(type == Types::Image);
ui->menuRegionActions->setEnabled(type == Region); ui->menuRegionActions->setEnabled(type == Types::Region);
ui->menuPaddingActions->setEnabled(type == Padding); ui->menuPaddingActions->setEnabled(type == Types::Padding);
ui->menuVolumeActions->setEnabled(type == Volume); ui->menuVolumeActions->setEnabled(type == Types::Volume);
ui->menuFileActions->setEnabled(type == File); ui->menuFileActions->setEnabled(type == Types::File);
ui->menuSectionActions->setEnabled(type == Section); ui->menuSectionActions->setEnabled(type == Types::Section);
// Enable actions // Enable actions
ui->actionExtract->setDisabled(model->hasEmptyHeader(current) && model->hasEmptyBody(current) && model->hasEmptyTail(current)); ui->actionExtract->setDisabled(model->hasEmptyHeader(current) && model->hasEmptyBody(current) && model->hasEmptyTail(current));
ui->actionRebuild->setEnabled(type == Volume || type == File || type == Section); ui->actionRebuild->setEnabled(type == Types::Volume || type == Types::File || type == Types::Section);
ui->actionExtractBody->setDisabled(model->hasEmptyHeader(current)); ui->actionExtractBody->setDisabled(model->hasEmptyHeader(current));
ui->actionRemove->setEnabled(type == Volume || type == File || type == Section); ui->actionRemove->setEnabled(type == Types::Volume || type == Types::File || type == Types::Section);
ui->actionInsertInto->setEnabled((type == Volume && subtype != UnknownVolume) || ui->actionInsertInto->setEnabled((type == Types::Volume && subtype != Subtypes::UnknownVolume) ||
(type == File && subtype != EFI_FV_FILETYPE_ALL && subtype != EFI_FV_FILETYPE_RAW && subtype != EFI_FV_FILETYPE_PAD) || (type == Types::File && subtype != EFI_FV_FILETYPE_ALL && subtype != EFI_FV_FILETYPE_RAW && subtype != EFI_FV_FILETYPE_PAD) ||
(type == Section && (subtype == EFI_SECTION_COMPRESSION || subtype == EFI_SECTION_GUID_DEFINED || subtype == EFI_SECTION_DISPOSABLE))); (type == Types::Section && (subtype == EFI_SECTION_COMPRESSION || subtype == EFI_SECTION_GUID_DEFINED || subtype == EFI_SECTION_DISPOSABLE)));
ui->actionInsertBefore->setEnabled(type == File || type == Section); ui->actionInsertBefore->setEnabled(type == Types::File || type == Types::Section);
ui->actionInsertAfter->setEnabled(type == File || type == Section); ui->actionInsertAfter->setEnabled(type == Types::File || type == Types::Section);
ui->actionReplace->setEnabled((type == Region && subtype != DescriptorRegion) || type == File || type == Section); ui->actionReplace->setEnabled((type == Types::Region && subtype != Subtypes::DescriptorRegion) || type == Types::File || type == Types::Section);
ui->actionReplaceBody->setEnabled(type == File || type == Section); ui->actionReplaceBody->setEnabled(type == Types::File || type == Types::Section);
} }
void UEFITool::search() void UEFITool::search()
@ -194,11 +194,11 @@ void UEFITool::insert(const UINT8 mode)
QString path; QString path;
switch (type) { switch (type) {
case Volume: case Types::Volume:
path = QFileDialog::getOpenFileName(this, tr("Select FFS file to insert"),".","FFS files (*.ffs *.bin);;All files (*.*)"); path = QFileDialog::getOpenFileName(this, tr("Select FFS file to insert"),".","FFS files (*.ffs *.bin);;All files (*.*)");
break; break;
case File: case Types::File:
case Section: case Types::Section:
path = QFileDialog::getOpenFileName(this, tr("Select section file to insert"),".","Section files (*.sct *.bin);;All files (*.*)"); path = QFileDialog::getOpenFileName(this, tr("Select section file to insert"),".","Section files (*.sct *.bin);;All files (*.*)");
break; break;
default: default:
@ -262,14 +262,14 @@ void UEFITool::replace(const UINT8 mode)
TreeModel* model = ffsEngine->treeModel(); TreeModel* model = ffsEngine->treeModel();
QString path; QString path;
if (model->type(index) == Region) { if (model->type(index) == Types::Region) {
if (mode == REPLACE_MODE_AS_IS) { if (mode == REPLACE_MODE_AS_IS) {
path = QFileDialog::getOpenFileName(this, tr("Select region file to replace selected object"), ".", "Region files (*.rgn *.bin);;All files (*.*)"); path = QFileDialog::getOpenFileName(this, tr("Select region file to replace selected object"), ".", "Region files (*.rgn *.bin);;All files (*.*)");
} }
else else
return; return;
} }
else if (model->type(index) == File) { else if (model->type(index) == Types::File) {
if (mode == REPLACE_MODE_AS_IS) { if (mode == REPLACE_MODE_AS_IS) {
path = QFileDialog::getOpenFileName(this, tr("Select FFS file to replace selected object"),".","FFS files (*.ffs *.bin);;All files (*.*)"); path = QFileDialog::getOpenFileName(this, tr("Select FFS file to replace selected object"),".","FFS files (*.ffs *.bin);;All files (*.*)");
} }
@ -284,7 +284,7 @@ void UEFITool::replace(const UINT8 mode)
else else
return; return;
} }
else if (model->type(index) == Section) { else if (model->type(index) == Types::Section) {
if (mode == REPLACE_MODE_AS_IS) { if (mode == REPLACE_MODE_AS_IS) {
path = QFileDialog::getOpenFileName(this, tr("Select section file to replace selected object"),".","Section files (*.sec *.bin);;All files (*.*)"); path = QFileDialog::getOpenFileName(this, tr("Select section file to replace selected object"),".","Section files (*.sec *.bin);;All files (*.*)");
} }
@ -350,25 +350,25 @@ void UEFITool::extract(const UINT8 mode)
QString path; QString path;
if (mode == EXTRACT_MODE_AS_IS) { if (mode == EXTRACT_MODE_AS_IS) {
switch (type) { switch (type) {
case Capsule: case Types::Capsule:
path = QFileDialog::getSaveFileName(this, tr("Save capsule to file"),".","Capsule files (*.cap *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save capsule to file"),".","Capsule files (*.cap *.bin);;All files (*.*)");
break; break;
case Image: case Types::Image:
path = QFileDialog::getSaveFileName(this, tr("Save image to file"),".","Image files (*.rom *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save image to file"),".","Image files (*.rom *.bin);;All files (*.*)");
break; break;
case Region: case Types::Region:
path = QFileDialog::getSaveFileName(this, tr("Save region to file"),".","Region files (*.rgn *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save region to file"),".","Region files (*.rgn *.bin);;All files (*.*)");
break; break;
case Padding: case Types::Padding:
path = QFileDialog::getSaveFileName(this, tr("Save padding to file"),".","Padding files (*.pad *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save padding to file"),".","Padding files (*.pad *.bin);;All files (*.*)");
break; break;
case Volume: case Types::Volume:
path = QFileDialog::getSaveFileName(this, tr("Save volume to file"),".","Volume files (*.vol *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save volume to file"),".","Volume files (*.vol *.bin);;All files (*.*)");
break; break;
case File: case Types::File:
path = QFileDialog::getSaveFileName(this, tr("Save FFS file to file"),".","FFS files (*.ffs *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save FFS file to file"),".","FFS files (*.ffs *.bin);;All files (*.*)");
break; break;
case Section: case Types::Section:
path = QFileDialog::getSaveFileName(this, tr("Save section file to file"),".","Section files (*.sct *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save section file to file"),".","Section files (*.sct *.bin);;All files (*.*)");
break; break;
default: default:
@ -377,17 +377,17 @@ void UEFITool::extract(const UINT8 mode)
} }
else if (mode == EXTRACT_MODE_BODY) { else if (mode == EXTRACT_MODE_BODY) {
switch (type) { switch (type) {
case Capsule: case Types::Capsule:
path = QFileDialog::getSaveFileName(this, tr("Save capsule body to image file"),".","Image files (*.rom *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save capsule body to image file"),".","Image files (*.rom *.bin);;All files (*.*)");
break; break;
case File: { case Types::File: {
if (model->subtype(index) == EFI_FV_FILETYPE_ALL || model->subtype(index) == EFI_FV_FILETYPE_RAW) if (model->subtype(index) == EFI_FV_FILETYPE_ALL || model->subtype(index) == EFI_FV_FILETYPE_RAW)
path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to raw file"),".","Raw files (*.raw *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to raw file"),".","Raw files (*.raw *.bin);;All files (*.*)");
else else
path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to file"),".","FFS file body files (*.fbd *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to file"),".","FFS file body files (*.fbd *.bin);;All files (*.*)");
} }
break; break;
case Section: { case Types::Section: {
if (model->subtype(index) == EFI_SECTION_COMPRESSION || model->subtype(index) == EFI_SECTION_GUID_DEFINED || model->subtype(index) == EFI_SECTION_DISPOSABLE) if (model->subtype(index) == EFI_SECTION_COMPRESSION || model->subtype(index) == EFI_SECTION_GUID_DEFINED || model->subtype(index) == EFI_SECTION_DISPOSABLE)
path = QFileDialog::getSaveFileName(this, tr("Save encapsulation section body to FFS body file"),".","FFS file body files (*.fbd *.bin);;All files (*.*)"); path = QFileDialog::getSaveFileName(this, tr("Save encapsulation section body to FFS body file"),".","FFS file body files (*.fbd *.bin);;All files (*.*)");
else if (model->subtype(index) == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) else if (model->subtype(index) == EFI_SECTION_FIRMWARE_VOLUME_IMAGE)
@ -427,7 +427,7 @@ void UEFITool::extract(const UINT8 mode)
void UEFITool::about() void UEFITool::about()
{ {
QMessageBox::about(this, tr("About UEFITool"), tr( QMessageBox::about(this, tr("About UEFITool"), tr(
"Copyright (c) 2013-2014, Nikolaj Schlej aka <b>CodeRush</b>.<br><br>" "Copyright (c) 2014, Nikolaj Schlej aka <b>CodeRush</b>.<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 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=http://opensource.org/licenses/bsd-license.php>OpenSource.org</a>.<br><br>"
@ -573,25 +573,25 @@ void UEFITool::contextMenuEvent(QContextMenuEvent* event)
TreeModel* model = ffsEngine->treeModel(); TreeModel* model = ffsEngine->treeModel();
switch(model->type(index)) switch(model->type(index))
{ {
case Capsule: case Types::Capsule:
ui->menuCapsuleActions->exec(event->globalPos()); ui->menuCapsuleActions->exec(event->globalPos());
break; break;
case Image: case Types::Image:
ui->menuImageActions->exec(event->globalPos()); ui->menuImageActions->exec(event->globalPos());
break; break;
case Region: case Types::Region:
ui->menuRegionActions->exec(event->globalPos()); ui->menuRegionActions->exec(event->globalPos());
break; break;
case Padding: case Types::Padding:
ui->menuPaddingActions->exec(event->globalPos()); ui->menuPaddingActions->exec(event->globalPos());
break; break;
case Volume: case Types::Volume:
ui->menuVolumeActions->exec(event->globalPos()); ui->menuVolumeActions->exec(event->globalPos());
break; break;
case File: case Types::File:
ui->menuFileActions->exec(event->globalPos()); ui->menuFileActions->exec(event->globalPos());
break; break;
case Section: case Types::Section:
ui->menuSectionActions->exec(event->globalPos()); ui->menuSectionActions->exec(event->globalPos());
break; break;
} }

View File

@ -7,6 +7,7 @@ TEMPLATE = app
SOURCES += main.cpp \ SOURCES += main.cpp \
uefitool.cpp \ uefitool.cpp \
searchdialog.cpp \ searchdialog.cpp \
types.cpp \
descriptor.cpp \ descriptor.cpp \
ffs.cpp \ ffs.cpp \
ffsengine.cpp \ ffsengine.cpp \
@ -29,6 +30,8 @@ HEADERS += uefitool.h \
gbe.h \ gbe.h \
me.h \ me.h \
ffs.h \ ffs.h \
peimage.h \
types.h \
ffsengine.h \ ffsengine.h \
treeitem.h \ treeitem.h \
treemodel.h \ treemodel.h \
@ -36,8 +39,8 @@ HEADERS += uefitool.h \
LZMA/LzmaCompress.h \ LZMA/LzmaCompress.h \
LZMA/LzmaDecompress.h \ LZMA/LzmaDecompress.h \
Tiano/EfiTianoDecompress.h \ Tiano/EfiTianoDecompress.h \
Tiano/EfiTianoCompress.h \ Tiano/EfiTianoCompress.h
peimage.h
FORMS += uefitool.ui \ FORMS += uefitool.ui \
searchdialog.ui searchdialog.ui
@ -45,3 +48,4 @@ FORMS += uefitool.ui \
RC_FILE = uefitool.rc RC_FILE = uefitool.rc
ICON = uefitool.icns ICON = uefitool.icns

View File

@ -20,7 +20,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>UEFITool 0.17.4</string> <string>UEFITool 0.17.5</string>
</property> </property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<property name="sizePolicy"> <property name="sizePolicy">