From 507f884635d22b854b3adb7db65d1b556b3e3e1f Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Sat, 28 Jan 2023 21:56:01 -0800 Subject: [PATCH] Fix compressed flag not being applied to the items inside GZip and Zlib GUIDed sections --- common/basetypes.h | 1 + common/ffsparser.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/basetypes.h b/common/basetypes.h index 17d09e2..b85708d 100644 --- a/common/basetypes.h +++ b/common/basetypes.h @@ -135,6 +135,7 @@ typedef ptrdiff_t INTN; #define COMPRESSION_ALGORITHM_LZMA_INTEL_LEGACY 6 #define COMPRESSION_ALGORITHM_LZMAF86 7 #define COMPRESSION_ALGORITHM_GZIP 8 +#define COMPRESSION_ALGORITHM_ZLIB 9 // Item create modes diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index 7ac9e59..75ced0f 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -2904,7 +2904,8 @@ USTATUS FfsParser::parseGuidedSectionBody(const UModelIndex & index) msg(usprintf("%s: decompression failed with error ", __FUNCTION__) + errorCodeToUString(result), index); return U_SUCCESS; } - + + algorithm = COMPRESSION_ALGORITHM_GZIP; info += UString("\nCompression algorithm: GZip"); info += usprintf("\nDecompressed size: %Xh (%u)", (UINT32)processed.size(), (UINT32)processed.size()); } @@ -2916,6 +2917,7 @@ USTATUS FfsParser::parseGuidedSectionBody(const UModelIndex & index) return U_SUCCESS; } + algorithm = COMPRESSION_ALGORITHM_ZLIB; info += UString("\nCompression algorithm: Zlib"); info += usprintf("\nDecompressed size: %Xh (%u)", (UINT32)processed.size(), (UINT32)processed.size()); }