UEFIPatch 0.1.0

- new command-line utility to patch files inside UEFI image
- corrected bug with wrong header size calculation for
GUID_DEFINED_SECTION with PROCESSING_REQUIRED attribute set
- patch routine implemented in ffsEngine, will be added to UEFITool soon
This commit is contained in:
Nikolaj Schlej 2014-06-19 05:45:20 +02:00
parent 02a240ba18
commit 1c34c1bf84
10 changed files with 408 additions and 11 deletions

13
ffs.cpp
View file

@ -165,14 +165,19 @@ QString sectionTypeToQString(const UINT8 type)
}
}
UINT32 sizeOfSectionHeaderOfType(const UINT8 type)
UINT32 sizeOfSectionHeader(EFI_COMMON_SECTION_HEADER* header)
{
switch (type)
if (!header)
return 0;
switch (header->Type)
{
case EFI_SECTION_COMPRESSION:
return sizeof(EFI_COMMON_SECTION_HEADER);
case EFI_SECTION_GUID_DEFINED:
return sizeof(EFI_GUID_DEFINED_SECTION);
case EFI_SECTION_GUID_DEFINED: {
EFI_GUID_DEFINED_SECTION* gdsHeader = (EFI_GUID_DEFINED_SECTION*)header;
return gdsHeader->DataOffset;
}
case EFI_SECTION_DISPOSABLE:
return sizeof(EFI_DISPOSABLE_SECTION);
case EFI_SECTION_PE32: