Version 0.19.5

- solved a small bug in inserting compressed section
- unknown 0xF0 section identified as SCT postcode data
This commit is contained in:
Nikolaj Schlej 2014-12-10 19:18:05 +01:00
parent de0bff71a2
commit a927c51df1
4 changed files with 32 additions and 5 deletions

View File

@ -160,6 +160,8 @@ QString sectionTypeToQString(const UINT8 type)
return QObject::tr("PEI dependency"); return QObject::tr("PEI dependency");
case EFI_SECTION_SMM_DEPEX: case EFI_SECTION_SMM_DEPEX:
return QObject::tr("SMM dependency"); return QObject::tr("SMM dependency");
case SCT_SECTION_POSTCODE:
return QObject::tr("SCT postcode");
default: default:
return QObject::tr("Unknown"); return QObject::tr("Unknown");
} }
@ -173,11 +175,10 @@ UINT32 sizeOfSectionHeader(EFI_COMMON_SECTION_HEADER* header)
switch (header->Type) switch (header->Type)
{ {
case EFI_SECTION_COMPRESSION: case EFI_SECTION_COMPRESSION:
return sizeof(EFI_COMMON_SECTION_HEADER); return sizeof(EFI_COMPRESSION_SECTION);
case EFI_SECTION_GUID_DEFINED: { case EFI_SECTION_GUID_DEFINED: {
EFI_GUID_DEFINED_SECTION* gdsHeader = (EFI_GUID_DEFINED_SECTION*)header; EFI_GUID_DEFINED_SECTION* gdsHeader = (EFI_GUID_DEFINED_SECTION*)header;
return gdsHeader->DataOffset; return gdsHeader->DataOffset; }
}
case EFI_SECTION_DISPOSABLE: case EFI_SECTION_DISPOSABLE:
return sizeof(EFI_DISPOSABLE_SECTION); return sizeof(EFI_DISPOSABLE_SECTION);
case EFI_SECTION_PE32: case EFI_SECTION_PE32:
@ -204,6 +205,8 @@ UINT32 sizeOfSectionHeader(EFI_COMMON_SECTION_HEADER* header)
return sizeof(EFI_PEI_DEPEX_SECTION); return sizeof(EFI_PEI_DEPEX_SECTION);
case EFI_SECTION_SMM_DEPEX: case EFI_SECTION_SMM_DEPEX:
return sizeof(EFI_SMM_DEPEX_SECTION); return sizeof(EFI_SMM_DEPEX_SECTION);
case SCT_SECTION_POSTCODE:
return sizeof(SCT_POSTCODE_SECTION);
default: default:
return sizeof(EFI_COMMON_SECTION_HEADER); return sizeof(EFI_COMMON_SECTION_HEADER);
} }

9
ffs.h
View File

@ -289,7 +289,6 @@ typedef struct {
#define FFS_ATTRIB_FIXED 0x04 #define FFS_ATTRIB_FIXED 0x04
#define FFS_ATTRIB_DATA_ALIGNMENT 0x38 #define FFS_ATTRIB_DATA_ALIGNMENT 0x38
#define FFS_ATTRIB_CHECKSUM 0x40 #define FFS_ATTRIB_CHECKSUM 0x40
//#define FFS_ATTRIB_LARGE_FILE 0x01 //This attribute is removed in new PI 1.3 specification, nice
// FFS alignment table // FFS alignment table
extern const UINT8 ffsAlignmentTable[]; extern const UINT8 ffsAlignmentTable[];
@ -361,6 +360,7 @@ typedef struct {
#define EFI_SECTION_RAW 0x19 #define EFI_SECTION_RAW 0x19
#define EFI_SECTION_PEI_DEPEX 0x1B #define EFI_SECTION_PEI_DEPEX 0x1B
#define EFI_SECTION_SMM_DEPEX 0x1C #define EFI_SECTION_SMM_DEPEX 0x1C
#define SCT_SECTION_POSTCODE 0xF0 // Specific to Phoenix SCT images
// Compression section // Compression section
typedef struct { typedef struct {
@ -415,6 +415,13 @@ typedef struct {
EFI_GUID SubTypeGuid; EFI_GUID SubTypeGuid;
} EFI_FREEFORM_SUBTYPE_GUID_SECTION; } EFI_FREEFORM_SUBTYPE_GUID_SECTION;
// Phoenix SCT postcode section
typedef struct {
UINT8 Size[3];
UINT8 Type;
UINT32 Postcode;
} SCT_POSTCODE_SECTION;
// Other sections // Other sections
typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION; typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION;
typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION; typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;

View File

@ -1677,6 +1677,23 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
} }
} }
break; break;
case SCT_SECTION_POSTCODE: {
header = section.left(sizeof(SCT_POSTCODE_SECTION));
body = section.mid(sizeof(SCT_POSTCODE_SECTION), sectionSize - sizeof(SCT_POSTCODE_SECTION));
SCT_POSTCODE_SECTION* postcodeHeader = (SCT_POSTCODE_SECTION*)sectionHeader;
// Get info
info = tr("Type: 0x%1\nSize: 0x%2\nPostcode: 0x%3")
.hexarg(postcodeHeader->Type, 2)
.hexarg(body.size(), 6)
.hexarg(postcodeHeader->Postcode, 2);
// Add tree item
index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
}
break;
default: default:
header = section.left(sizeof(EFI_COMMON_SECTION_HEADER)); header = section.left(sizeof(EFI_COMMON_SECTION_HEADER));
body = section.mid(sizeof(EFI_COMMON_SECTION_HEADER), sectionSize - sizeof(EFI_COMMON_SECTION_HEADER)); body = section.mid(sizeof(EFI_COMMON_SECTION_HEADER), sectionSize - sizeof(EFI_COMMON_SECTION_HEADER));

View File

@ -17,7 +17,7 @@
UEFITool::UEFITool(QWidget *parent) : UEFITool::UEFITool(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::UEFITool), ui(new Ui::UEFITool),
version(tr("0.19.4")) version(tr("0.19.5"))
{ {
clipboard = QApplication::clipboard(); clipboard = QApplication::clipboard();