3 Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 The tool dumps the contents of a firmware volume
29 #include <Common/UefiBaseTypes.h>
30 #include <Common/UefiCapsule.h>
31 #include <Common/PiFirmwareFile.h>
32 #include <Common/PiFirmwareVolume.h>
34 #include <Guid/PiFirmwareFileSystem.h>
35 #include <IndustryStandard/PeImage.h>
36 #include <Protocol/GuidedSectionExtraction.h>
39 #include "Decompress.h"
41 #include "CommonLib.h"
42 #include "EfiUtilityMsgs.h"
43 #include "FirmwareVolumeBufferLib.h"
45 #include "ParseGuidedSectionTools.h"
46 #include "StringFuncs.h"
49 // Utility global variables
52 EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid
= EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID
;
54 #define UTILITY_MAJOR_VERSION 0
55 #define UTILITY_MINOR_VERSION 82
57 #define UTILITY_NAME "VolInfo"
59 #define EFI_SECTION_ERROR EFIERR (100)
61 #define MAX_BASENAME_LEN 60 // not good to hardcode, but let's be reasonable
64 // Structure to keep a list of guid-to-basenames
66 typedef struct _GUID_TO_BASENAME
{
67 struct _GUID_TO_BASENAME
*Next
;
68 INT8 Guid
[PRINTED_GUID_BUFFER_SIZE
];
69 INT8 BaseName
[MAX_BASENAME_LEN
];
72 static GUID_TO_BASENAME
*mGuidBaseNameList
= NULL
;
75 // Store GUIDed Section guid->tool mapping
77 EFI_HANDLE mParsedGuidedSectionTools
= NULL
;
79 CHAR8
* mUtilityFilename
= NULL
;
82 ParseGuidBaseNameFile (
87 FreeGuidBaseNameList (
98 IN UINT8
*SectionBuffer
,
99 IN UINT32 BufferLength
105 IN UINT32 SectionLength
113 OUT BOOLEAN
*ErasePolarity
119 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
,
120 EFI_FFS_FILE_HEADER
*FileHeader
,
121 BOOLEAN ErasePolarity
133 LoadGuidedSectionToolsTxt (
134 IN CHAR8
* FirmwareVolumeFilename
151 GC_TODO: Add function description
155 argc - GC_TODO: add argument description
156 ] - GC_TODO: add argument description
160 GC_TODO: add return values
166 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
;
170 BOOLEAN ErasePolarity
;
172 SetUtilityName (UTILITY_NAME
);
174 // Print utility header
176 printf ("%s Tiano Firmware Volume FFS image info. Version %d.%d %s, %s\n",
178 UTILITY_MAJOR_VERSION
,
179 UTILITY_MINOR_VERSION
,
185 // Save, and then skip filename arg
187 mUtilityFilename
= argv
[0];
194 // If they specified -x xref guid/basename cross-reference files, process it.
195 // This will print the basename beside each file guid. To use it, specify
196 // -x xref_filename to processdsc, then use xref_filename as a parameter
200 if ((strcmp(argv
[0], "-x") == 0) || (strcmp(argv
[0], "--xref") == 0)) {
201 ParseGuidBaseNameFile (argv
[1]);
202 printf("ParseGuidBaseNameFile: %s\n", argv
[1]);
205 } else if (strcmp(argv
[0], "--offset") == 0) {
209 if ((argv
[1][0] == '0') && (tolower ((int)argv
[1][1]) == 'x')) {
210 if (sscanf (argv
[1], "%x", &Offset
) != 1) {
211 Error (NULL
, 0, 1003, "Invalid option value", "Offset = %s", argv
[1]);
212 return GetUtilityStatus ();
215 if (sscanf (argv
[1], "%d", &Offset
) != 1) {
216 Error (NULL
, 0, 1003, "Invalid option value", "Offset = %s", argv
[1]);
217 return GetUtilityStatus ();
220 // See if they said something like "64K"
222 if (tolower ((int)argv
[1][strlen (argv
[1]) - 1]) == 'k') {
235 // Check for proper number of arguments
242 // Look for help options
244 if ((strcmp(argv
[0], "-h") == 0) || (strcmp(argv
[0], "--help") == 0) ||
245 (strcmp(argv
[0], "-?") == 0) || (strcmp(argv
[0], "/?") == 0)) {
251 // Open the file containing the FV
253 InputFile
= fopen (argv
[0], "rb");
254 if (InputFile
== NULL
) {
255 Error (NULL
, 0, 0001, "Error opening the input file", argv
[0]);
256 return GetUtilityStatus ();
259 // Skip over pad bytes if specified. This is used if they prepend 0xff
260 // data to the FV image binary.
263 fseek (InputFile
, Offset
, SEEK_SET
);
266 // Determine size of FV
268 Status
= ReadHeader (InputFile
, &FvSize
, &ErasePolarity
);
269 if (EFI_ERROR (Status
)) {
270 Error (NULL
, 0, 0003, "error parsing FV image", "%s Header is invalid", argv
[0]);
272 return GetUtilityStatus ();
275 // Allocate a buffer for the FV image
277 FvImage
= malloc (FvSize
);
278 if (FvImage
== NULL
) {
279 Error (NULL
, 0, 4001, "Resource: Memory can't be allocated", NULL
);
281 return GetUtilityStatus ();
284 // Seek to the start of the image, then read the entire FV to the buffer
286 fseek (InputFile
, Offset
, SEEK_SET
);
287 BytesRead
= fread (FvImage
, 1, FvSize
, InputFile
);
289 if ((unsigned int) BytesRead
!= FvSize
) {
290 Error (NULL
, 0, 0004, "error reading FvImage from", argv
[0]);
292 return GetUtilityStatus ();
295 LoadGuidedSectionToolsTxt (argv
[0]);
297 PrintFvInfo (FvImage
, FALSE
);
303 FreeGuidBaseNameList ();
304 return GetUtilityStatus ();
318 GC_TODO: Add function description
322 Fv - Firmware Volume to print information about
323 IsChildFv - Flag specifies whether the input FV is a child FV.
333 BOOLEAN ErasePolarity
;
335 EFI_FFS_FILE_HEADER
*CurrentFile
;
338 Status
= FvBufGetSize (Fv
, &FvSize
);
342 (((EFI_FIRMWARE_VOLUME_HEADER
*)Fv
)->Attributes
& EFI_FVB2_ERASE_POLARITY
) ?
346 // Get the first file
349 Status
= FvBufFindNextFile (Fv
, &Key
, (VOID
**) &CurrentFile
);
350 if (EFI_ERROR (Status
)) {
351 Error (NULL
, 0, 0003, "error parsing FV image", "cannot find the first file in the FV image");
352 return GetUtilityStatus ();
355 // Display information about files found
357 while (CurrentFile
!= NULL
) {
359 // Increment the number of files counter
364 // Display info about this file
366 Status
= PrintFileInfo (Fv
, CurrentFile
, ErasePolarity
);
367 if (EFI_ERROR (Status
)) {
368 Error (NULL
, 0, 0003, "error parsing FV image", "failed to parse a file in the FV");
369 return GetUtilityStatus ();
374 Status
= FvBufFindNextFile (Fv
, &Key
, (VOID
**) &CurrentFile
);
375 if (Status
== EFI_NOT_FOUND
) {
377 } else if (EFI_ERROR (Status
)) {
378 Error (NULL
, 0, 0003, "error parsing FV image", "cannot find the next file in the FV image");
379 return GetUtilityStatus ();
384 printf ("There are a total of %d files in the child FV\n", (int) NumberOfFiles
);
386 printf ("There are a total of %d files in this FV\n", (int) NumberOfFiles
);
394 IN UINT32 ActualSize
,
401 This function returns the next larger size that meets the alignment
402 requirement specified.
407 Alignment The desired alignment.
411 EFI_SUCCESS Function completed successfully.
412 EFI_ABORTED The function encountered an error.
418 OccupiedSize
= ActualSize
;
419 while ((OccupiedSize
& (Alignment
- 1)) != 0) {
429 IN EFI_SECTION_TYPE Type
435 Converts EFI Section names to Strings
439 Type - The EFI Section type
443 CHAR8* - Pointer to the String containing the section name.
448 CHAR8
*SectionTypeStringTable
[] = {
456 "EFI_SECTION_COMPRESSION",
460 "EFI_SECTION_GUID_DEFINED",
464 "Unknown section type - Reserved 0x03",
468 "Unknown section type - Reserved 0x04",
472 "Unknown section type - Reserved 0x05",
476 "Unknown section type - Reserved 0x06",
480 "Unknown section type - Reserved 0x07",
484 "Unknown section type - Reserved 0x08",
488 "Unknown section type - Reserved 0x09",
492 "Unknown section type - Reserved 0x0A",
496 "Unknown section type - Reserved 0x0B",
500 "Unknown section type - Reserved 0x0C",
504 "Unknown section type - Reserved 0x0D",
508 "Unknown section type - Reserved 0x0E",
512 "Unknown section type - Reserved 0x0E",
528 "EFI_SECTION_DXE_DEPEX",
532 "EFI_SECTION_VERSION",
536 "EFI_SECTION_USER_INTERFACE",
540 "EFI_SECTION_COMPATIBILITY16",
544 "EFI_SECTION_FIRMWARE_VOLUME_IMAGE ",
548 "EFI_SECTION_FREEFORM_SUBTYPE_GUID ",
556 "Unknown section type - 0x1A",
560 "EFI_SECTION_PEI_DEPEX",
564 "EFI_SECTION_SMM_DEPEX",
568 "Unknown section type - Reserved - beyond last defined section"
571 if (Type
> EFI_SECTION_LAST_SECTION_TYPE
) {
572 Type
= EFI_SECTION_LAST_SECTION_TYPE
+ 1;
575 SectionStr
= malloc (100);
576 if (SectionStr
== NULL
) {
577 printf ("Error: Out of memory resources.\n");
580 strcpy (SectionStr
, SectionTypeStringTable
[Type
]);
589 OUT BOOLEAN
*ErasePolarity
595 This function determines the size of the FV and the erase polarity. The
596 erase polarity is the FALSE value for file state.
600 InputFile The file that contains the FV image.
601 FvSize The size of the FV.
602 ErasePolarity The FV erase polarity.
606 EFI_SUCCESS Function completed successfully.
607 EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.
608 EFI_ABORTED The function encountered an error.
612 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader
;
613 EFI_FV_BLOCK_MAP_ENTRY BlockMap
;
621 // Check input parameters
623 if (InputFile
== NULL
|| FvSize
== NULL
|| ErasePolarity
== NULL
) {
624 Error (__FILE__
, __LINE__
, 0, "application error", "invalid parameter to function");
625 return EFI_INVALID_PARAMETER
;
630 fread (&VolumeHeader
, sizeof (EFI_FIRMWARE_VOLUME_HEADER
) - sizeof (EFI_FV_BLOCK_MAP_ENTRY
), 1, InputFile
);
631 BytesRead
= sizeof (EFI_FIRMWARE_VOLUME_HEADER
) - sizeof (EFI_FV_BLOCK_MAP_ENTRY
);
632 Signature
[0] = VolumeHeader
.Signature
;
636 // Print FV header information
638 printf ("Signature: %s (%X)\n", (char *) Signature
, (unsigned) VolumeHeader
.Signature
);
639 printf ("Attributes: %X\n", (unsigned) VolumeHeader
.Attributes
);
641 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_DISABLED_CAP
) {
642 printf (" EFI_FVB2_READ_DISABLED_CAP\n");
645 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_ENABLED_CAP
) {
646 printf (" EFI_FVB2_READ_ENABLED_CAP\n");
649 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_STATUS
) {
650 printf (" EFI_FVB2_READ_STATUS\n");
653 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_DISABLED_CAP
) {
654 printf (" EFI_FVB2_WRITE_DISABLED_CAP\n");
657 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_ENABLED_CAP
) {
658 printf (" EFI_FVB2_WRITE_ENABLED_CAP\n");
661 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_STATUS
) {
662 printf (" EFI_FVB2_WRITE_STATUS\n");
665 if (VolumeHeader
.Attributes
& EFI_FVB2_LOCK_CAP
) {
666 printf (" EFI_FVB2_LOCK_CAP\n");
669 if (VolumeHeader
.Attributes
& EFI_FVB2_LOCK_STATUS
) {
670 printf (" EFI_FVB2_LOCK_STATUS\n");
673 if (VolumeHeader
.Attributes
& EFI_FVB2_STICKY_WRITE
) {
674 printf (" EFI_FVB2_STICKY_WRITE\n");
677 if (VolumeHeader
.Attributes
& EFI_FVB2_MEMORY_MAPPED
) {
678 printf (" EFI_FVB2_MEMORY_MAPPED\n");
681 if (VolumeHeader
.Attributes
& EFI_FVB2_ERASE_POLARITY
) {
682 printf (" EFI_FVB2_ERASE_POLARITY\n");
683 *ErasePolarity
= TRUE
;
686 #if (PI_SPECIFICATION_VERSION < 0x00010000)
687 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT
) {
688 printf (" EFI_FVB2_ALIGNMENT\n");
691 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2
) {
692 printf (" EFI_FVB2_ALIGNMENT_2\n");
695 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4
) {
696 printf (" EFI_FVB2_ALIGNMENT_4\n");
699 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8
) {
700 printf (" EFI_FVB2_ALIGNMENT_8\n");
703 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16
) {
704 printf (" EFI_FVB2_ALIGNMENT_16\n");
707 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32
) {
708 printf (" EFI_FVB2_ALIGNMENT_32\n");
711 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64
) {
712 printf (" EFI_FVB2_ALIGNMENT_64\n");
715 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128
) {
716 printf (" EFI_FVB2_ALIGNMENT_128\n");
719 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256
) {
720 printf (" EFI_FVB2_ALIGNMENT_256\n");
723 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512
) {
724 printf (" EFI_FVB2_ALIGNMENT_512\n");
727 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1K
) {
728 printf (" EFI_FVB2_ALIGNMENT_1K\n");
731 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2K
) {
732 printf (" EFI_FVB2_ALIGNMENT_2K\n");
735 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4K
) {
736 printf (" EFI_FVB2_ALIGNMENT_4K\n");
739 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8K
) {
740 printf (" EFI_FVB2_ALIGNMENT_8K\n");
743 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16K
) {
744 printf (" EFI_FVB2_ALIGNMENT_16K\n");
747 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32K
) {
748 printf (" EFI_FVB2_ALIGNMENT_32K\n");
751 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64K
) {
752 printf (" EFI_FVB2_ALIGNMENT_64K\n");
757 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_LOCK_CAP
) {
758 printf (" EFI_FVB2_READ_LOCK_CAP\n");
761 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_LOCK_STATUS
) {
762 printf (" EFI_FVB2_READ_LOCK_STATUS\n");
765 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_LOCK_CAP
) {
766 printf (" EFI_FVB2_WRITE_LOCK_CAP\n");
769 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_LOCK_STATUS
) {
770 printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
773 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1
) {
774 printf (" EFI_FVB2_ALIGNMENT_1\n");
777 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2
) {
778 printf (" EFI_FVB2_ALIGNMENT_2\n");
781 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4
) {
782 printf (" EFI_FVB2_ALIGNMENT_4\n");
785 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8
) {
786 printf (" EFI_FVB2_ALIGNMENT_8\n");
789 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16
) {
790 printf (" EFI_FVB2_ALIGNMENT_16\n");
793 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32
) {
794 printf (" EFI_FVB2_ALIGNMENT_32\n");
797 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64
) {
798 printf (" EFI_FVB2_ALIGNMENT_64\n");
801 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128
) {
802 printf (" EFI_FVB2_ALIGNMENT_128\n");
805 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256
) {
806 printf (" EFI_FVB2_ALIGNMENT_256\n");
809 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512
) {
810 printf (" EFI_FVB2_ALIGNMENT_512\n");
813 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1K
) {
814 printf (" EFI_FVB2_ALIGNMENT_1K\n");
817 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2K
) {
818 printf (" EFI_FVB2_ALIGNMENT_2K\n");
821 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4K
) {
822 printf (" EFI_FVB2_ALIGNMENT_4K\n");
825 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8K
) {
826 printf (" EFI_FVB2_ALIGNMENT_8K\n");
829 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16K
) {
830 printf (" EFI_FVB2_ALIGNMENT_16K\n");
833 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32K
) {
834 printf (" EFI_FVB2_ALIGNMENT_32K\n");
837 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64K
) {
838 printf (" EFI_FVB2_ALIGNMENT_64K\n");
841 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128K
) {
842 printf (" EFI_FVB2_ALIGNMENT_128K\n");
845 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256K
) {
846 printf (" EFI_FVB2_ALIGNMENT_256K\n");
849 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMNET_512K
) {
850 printf (" EFI_FVB2_ALIGNMNET_512K\n");
853 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1M
) {
854 printf (" EFI_FVB2_ALIGNMENT_1M\n");
857 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2M
) {
858 printf (" EFI_FVB2_ALIGNMENT_2M\n");
861 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4M
) {
862 printf (" EFI_FVB2_ALIGNMENT_4M\n");
865 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8M
) {
866 printf (" EFI_FVB2_ALIGNMENT_8M\n");
869 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16M
) {
870 printf (" EFI_FVB2_ALIGNMENT_16M\n");
873 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32M
) {
874 printf (" EFI_FVB2_ALIGNMENT_32M\n");
877 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64M
) {
878 printf (" EFI_FVB2_ALIGNMENT_64M\n");
881 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128M
) {
882 printf (" EFI_FVB2_ALIGNMENT_128M\n");
885 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64M
) {
886 printf (" EFI_FVB2_ALIGNMENT_64M\n");
889 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128M
) {
890 printf (" EFI_FVB2_ALIGNMENT_128M\n");
893 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256M
) {
894 printf (" EFI_FVB2_ALIGNMENT_256M\n");
897 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512M
) {
898 printf (" EFI_FVB2_ALIGNMENT_512M\n");
901 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1G
) {
902 printf (" EFI_FVB2_ALIGNMENT_1G\n");
905 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2G
) {
906 printf (" EFI_FVB2_ALIGNMENT_2G\n");
910 printf ("Header Length: 0x%08X\n", VolumeHeader
.HeaderLength
);
911 printf ("File System ID: ");
912 PrintGuid (&VolumeHeader
.FileSystemGuid
);
916 printf ("Revision: 0x%04X\n", VolumeHeader
.Revision
);
919 fread (&BlockMap
, sizeof (EFI_FV_BLOCK_MAP_ENTRY
), 1, InputFile
);
920 BytesRead
+= sizeof (EFI_FV_BLOCK_MAP_ENTRY
);
922 if (BlockMap
.NumBlocks
!= 0) {
923 printf ("Number of Blocks: 0x%08X\n", (unsigned) BlockMap
.NumBlocks
);
924 printf ("Block Length: 0x%08X\n", (unsigned) BlockMap
.Length
);
925 Size
+= BlockMap
.NumBlocks
* BlockMap
.Length
;
928 } while (!(BlockMap
.NumBlocks
== 0 && BlockMap
.Length
== 0));
930 if (BytesRead
!= VolumeHeader
.HeaderLength
) {
931 printf ("ERROR: Header length not consistent with Block Maps!\n");
935 if (VolumeHeader
.FvLength
!= Size
) {
936 printf ("ERROR: Volume Size not consistant with Block Maps!\n");
940 printf ("Total Volume Size: 0x%08X\n", (unsigned) Size
);
945 // rewind (InputFile);
953 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
,
954 EFI_FFS_FILE_HEADER
*FileHeader
,
955 BOOLEAN ErasePolarity
961 GC_TODO: Add function description
965 FvImage - GC_TODO: add argument description
966 FileHeader - GC_TODO: add argument description
967 ErasePolarity - GC_TODO: add argument description
971 EFI_SUCCESS - GC_TODO: Add description for return value
972 EFI_ABORTED - GC_TODO: Add description for return value
979 EFI_FFS_FILE_HEADER BlankHeader
;
981 UINT8 GuidBuffer
[PRINTED_GUID_BUFFER_SIZE
];
982 #if (PI_SPECIFICATION_VERSION < 0x00010000)
986 // Check if we have free space
989 memset (&BlankHeader
, -1, sizeof (EFI_FFS_FILE_HEADER
));
991 memset (&BlankHeader
, 0, sizeof (EFI_FFS_FILE_HEADER
));
994 if (memcmp (&BlankHeader
, FileHeader
, sizeof (EFI_FFS_FILE_HEADER
)) == 0) {
998 // Print file information.
1000 printf ("============================================================\n");
1002 printf ("File Name: ");
1003 PrintGuidToBuffer (&FileHeader
->Name
, GuidBuffer
, sizeof (GuidBuffer
), TRUE
);
1004 printf ("%s ", GuidBuffer
);
1005 PrintGuidName (GuidBuffer
);
1009 // PrintGuid (&FileHeader->Name);
1012 FileLength
= GetLength (FileHeader
->Size
);
1013 printf ("File Offset: 0x%08X\n", (unsigned) ((UINTN
) FileHeader
- (UINTN
) FvImage
));
1014 printf ("File Length: 0x%08X\n", (unsigned) FileLength
);
1015 printf ("File Attributes: 0x%02X\n", FileHeader
->Attributes
);
1016 printf ("File State: 0x%02X\n", FileHeader
->State
);
1021 FileState
= GetFileState (ErasePolarity
, FileHeader
);
1023 switch (FileState
) {
1025 case EFI_FILE_HEADER_CONSTRUCTION
:
1026 printf (" EFI_FILE_HEADER_CONSTRUCTION\n");
1029 case EFI_FILE_HEADER_INVALID
:
1030 printf (" EFI_FILE_HEADER_INVALID\n");
1033 case EFI_FILE_HEADER_VALID
:
1034 printf (" EFI_FILE_HEADER_VALID\n");
1035 Checksum
= CalculateSum8 ((UINT8
*) FileHeader
, sizeof (EFI_FFS_FILE_HEADER
));
1036 Checksum
= (UINT8
) (Checksum
- FileHeader
->IntegrityCheck
.Checksum
.File
);
1037 Checksum
= (UINT8
) (Checksum
- FileHeader
->State
);
1038 if (Checksum
!= 0) {
1039 printf ("ERROR: Header checksum invalid.\n");
1045 case EFI_FILE_DELETED
:
1046 printf (" EFI_FILE_DELETED\n");
1048 case EFI_FILE_MARKED_FOR_UPDATE
:
1049 printf (" EFI_FILE_MARKED_FOR_UPDATE\n");
1051 case EFI_FILE_DATA_VALID
:
1052 printf (" EFI_FILE_DATA_VALID\n");
1055 // Calculate header checksum
1057 Checksum
= CalculateSum8 ((UINT8
*) FileHeader
, sizeof (EFI_FFS_FILE_HEADER
));
1058 Checksum
= (UINT8
) (Checksum
- FileHeader
->IntegrityCheck
.Checksum
.File
);
1059 Checksum
= (UINT8
) (Checksum
- FileHeader
->State
);
1060 if (Checksum
!= 0) {
1061 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid header checksum", GuidBuffer
);
1065 FileLength
= GetLength (FileHeader
->Size
);
1067 if (FileHeader
->Attributes
& FFS_ATTRIB_CHECKSUM
) {
1069 // Calculate file checksum
1071 Checksum
= CalculateSum8 ((UINT8
*) (FileHeader
+ 1), FileLength
- sizeof (EFI_FFS_FILE_HEADER
));
1072 Checksum
= Checksum
+ FileHeader
->IntegrityCheck
.Checksum
.File
;
1073 if (Checksum
!= 0) {
1074 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid file checksum", GuidBuffer
);
1078 if (FileHeader
->IntegrityCheck
.Checksum
.File
!= FFS_FIXED_CHECKSUM
) {
1079 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid header checksum -- not set to fixed value of 0xAA", GuidBuffer
);
1083 #if (PI_SPECIFICATION_VERSION < 0x00010000)
1085 // Verify tail if present
1087 if (FileHeader
->Attributes
& FFS_ATTRIB_TAIL_PRESENT
) {
1089 // Verify tail is complement of integrity check field in the header.
1091 Tail
= (UINT16
*) ((UINTN
) FileHeader
+ GetLength (FileHeader
->Size
) - sizeof (EFI_FFS_INTEGRITY_CHECK
));
1092 if (FileHeader
->IntegrityCheck
.TailReference
!= (UINT16
)~(*Tail
)) {
1093 Error (NULL
, 0, 0003, "error parsing FFS file", \
1094 "FFS file with Guid %s failed in the integrity check, tail is not the complement of the header field", GuidBuffer
);
1102 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has the invalid/unrecognized file state bits", GuidBuffer
);
1106 printf ("File Type: 0x%02X ", FileHeader
->Type
);
1108 switch (FileHeader
->Type
) {
1110 case EFI_FV_FILETYPE_RAW
:
1111 printf ("EFI_FV_FILETYPE_RAW\n");
1114 case EFI_FV_FILETYPE_FREEFORM
:
1115 printf ("EFI_FV_FILETYPE_FREEFORM\n");
1118 case EFI_FV_FILETYPE_SECURITY_CORE
:
1119 printf ("EFI_FV_FILETYPE_SECURITY_CORE\n");
1122 case EFI_FV_FILETYPE_PEI_CORE
:
1123 printf ("EFI_FV_FILETYPE_PEI_CORE\n");
1126 case EFI_FV_FILETYPE_DXE_CORE
:
1127 printf ("EFI_FV_FILETYPE_DXE_CORE\n");
1130 case EFI_FV_FILETYPE_PEIM
:
1131 printf ("EFI_FV_FILETYPE_PEIM\n");
1134 case EFI_FV_FILETYPE_DRIVER
:
1135 printf ("EFI_FV_FILETYPE_DRIVER\n");
1138 case EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER
:
1139 printf ("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER\n");
1142 case EFI_FV_FILETYPE_APPLICATION
:
1143 printf ("EFI_FV_FILETYPE_APPLICATION\n");
1146 case EFI_FV_FILETYPE_SMM
:
1147 printf ("EFI_FV_FILETYPE_SMM\n");
1150 case EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
:
1151 printf ("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE\n");
1154 case EFI_FV_FILETYPE_COMBINED_SMM_DXE
:
1155 printf ("EFI_FV_FILETYPE_COMBINED_SMM_DXE\n");
1158 case EFI_FV_FILETYPE_SMM_CORE
:
1159 printf ("EFI_FV_FILETYPE_SMM_CORE\n");
1162 case EFI_FV_FILETYPE_FFS_PAD
:
1163 printf ("EFI_FV_FILETYPE_FFS_PAD\n");
1167 printf ("\nERROR: Unrecognized file type %X.\n", FileHeader
->Type
);
1172 switch (FileHeader
->Type
) {
1174 case EFI_FV_FILETYPE_ALL
:
1175 case EFI_FV_FILETYPE_RAW
:
1176 case EFI_FV_FILETYPE_FFS_PAD
:
1181 // All other files have sections
1183 Status
= ParseSection (
1184 (UINT8
*) ((UINTN
) FileHeader
+ sizeof (EFI_FFS_FILE_HEADER
)),
1185 GetLength (FileHeader
->Size
) - sizeof (EFI_FFS_FILE_HEADER
)
1187 if (EFI_ERROR (Status
)) {
1189 // printf ("ERROR: Parsing the FFS file.\n");
1201 IN UINT8
*SectionBuffer
,
1202 IN UINT32 BufferLength
1206 Routine Description:
1212 SectionBuffer - Buffer containing the section to parse.
1213 BufferLength - Length of SectionBuffer
1217 EFI_SECTION_ERROR - Problem with section parsing.
1218 (a) compression errors
1219 (b) unrecognized section
1220 EFI_UNSUPPORTED - Do not know how to parse the section.
1221 EFI_SUCCESS - Section successfully parsed.
1222 EFI_OUT_OF_RESOURCES - Memory allocation failed.
1226 EFI_SECTION_TYPE Type
;
1228 UINT32 SectionLength
;
1231 UINT32 ParsedLength
;
1232 UINT8
*CompressedBuffer
;
1233 UINT32 CompressedLength
;
1234 UINT8
*UncompressedBuffer
;
1235 UINT32 UncompressedLength
;
1236 UINT8
*ToolOutputBuffer
;
1237 UINT32 ToolOutputLength
;
1238 UINT8 CompressionType
;
1241 UINT8
*ScratchBuffer
;
1242 DECOMPRESS_FUNCTION DecompressFunction
;
1243 GETINFO_FUNCTION GetInfoFunction
;
1245 CHAR8
*ExtractionTool
;
1246 CHAR8
*ToolInputFile
;
1247 CHAR8
*ToolOutputFile
;
1248 CHAR8
*SystemCommandFormatString
;
1249 CHAR8
*SystemCommand
;
1252 while (ParsedLength
< BufferLength
) {
1253 Ptr
= SectionBuffer
+ ParsedLength
;
1255 SectionLength
= GetLength (((EFI_COMMON_SECTION_HEADER
*) Ptr
)->Size
);
1256 Type
= ((EFI_COMMON_SECTION_HEADER
*) Ptr
)->Type
;
1259 // This is sort of an odd check, but is necessary because FFS files are
1260 // padded to a QWORD boundary, meaning there is potentially a whole section
1261 // header worth of 0xFF bytes.
1263 if (SectionLength
== 0xffffff && Type
== 0xff) {
1268 SectionName
= SectionNameToStr (Type
);
1269 printf ("------------------------------------------------------------\n");
1270 printf (" Type: %s\n Size: 0x%08X\n", SectionName
, (unsigned) SectionLength
);
1274 case EFI_SECTION_RAW
:
1275 case EFI_SECTION_PE32
:
1276 case EFI_SECTION_PIC
:
1277 case EFI_SECTION_TE
:
1278 // default is no more information
1281 case EFI_SECTION_USER_INTERFACE
:
1282 // name = &((EFI_USER_INTERFACE_SECTION *) Ptr)->FileNameString;
1283 // printf (" String: %s\n", &name);
1286 case EFI_SECTION_FIRMWARE_VOLUME_IMAGE
:
1287 Status
= PrintFvInfo (((EFI_FIRMWARE_VOLUME_IMAGE_SECTION
*)Ptr
) + 1, TRUE
);
1288 if (EFI_ERROR (Status
)) {
1289 Error (NULL
, 0, 0003, "printing of FV section contents failed", NULL
);
1290 return EFI_SECTION_ERROR
;
1294 case EFI_SECTION_COMPATIBILITY16
:
1295 case EFI_SECTION_FREEFORM_SUBTYPE_GUID
:
1297 // Section does not contain any further header information.
1301 case EFI_SECTION_PEI_DEPEX
:
1302 case EFI_SECTION_DXE_DEPEX
:
1303 case EFI_SECTION_SMM_DEPEX
:
1304 DumpDepexSection (Ptr
, SectionLength
);
1307 case EFI_SECTION_VERSION
:
1308 printf (" Build Number: 0x%02X\n", ((EFI_VERSION_SECTION
*) Ptr
)->BuildNumber
);
1309 printf (" Version Strg: %s\n", (char*) ((EFI_VERSION_SECTION
*) Ptr
)->VersionString
);
1312 case EFI_SECTION_COMPRESSION
:
1313 UncompressedBuffer
= NULL
;
1314 CompressedLength
= SectionLength
- sizeof (EFI_COMPRESSION_SECTION
);
1315 UncompressedLength
= ((EFI_COMPRESSION_SECTION
*) Ptr
)->UncompressedLength
;
1316 CompressionType
= ((EFI_COMPRESSION_SECTION
*) Ptr
)->CompressionType
;
1317 printf (" Uncompressed Length: 0x%08X\n", (unsigned) UncompressedLength
);
1319 if (CompressionType
== EFI_NOT_COMPRESSED
) {
1320 printf (" Compression Type: EFI_NOT_COMPRESSED\n");
1321 if (CompressedLength
!= UncompressedLength
) {
1326 "file is not compressed, but the compressed length does not match the uncompressed length",
1329 return EFI_SECTION_ERROR
;
1332 UncompressedBuffer
= Ptr
+ sizeof (EFI_COMPRESSION_SECTION
);
1333 } else if (CompressionType
== EFI_STANDARD_COMPRESSION
) {
1334 GetInfoFunction
= EfiGetInfo
;
1335 DecompressFunction
= EfiDecompress
;
1336 printf (" Compression Type: EFI_STANDARD_COMPRESSION\n");
1338 CompressedBuffer
= Ptr
+ sizeof (EFI_COMPRESSION_SECTION
);
1340 Status
= GetInfoFunction (CompressedBuffer
, CompressedLength
, &DstSize
, &ScratchSize
);
1341 if (EFI_ERROR (Status
)) {
1342 Error (NULL
, 0, 0003, "error getting compression info from compression section", NULL
);
1343 return EFI_SECTION_ERROR
;
1346 if (DstSize
!= UncompressedLength
) {
1347 Error (NULL
, 0, 0003, "compression error in the compression section", NULL
);
1348 return EFI_SECTION_ERROR
;
1351 ScratchBuffer
= malloc (ScratchSize
);
1352 UncompressedBuffer
= malloc (UncompressedLength
);
1353 if ((ScratchBuffer
== NULL
) || (UncompressedBuffer
== NULL
)) {
1354 return EFI_OUT_OF_RESOURCES
;
1356 Status
= DecompressFunction (
1364 free (ScratchBuffer
);
1365 if (EFI_ERROR (Status
)) {
1366 Error (NULL
, 0, 0003, "decompress failed", NULL
);
1367 free (UncompressedBuffer
);
1368 return EFI_SECTION_ERROR
;
1371 Error (NULL
, 0, 0003, "unrecognized compression type", "type 0x%X", CompressionType
);
1372 return EFI_SECTION_ERROR
;
1375 Status
= ParseSection (UncompressedBuffer
, UncompressedLength
);
1377 if (CompressionType
== EFI_STANDARD_COMPRESSION
) {
1379 // We need to deallocate Buffer
1381 free (UncompressedBuffer
);
1384 if (EFI_ERROR (Status
)) {
1385 Error (NULL
, 0, 0003, "failed to parse section", NULL
);
1386 return EFI_SECTION_ERROR
;
1390 case EFI_SECTION_GUID_DEFINED
:
1391 printf (" SectionDefinitionGuid: ");
1392 PrintGuid (&((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
);
1394 printf (" DataOffset: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
);
1395 printf (" Attributes: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->Attributes
);
1398 LookupGuidedSectionToolPath (
1399 mParsedGuidedSectionTools
,
1400 &((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
1403 if (ExtractionTool
!= NULL
) {
1405 ToolInputFile
= CloneString (tmpnam (NULL
));
1406 ToolOutputFile
= CloneString (tmpnam (NULL
));
1409 // Construction 'system' command string
1411 SystemCommandFormatString
= "%s -d -o %s %s";
1412 SystemCommand
= malloc (
1413 strlen (SystemCommandFormatString
) +
1414 strlen (ExtractionTool
) +
1415 strlen (ToolInputFile
) +
1416 strlen (ToolOutputFile
) +
1421 SystemCommandFormatString
,
1426 free (ExtractionTool
);
1431 (CHAR8
*) SectionBuffer
+ ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
,
1432 BufferLength
- ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
1435 system (SystemCommand
);
1436 remove (ToolInputFile
);
1437 free (ToolInputFile
);
1442 (CHAR8
**)&ToolOutputBuffer
,
1445 remove (ToolOutputFile
);
1446 free (ToolOutputFile
);
1447 if (EFI_ERROR (Status
)) {
1448 Error (NULL
, 0, 0004, "unable to read decoded GUIDED section", NULL
);
1449 return EFI_SECTION_ERROR
;
1452 Status
= ParseSection (
1456 if (EFI_ERROR (Status
)) {
1457 Error (NULL
, 0, 0003, "parse of decoded GUIDED section failed", NULL
);
1458 return EFI_SECTION_ERROR
;
1462 // Check for CRC32 sections which we can handle internally if needed.
1464 } else if (!CompareGuid (
1465 &((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
,
1466 &gEfiCrc32GuidedSectionExtractionProtocolGuid
1470 // CRC32 guided section
1472 Status
= ParseSection (
1473 SectionBuffer
+ ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
,
1474 BufferLength
- ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
1476 if (EFI_ERROR (Status
)) {
1477 Error (NULL
, 0, 0003, "parse of CRC32 GUIDED section failed", NULL
);
1478 return EFI_SECTION_ERROR
;
1482 // We don't know how to parse it now.
1484 Error (NULL
, 0, 0003, "Error parsing section", \
1485 "EFI_SECTION_GUID_DEFINED cannot be parsed at this time. Tool to decode this section should have been defined in GuidedSectionTools.txt (built in the FV directory).");
1486 return EFI_UNSUPPORTED
;
1492 // Unknown section, return error
1494 Error (NULL
, 0, 0003, "unrecognized section type found", "section type = 0x%X", Type
);
1495 return EFI_SECTION_ERROR
;
1498 ParsedLength
+= SectionLength
;
1500 // We make then next section begin on a 4-byte boundary
1502 ParsedLength
= GetOccupiedSize (ParsedLength
, 4);
1505 if (ParsedLength
< BufferLength
) {
1506 Error (NULL
, 0, 0003, "sections do not completely fill the sectioned buffer being parsed", NULL
);
1507 return EFI_SECTION_ERROR
;
1516 IN UINT32 SectionLength
1520 Routine Description:
1522 GC_TODO: Add function description
1526 Ptr - GC_TODO: add argument description
1527 SectionLength - GC_TODO: add argument description
1531 EFI_SUCCESS - GC_TODO: Add description for return value
1535 UINT8 GuidBuffer
[PRINTED_GUID_BUFFER_SIZE
];
1538 // Need at least a section header + data
1540 if (SectionLength
<= sizeof (EFI_COMMON_SECTION_HEADER
)) {
1544 Ptr
+= sizeof (EFI_COMMON_SECTION_HEADER
);
1545 SectionLength
-= sizeof (EFI_COMMON_SECTION_HEADER
);
1546 while (SectionLength
> 0) {
1549 case EFI_DEP_BEFORE
:
1550 printf ("BEFORE\n");
1563 PrintGuidToBuffer ((EFI_GUID
*) (Ptr
+ 1), GuidBuffer
, sizeof (GuidBuffer
), TRUE
);
1564 printf ("%s ", GuidBuffer
);
1565 PrintGuidName (GuidBuffer
);
1568 // PrintGuid ((EFI_GUID *)(Ptr + 1));
1571 SectionLength
-= 17;
1605 printf ("END DEPEX\n");
1617 printf ("Unrecognized byte in depex: 0x%X\n", *Ptr
);
1631 Routine Description:
1633 GC_TODO: Add function description
1637 GuidStr - GC_TODO: add argument description
1641 EFI_SUCCESS - GC_TODO: Add description for return value
1642 EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
1646 GUID_TO_BASENAME
*GPtr
;
1648 // If we have a list of guid-to-basenames, then go through the list to
1649 // look for a guid string match. If found, print the basename to stdout,
1650 // otherwise return a failure.
1652 GPtr
= mGuidBaseNameList
;
1653 while (GPtr
!= NULL
) {
1654 if (_stricmp ((CHAR8
*) GuidStr
, (CHAR8
*) GPtr
->Guid
) == 0) {
1655 printf ("%s", GPtr
->BaseName
);
1662 return EFI_INVALID_PARAMETER
;
1666 ParseGuidBaseNameFile (
1671 Routine Description:
1673 GC_TODO: Add function description
1677 FileName - GC_TODO: add argument description
1681 EFI_DEVICE_ERROR - GC_TODO: Add description for return value
1682 EFI_OUT_OF_RESOURCES - GC_TODO: Add description for return value
1683 EFI_SUCCESS - GC_TODO: Add description for return value
1688 CHAR8 Line
[MAX_LINE_LEN
];
1689 GUID_TO_BASENAME
*GPtr
;
1691 if ((Fptr
= fopen (FileName
, "r")) == NULL
) {
1692 printf ("ERROR: Failed to open input cross-reference file '%s'\n", FileName
);
1693 return EFI_DEVICE_ERROR
;
1696 while (fgets (Line
, sizeof (Line
), Fptr
) != NULL
) {
1698 // Allocate space for another guid/basename element
1700 GPtr
= malloc (sizeof (GUID_TO_BASENAME
));
1702 return EFI_OUT_OF_RESOURCES
;
1705 memset ((char *) GPtr
, 0, sizeof (GUID_TO_BASENAME
));
1706 if (sscanf (Line
, "%s %s", GPtr
->Guid
, GPtr
->BaseName
) == 2) {
1707 GPtr
->Next
= mGuidBaseNameList
;
1708 mGuidBaseNameList
= GPtr
;
1711 // Some sort of error. Just continue.
1722 FreeGuidBaseNameList (
1727 Routine Description:
1729 GC_TODO: Add function description
1737 EFI_SUCCESS - GC_TODO: Add description for return value
1741 GUID_TO_BASENAME
*Next
;
1743 while (mGuidBaseNameList
!= NULL
) {
1744 Next
= mGuidBaseNameList
->Next
;
1745 free (mGuidBaseNameList
);
1746 mGuidBaseNameList
= Next
;
1755 LoadGuidedSectionToolsTxt (
1756 IN CHAR8
* FirmwareVolumeFilename
1759 CHAR8
* PeerFilename
;
1766 Places
[0] = FirmwareVolumeFilename
;
1767 //Places[1] = mUtilityFilename;
1769 mParsedGuidedSectionTools
= NULL
;
1771 for (Index
= 0; Index
< (sizeof(Places
)/sizeof(Places
[0])); Index
++) {
1772 PeerFilename
= OsPathPeerFilePath (Places
[Index
], "GuidedSectionTools.txt");
1773 //printf("Loading %s...\n", PeerFilename);
1774 if (OsPathExists (PeerFilename
)) {
1775 mParsedGuidedSectionTools
= ParseGuidedSectionToolsFile (PeerFilename
);
1777 free (PeerFilename
);
1778 if (mParsedGuidedSectionTools
!= NULL
) {
1791 Routine Description:
1793 GC_TODO: Add function description
1801 GC_TODO: add return values
1808 fprintf (stdout
, "Usage: %s [options] <input_file>\n\n", UTILITY_NAME
);
1811 // Copyright declaration
1813 fprintf (stdout
, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
1818 fprintf (stdout
, "Options:\n");
1819 fprintf (stdout
, " -x xref, --xref xref\n\
1820 Parse basename to file-guid cross reference file(s).\n");
1821 fprintf (stdout
, " --offset offset\n\
1822 Offset of file to start processing FV at.\n");
1823 fprintf (stdout
, " -h, --help\n\
1824 Show this help message and exit.\n");