mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-17 08:35:05 -04:00
Version 0.2.4
Better shitty LZMA section handling. Thank you, Intel, for breaking your own specifications.
This commit is contained in:
parent
a86829a27e
commit
56a0ed00b0
4 changed files with 50 additions and 3 deletions
|
@ -744,6 +744,8 @@ UINT8 UEFITool::parseFile(const QByteArray & file, UINT8 revision, bool erasePol
|
|||
UINT32 dataSize;
|
||||
QModelIndex index;
|
||||
UINT32 result;
|
||||
UINT32 shittySectionSize;
|
||||
EFI_COMMON_SECTION_HEADER* shittySectionHeader;
|
||||
|
||||
switch (sectionHeader->Type)
|
||||
{
|
||||
|
@ -804,8 +806,11 @@ UINT8 UEFITool::parseFile(const QByteArray & file, UINT8 revision, bool erasePol
|
|||
|| decompressedSize != compressedSectionHeader->UncompressedLength)
|
||||
{
|
||||
// Shitty file with a section header between COMPRESSED_SECTION_HEADER and LZMA_HEADER
|
||||
data = (VOID*) (file.constData() + sectionIndex + sizeof(EFI_COMPRESSION_SECTION) + sizeof(EFI_COMMON_SECTION_HEADER));
|
||||
dataSize = uint24ToUint32(sectionHeader->Size) - sizeof(EFI_COMPRESSION_SECTION) - sizeof(EFI_COMMON_SECTION_HEADER);
|
||||
// We must determine section header size by checking it's type before we can unpack that non-standard compressed section
|
||||
shittySectionHeader = (EFI_COMMON_SECTION_HEADER*) data;
|
||||
shittySectionSize = sizeOfSectionHeaderOfType(shittySectionHeader->Type);
|
||||
data = (VOID*) (file.constData() + sectionIndex + sizeof(EFI_COMPRESSION_SECTION) + shittySectionSize);
|
||||
dataSize = uint24ToUint32(sectionHeader->Size) - sizeof(EFI_COMPRESSION_SECTION) - shittySectionSize;
|
||||
if (LzmaGetInfo(data, dataSize, &decompressedSize) != ERR_SUCCESS)
|
||||
debug(tr("LzmaGetInfo failed"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue