summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2022-07-19 21:44:35 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-02 05:34:38 +0000
commit9fc029ee6248e7998a478e02dc1abf82ac8ae376 (patch)
treeef3f73f74715f696e851460c404696d0323ba318 /BaseTools
parent6a2b20ff97e4256970644a07f74a4c5655bf5072 (diff)
downloadedk2-9fc029ee6248e7998a478e02dc1abf82ac8ae376.tar.gz
edk2-9fc029ee6248e7998a478e02dc1abf82ac8ae376.tar.bz2
edk2-9fc029ee6248e7998a478e02dc1abf82ac8ae376.zip
BaseTools/VolInfo: Correct buffer for GenCrc32 tool
If the guided section was encoded with GenCrc32 tool the resulting 'EFI_GUID_DEFINED_SECTION.DataOffset' field points to the start of the meaningfull data that follows the CRC32 value. But if we want to decode the section with GenCrc32 tool we need to provide a buffer that includes the CRC32 value itself. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/VolInfo/VolInfo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index 135924e028..184d753ba4 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -2009,6 +2009,13 @@ Returns:
);
free (ExtractionTool);
+ if (!CompareGuid (
+ EfiGuid,
+ &gEfiCrc32GuidedSectionExtractionProtocolGuid
+ )
+ ) {
+ DataOffset -= 4;
+ }
Status =
PutFileImage (
ToolInputFile,