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>
33 #include <Guid/PiFirmwareFileSystem.h>
34 #include <IndustryStandard/PeImage.h>
35 #include <Protocol/GuidedSectionExtraction.h>
38 #include "Decompress.h"
40 #include "CommonLib.h"
41 #include "EfiUtilityMsgs.h"
42 #include "FirmwareVolumeBufferLib.h"
44 #include "ParseGuidedSectionTools.h"
45 #include "StringFuncs.h"
48 // Utility global variables
51 EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid
= EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID
;
53 #define UTILITY_MAJOR_VERSION 0
54 #define UTILITY_MINOR_VERSION 82
56 #define UTILITY_NAME "VolInfo"
58 #define EFI_SECTION_ERROR EFIERR (100)
60 #define MAX_BASENAME_LEN 60 // not good to hardcode, but let's be reasonable
63 // Structure to keep a list of guid-to-basenames
65 typedef struct _GUID_TO_BASENAME
{
66 struct _GUID_TO_BASENAME
*Next
;
67 INT8 Guid
[PRINTED_GUID_BUFFER_SIZE
];
68 INT8 BaseName
[MAX_BASENAME_LEN
];
71 static GUID_TO_BASENAME
*mGuidBaseNameList
= NULL
;
74 // Store GUIDed Section guid->tool mapping
76 EFI_HANDLE mParsedGuidedSectionTools
= NULL
;
78 CHAR8
* mUtilityFilename
= NULL
;
81 ParseGuidBaseNameFile (
86 FreeGuidBaseNameList (
97 IN UINT8
*SectionBuffer
,
98 IN UINT32 BufferLength
104 IN UINT32 SectionLength
112 OUT BOOLEAN
*ErasePolarity
118 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
,
119 EFI_FFS_FILE_HEADER
*FileHeader
,
120 BOOLEAN ErasePolarity
132 LoadGuidedSectionToolsTxt (
133 IN CHAR8
* FirmwareVolumeFilename
150 GC_TODO: Add function description
154 argc - GC_TODO: add argument description
155 ] - GC_TODO: add argument description
159 GC_TODO: add return values
165 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
;
169 BOOLEAN ErasePolarity
;
171 SetUtilityName (UTILITY_NAME
);
173 // Print utility header
175 printf ("%s Tiano Firmware Volume FFS image info. Version %d.%d, %s\n",
177 UTILITY_MAJOR_VERSION
,
178 UTILITY_MINOR_VERSION
,
183 // Save, and then skip filename arg
185 mUtilityFilename
= argv
[0];
192 // If they specified -x xref guid/basename cross-reference files, process it.
193 // This will print the basename beside each file guid. To use it, specify
194 // -x xref_filename to processdsc, then use xref_filename as a parameter
198 if ((strcmp(argv
[0], "-x") == 0) || (strcmp(argv
[0], "--xref") == 0)) {
199 ParseGuidBaseNameFile (argv
[1]);
200 printf("ParseGuidBaseNameFile: %s\n", argv
[1]);
203 } else if (strcmp(argv
[0], "--offset") == 0) {
207 if ((argv
[1][0] == '0') && (tolower ((int)argv
[1][1]) == 'x')) {
208 if (sscanf (argv
[1], "%x", &Offset
) != 1) {
209 Error (NULL
, 0, 1003, "Invalid option value", "Offset = %s", argv
[1]);
210 return GetUtilityStatus ();
213 if (sscanf (argv
[1], "%d", &Offset
) != 1) {
214 Error (NULL
, 0, 1003, "Invalid option value", "Offset = %s", argv
[1]);
215 return GetUtilityStatus ();
218 // See if they said something like "64K"
220 if (tolower ((int)argv
[1][strlen (argv
[1]) - 1]) == 'k') {
233 // Check for proper number of arguments
240 // Look for help options
242 if ((strcmp(argv
[0], "-h") == 0) || (strcmp(argv
[0], "--help") == 0) ||
243 (strcmp(argv
[0], "-?") == 0) || (strcmp(argv
[0], "/?") == 0)) {
249 // Open the file containing the FV
251 InputFile
= fopen (argv
[0], "rb");
252 if (InputFile
== NULL
) {
253 Error (NULL
, 0, 0001, "Error opening the input file", argv
[0]);
254 return GetUtilityStatus ();
257 // Skip over pad bytes if specified. This is used if they prepend 0xff
258 // data to the FV image binary.
261 fseek (InputFile
, Offset
, SEEK_SET
);
264 // Determine size of FV
266 Status
= ReadHeader (InputFile
, &FvSize
, &ErasePolarity
);
267 if (EFI_ERROR (Status
)) {
268 Error (NULL
, 0, 0003, "error parsing FV image", "%s Header is invalid", argv
[0]);
270 return GetUtilityStatus ();
273 // Allocate a buffer for the FV image
275 FvImage
= malloc (FvSize
);
276 if (FvImage
== NULL
) {
277 Error (NULL
, 0, 4001, "Resource: Memory can't be allocated", NULL
);
279 return GetUtilityStatus ();
282 // Seek to the start of the image, then read the entire FV to the buffer
284 fseek (InputFile
, Offset
, SEEK_SET
);
285 BytesRead
= fread (FvImage
, 1, FvSize
, InputFile
);
287 if ((unsigned int) BytesRead
!= FvSize
) {
288 Error (NULL
, 0, 0004, "error reading FvImage from", argv
[0]);
290 return GetUtilityStatus ();
293 LoadGuidedSectionToolsTxt (argv
[0]);
295 PrintFvInfo (FvImage
, FALSE
);
301 FreeGuidBaseNameList ();
302 return GetUtilityStatus ();
316 GC_TODO: Add function description
320 Fv - Firmware Volume to print information about
321 IsChildFv - Flag specifies whether the input FV is a child FV.
331 BOOLEAN ErasePolarity
;
333 EFI_FFS_FILE_HEADER
*CurrentFile
;
336 Status
= FvBufGetSize (Fv
, &FvSize
);
340 (((EFI_FIRMWARE_VOLUME_HEADER
*)Fv
)->Attributes
& EFI_FVB2_ERASE_POLARITY
) ?
344 // Get the first file
347 Status
= FvBufFindNextFile (Fv
, &Key
, (VOID
**) &CurrentFile
);
348 if (EFI_ERROR (Status
)) {
349 Error (NULL
, 0, 0003, "error parsing FV image", "cannot find the first file in the FV image");
350 return GetUtilityStatus ();
353 // Display information about files found
355 while (CurrentFile
!= NULL
) {
357 // Increment the number of files counter
362 // Display info about this file
364 Status
= PrintFileInfo (Fv
, CurrentFile
, ErasePolarity
);
365 if (EFI_ERROR (Status
)) {
366 Error (NULL
, 0, 0003, "error parsing FV image", "failed to parse a file in the FV");
367 return GetUtilityStatus ();
372 Status
= FvBufFindNextFile (Fv
, &Key
, (VOID
**) &CurrentFile
);
373 if (Status
== EFI_NOT_FOUND
) {
375 } else if (EFI_ERROR (Status
)) {
376 Error (NULL
, 0, 0003, "error parsing FV image", "cannot find the next file in the FV image");
377 return GetUtilityStatus ();
382 printf ("There are a total of %d files in the child FV\n", (int) NumberOfFiles
);
384 printf ("There are a total of %d files in this FV\n", (int) NumberOfFiles
);
392 IN UINT32 ActualSize
,
399 This function returns the next larger size that meets the alignment
400 requirement specified.
405 Alignment The desired alignment.
409 EFI_SUCCESS Function completed successfully.
410 EFI_ABORTED The function encountered an error.
416 OccupiedSize
= ActualSize
;
417 while ((OccupiedSize
& (Alignment
- 1)) != 0) {
427 IN EFI_SECTION_TYPE Type
433 Converts EFI Section names to Strings
437 Type - The EFI Section type
441 CHAR8* - Pointer to the String containing the section name.
446 CHAR8
*SectionTypeStringTable
[] = {
454 "EFI_SECTION_COMPRESSION",
458 "EFI_SECTION_GUID_DEFINED",
462 "Unknown section type - Reserved 0x03",
466 "Unknown section type - Reserved 0x04",
470 "Unknown section type - Reserved 0x05",
474 "Unknown section type - Reserved 0x06",
478 "Unknown section type - Reserved 0x07",
482 "Unknown section type - Reserved 0x08",
486 "Unknown section type - Reserved 0x09",
490 "Unknown section type - Reserved 0x0A",
494 "Unknown section type - Reserved 0x0B",
498 "Unknown section type - Reserved 0x0C",
502 "Unknown section type - Reserved 0x0D",
506 "Unknown section type - Reserved 0x0E",
510 "Unknown section type - Reserved 0x0E",
526 "EFI_SECTION_DXE_DEPEX",
530 "EFI_SECTION_VERSION",
534 "EFI_SECTION_USER_INTERFACE",
538 "EFI_SECTION_COMPATIBILITY16",
542 "EFI_SECTION_FIRMWARE_VOLUME_IMAGE ",
546 "EFI_SECTION_FREEFORM_SUBTYPE_GUID ",
554 "Unknown section type - 0x1A",
558 "EFI_SECTION_PEI_DEPEX",
562 "EFI_SECTION_SMM_DEPEX",
566 "Unknown section type - Reserved - beyond last defined section"
569 if (Type
> EFI_SECTION_LAST_SECTION_TYPE
) {
570 Type
= EFI_SECTION_LAST_SECTION_TYPE
+ 1;
573 SectionStr
= malloc (100);
574 if (SectionStr
== NULL
) {
575 printf ("Error: Out of memory resources.\n");
578 strcpy (SectionStr
, SectionTypeStringTable
[Type
]);
587 OUT BOOLEAN
*ErasePolarity
593 This function determines the size of the FV and the erase polarity. The
594 erase polarity is the FALSE value for file state.
598 InputFile The file that contains the FV image.
599 FvSize The size of the FV.
600 ErasePolarity The FV erase polarity.
604 EFI_SUCCESS Function completed successfully.
605 EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.
606 EFI_ABORTED The function encountered an error.
610 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader
;
611 EFI_FV_BLOCK_MAP_ENTRY BlockMap
;
619 // Check input parameters
621 if (InputFile
== NULL
|| FvSize
== NULL
|| ErasePolarity
== NULL
) {
622 Error (__FILE__
, __LINE__
, 0, "application error", "invalid parameter to function");
623 return EFI_INVALID_PARAMETER
;
628 fread (&VolumeHeader
, sizeof (EFI_FIRMWARE_VOLUME_HEADER
) - sizeof (EFI_FV_BLOCK_MAP_ENTRY
), 1, InputFile
);
629 BytesRead
= sizeof (EFI_FIRMWARE_VOLUME_HEADER
) - sizeof (EFI_FV_BLOCK_MAP_ENTRY
);
630 Signature
[0] = VolumeHeader
.Signature
;
634 // Print FV header information
636 printf ("Signature: %s (%X)\n", (char *) Signature
, (unsigned) VolumeHeader
.Signature
);
637 printf ("Attributes: %X\n", (unsigned) VolumeHeader
.Attributes
);
639 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_DISABLED_CAP
) {
640 printf (" EFI_FVB2_READ_DISABLED_CAP\n");
643 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_ENABLED_CAP
) {
644 printf (" EFI_FVB2_READ_ENABLED_CAP\n");
647 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_STATUS
) {
648 printf (" EFI_FVB2_READ_STATUS\n");
651 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_DISABLED_CAP
) {
652 printf (" EFI_FVB2_WRITE_DISABLED_CAP\n");
655 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_ENABLED_CAP
) {
656 printf (" EFI_FVB2_WRITE_ENABLED_CAP\n");
659 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_STATUS
) {
660 printf (" EFI_FVB2_WRITE_STATUS\n");
663 if (VolumeHeader
.Attributes
& EFI_FVB2_LOCK_CAP
) {
664 printf (" EFI_FVB2_LOCK_CAP\n");
667 if (VolumeHeader
.Attributes
& EFI_FVB2_LOCK_STATUS
) {
668 printf (" EFI_FVB2_LOCK_STATUS\n");
671 if (VolumeHeader
.Attributes
& EFI_FVB2_STICKY_WRITE
) {
672 printf (" EFI_FVB2_STICKY_WRITE\n");
675 if (VolumeHeader
.Attributes
& EFI_FVB2_MEMORY_MAPPED
) {
676 printf (" EFI_FVB2_MEMORY_MAPPED\n");
679 if (VolumeHeader
.Attributes
& EFI_FVB2_ERASE_POLARITY
) {
680 printf (" EFI_FVB2_ERASE_POLARITY\n");
681 *ErasePolarity
= TRUE
;
684 #if (PI_SPECIFICATION_VERSION < 0x00010000)
685 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT
) {
686 printf (" EFI_FVB2_ALIGNMENT\n");
689 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2
) {
690 printf (" EFI_FVB2_ALIGNMENT_2\n");
693 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4
) {
694 printf (" EFI_FVB2_ALIGNMENT_4\n");
697 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8
) {
698 printf (" EFI_FVB2_ALIGNMENT_8\n");
701 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16
) {
702 printf (" EFI_FVB2_ALIGNMENT_16\n");
705 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32
) {
706 printf (" EFI_FVB2_ALIGNMENT_32\n");
709 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64
) {
710 printf (" EFI_FVB2_ALIGNMENT_64\n");
713 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128
) {
714 printf (" EFI_FVB2_ALIGNMENT_128\n");
717 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256
) {
718 printf (" EFI_FVB2_ALIGNMENT_256\n");
721 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512
) {
722 printf (" EFI_FVB2_ALIGNMENT_512\n");
725 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1K
) {
726 printf (" EFI_FVB2_ALIGNMENT_1K\n");
729 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2K
) {
730 printf (" EFI_FVB2_ALIGNMENT_2K\n");
733 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4K
) {
734 printf (" EFI_FVB2_ALIGNMENT_4K\n");
737 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8K
) {
738 printf (" EFI_FVB2_ALIGNMENT_8K\n");
741 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16K
) {
742 printf (" EFI_FVB2_ALIGNMENT_16K\n");
745 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32K
) {
746 printf (" EFI_FVB2_ALIGNMENT_32K\n");
749 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64K
) {
750 printf (" EFI_FVB2_ALIGNMENT_64K\n");
755 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_LOCK_CAP
) {
756 printf (" EFI_FVB2_READ_LOCK_CAP\n");
759 if (VolumeHeader
.Attributes
& EFI_FVB2_READ_LOCK_STATUS
) {
760 printf (" EFI_FVB2_READ_LOCK_STATUS\n");
763 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_LOCK_CAP
) {
764 printf (" EFI_FVB2_WRITE_LOCK_CAP\n");
767 if (VolumeHeader
.Attributes
& EFI_FVB2_WRITE_LOCK_STATUS
) {
768 printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
771 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1
) {
772 printf (" EFI_FVB2_ALIGNMENT_1\n");
775 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2
) {
776 printf (" EFI_FVB2_ALIGNMENT_2\n");
779 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4
) {
780 printf (" EFI_FVB2_ALIGNMENT_4\n");
783 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8
) {
784 printf (" EFI_FVB2_ALIGNMENT_8\n");
787 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16
) {
788 printf (" EFI_FVB2_ALIGNMENT_16\n");
791 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32
) {
792 printf (" EFI_FVB2_ALIGNMENT_32\n");
795 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64
) {
796 printf (" EFI_FVB2_ALIGNMENT_64\n");
799 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128
) {
800 printf (" EFI_FVB2_ALIGNMENT_128\n");
803 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256
) {
804 printf (" EFI_FVB2_ALIGNMENT_256\n");
807 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512
) {
808 printf (" EFI_FVB2_ALIGNMENT_512\n");
811 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1K
) {
812 printf (" EFI_FVB2_ALIGNMENT_1K\n");
815 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2K
) {
816 printf (" EFI_FVB2_ALIGNMENT_2K\n");
819 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4K
) {
820 printf (" EFI_FVB2_ALIGNMENT_4K\n");
823 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8K
) {
824 printf (" EFI_FVB2_ALIGNMENT_8K\n");
827 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16K
) {
828 printf (" EFI_FVB2_ALIGNMENT_16K\n");
831 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32K
) {
832 printf (" EFI_FVB2_ALIGNMENT_32K\n");
835 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64K
) {
836 printf (" EFI_FVB2_ALIGNMENT_64K\n");
839 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128K
) {
840 printf (" EFI_FVB2_ALIGNMENT_128K\n");
843 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256K
) {
844 printf (" EFI_FVB2_ALIGNMENT_256K\n");
847 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMNET_512K
) {
848 printf (" EFI_FVB2_ALIGNMNET_512K\n");
851 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1M
) {
852 printf (" EFI_FVB2_ALIGNMENT_1M\n");
855 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2M
) {
856 printf (" EFI_FVB2_ALIGNMENT_2M\n");
859 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_4M
) {
860 printf (" EFI_FVB2_ALIGNMENT_4M\n");
863 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_8M
) {
864 printf (" EFI_FVB2_ALIGNMENT_8M\n");
867 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_16M
) {
868 printf (" EFI_FVB2_ALIGNMENT_16M\n");
871 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_32M
) {
872 printf (" EFI_FVB2_ALIGNMENT_32M\n");
875 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64M
) {
876 printf (" EFI_FVB2_ALIGNMENT_64M\n");
879 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128M
) {
880 printf (" EFI_FVB2_ALIGNMENT_128M\n");
883 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_64M
) {
884 printf (" EFI_FVB2_ALIGNMENT_64M\n");
887 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_128M
) {
888 printf (" EFI_FVB2_ALIGNMENT_128M\n");
891 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_256M
) {
892 printf (" EFI_FVB2_ALIGNMENT_256M\n");
895 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_512M
) {
896 printf (" EFI_FVB2_ALIGNMENT_512M\n");
899 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_1G
) {
900 printf (" EFI_FVB2_ALIGNMENT_1G\n");
903 if (VolumeHeader
.Attributes
& EFI_FVB2_ALIGNMENT_2G
) {
904 printf (" EFI_FVB2_ALIGNMENT_2G\n");
908 printf ("Header Length: 0x%08X\n", VolumeHeader
.HeaderLength
);
909 printf ("File System ID: ");
910 PrintGuid (&VolumeHeader
.FileSystemGuid
);
914 printf ("Revision: 0x%04X\n", VolumeHeader
.Revision
);
917 fread (&BlockMap
, sizeof (EFI_FV_BLOCK_MAP_ENTRY
), 1, InputFile
);
918 BytesRead
+= sizeof (EFI_FV_BLOCK_MAP_ENTRY
);
920 if (BlockMap
.NumBlocks
!= 0) {
921 printf ("Number of Blocks: 0x%08X\n", (unsigned) BlockMap
.NumBlocks
);
922 printf ("Block Length: 0x%08X\n", (unsigned) BlockMap
.Length
);
923 Size
+= BlockMap
.NumBlocks
* BlockMap
.Length
;
926 } while (!(BlockMap
.NumBlocks
== 0 && BlockMap
.Length
== 0));
928 if (BytesRead
!= VolumeHeader
.HeaderLength
) {
929 printf ("ERROR: Header length not consistent with Block Maps!\n");
933 if (VolumeHeader
.FvLength
!= Size
) {
934 printf ("ERROR: Volume Size not consistant with Block Maps!\n");
938 printf ("Total Volume Size: 0x%08X\n", (unsigned) Size
);
943 // rewind (InputFile);
951 EFI_FIRMWARE_VOLUME_HEADER
*FvImage
,
952 EFI_FFS_FILE_HEADER
*FileHeader
,
953 BOOLEAN ErasePolarity
959 GC_TODO: Add function description
963 FvImage - GC_TODO: add argument description
964 FileHeader - GC_TODO: add argument description
965 ErasePolarity - GC_TODO: add argument description
969 EFI_SUCCESS - GC_TODO: Add description for return value
970 EFI_ABORTED - GC_TODO: Add description for return value
977 EFI_FFS_FILE_HEADER BlankHeader
;
979 UINT8 GuidBuffer
[PRINTED_GUID_BUFFER_SIZE
];
980 #if (PI_SPECIFICATION_VERSION < 0x00010000)
984 // Check if we have free space
987 memset (&BlankHeader
, -1, sizeof (EFI_FFS_FILE_HEADER
));
989 memset (&BlankHeader
, 0, sizeof (EFI_FFS_FILE_HEADER
));
992 if (memcmp (&BlankHeader
, FileHeader
, sizeof (EFI_FFS_FILE_HEADER
)) == 0) {
996 // Print file information.
998 printf ("============================================================\n");
1000 printf ("File Name: ");
1001 PrintGuidToBuffer (&FileHeader
->Name
, GuidBuffer
, sizeof (GuidBuffer
), TRUE
);
1002 printf ("%s ", GuidBuffer
);
1003 PrintGuidName (GuidBuffer
);
1007 // PrintGuid (&FileHeader->Name);
1010 FileLength
= GetLength (FileHeader
->Size
);
1011 printf ("File Offset: 0x%08X\n", (unsigned) ((UINTN
) FileHeader
- (UINTN
) FvImage
));
1012 printf ("File Length: 0x%08X\n", (unsigned) FileLength
);
1013 printf ("File Attributes: 0x%02X\n", FileHeader
->Attributes
);
1014 printf ("File State: 0x%02X\n", FileHeader
->State
);
1019 FileState
= GetFileState (ErasePolarity
, FileHeader
);
1021 switch (FileState
) {
1023 case EFI_FILE_HEADER_CONSTRUCTION
:
1024 printf (" EFI_FILE_HEADER_CONSTRUCTION\n");
1027 case EFI_FILE_HEADER_INVALID
:
1028 printf (" EFI_FILE_HEADER_INVALID\n");
1031 case EFI_FILE_HEADER_VALID
:
1032 printf (" EFI_FILE_HEADER_VALID\n");
1033 Checksum
= CalculateSum8 ((UINT8
*) FileHeader
, sizeof (EFI_FFS_FILE_HEADER
));
1034 Checksum
= (UINT8
) (Checksum
- FileHeader
->IntegrityCheck
.Checksum
.File
);
1035 Checksum
= (UINT8
) (Checksum
- FileHeader
->State
);
1036 if (Checksum
!= 0) {
1037 printf ("ERROR: Header checksum invalid.\n");
1043 case EFI_FILE_DELETED
:
1044 printf (" EFI_FILE_DELETED\n");
1046 case EFI_FILE_MARKED_FOR_UPDATE
:
1047 printf (" EFI_FILE_MARKED_FOR_UPDATE\n");
1049 case EFI_FILE_DATA_VALID
:
1050 printf (" EFI_FILE_DATA_VALID\n");
1053 // Calculate header checksum
1055 Checksum
= CalculateSum8 ((UINT8
*) FileHeader
, sizeof (EFI_FFS_FILE_HEADER
));
1056 Checksum
= (UINT8
) (Checksum
- FileHeader
->IntegrityCheck
.Checksum
.File
);
1057 Checksum
= (UINT8
) (Checksum
- FileHeader
->State
);
1058 if (Checksum
!= 0) {
1059 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid header checksum", GuidBuffer
);
1063 FileLength
= GetLength (FileHeader
->Size
);
1065 if (FileHeader
->Attributes
& FFS_ATTRIB_CHECKSUM
) {
1067 // Calculate file checksum
1069 Checksum
= CalculateSum8 ((UINT8
*) (FileHeader
+ 1), FileLength
- sizeof (EFI_FFS_FILE_HEADER
));
1070 Checksum
= Checksum
+ FileHeader
->IntegrityCheck
.Checksum
.File
;
1071 if (Checksum
!= 0) {
1072 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid file checksum", GuidBuffer
);
1076 if (FileHeader
->IntegrityCheck
.Checksum
.File
!= FFS_FIXED_CHECKSUM
) {
1077 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
);
1081 #if (PI_SPECIFICATION_VERSION < 0x00010000)
1083 // Verify tail if present
1085 if (FileHeader
->Attributes
& FFS_ATTRIB_TAIL_PRESENT
) {
1087 // Verify tail is complement of integrity check field in the header.
1089 Tail
= (UINT16
*) ((UINTN
) FileHeader
+ GetLength (FileHeader
->Size
) - sizeof (EFI_FFS_INTEGRITY_CHECK
));
1090 if (FileHeader
->IntegrityCheck
.TailReference
!= (UINT16
)~(*Tail
)) {
1091 Error (NULL
, 0, 0003, "error parsing FFS file", \
1092 "FFS file with Guid %s failed in the integrity check, tail is not the complement of the header field", GuidBuffer
);
1100 Error (NULL
, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has the invalid/unrecognized file state bits", GuidBuffer
);
1104 printf ("File Type: 0x%02X ", FileHeader
->Type
);
1106 switch (FileHeader
->Type
) {
1108 case EFI_FV_FILETYPE_RAW
:
1109 printf ("EFI_FV_FILETYPE_RAW\n");
1112 case EFI_FV_FILETYPE_FREEFORM
:
1113 printf ("EFI_FV_FILETYPE_FREEFORM\n");
1116 case EFI_FV_FILETYPE_SECURITY_CORE
:
1117 printf ("EFI_FV_FILETYPE_SECURITY_CORE\n");
1120 case EFI_FV_FILETYPE_PEI_CORE
:
1121 printf ("EFI_FV_FILETYPE_PEI_CORE\n");
1124 case EFI_FV_FILETYPE_DXE_CORE
:
1125 printf ("EFI_FV_FILETYPE_DXE_CORE\n");
1128 case EFI_FV_FILETYPE_PEIM
:
1129 printf ("EFI_FV_FILETYPE_PEIM\n");
1132 case EFI_FV_FILETYPE_DRIVER
:
1133 printf ("EFI_FV_FILETYPE_DRIVER\n");
1136 case EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER
:
1137 printf ("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER\n");
1140 case EFI_FV_FILETYPE_APPLICATION
:
1141 printf ("EFI_FV_FILETYPE_APPLICATION\n");
1144 case EFI_FV_FILETYPE_SMM
:
1145 printf ("EFI_FV_FILETYPE_SMM\n");
1148 case EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
:
1149 printf ("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE\n");
1152 case EFI_FV_FILETYPE_COMBINED_SMM_DXE
:
1153 printf ("EFI_FV_FILETYPE_COMBINED_SMM_DXE\n");
1156 case EFI_FV_FILETYPE_SMM_CORE
:
1157 printf ("EFI_FV_FILETYPE_SMM_CORE\n");
1160 case EFI_FV_FILETYPE_FFS_PAD
:
1161 printf ("EFI_FV_FILETYPE_FFS_PAD\n");
1165 printf ("\nERROR: Unrecognized file type %X.\n", FileHeader
->Type
);
1170 switch (FileHeader
->Type
) {
1172 case EFI_FV_FILETYPE_ALL
:
1173 case EFI_FV_FILETYPE_RAW
:
1174 case EFI_FV_FILETYPE_FFS_PAD
:
1179 // All other files have sections
1181 Status
= ParseSection (
1182 (UINT8
*) ((UINTN
) FileHeader
+ sizeof (EFI_FFS_FILE_HEADER
)),
1183 GetLength (FileHeader
->Size
) - sizeof (EFI_FFS_FILE_HEADER
)
1185 if (EFI_ERROR (Status
)) {
1187 // printf ("ERROR: Parsing the FFS file.\n");
1199 IN UINT8
*SectionBuffer
,
1200 IN UINT32 BufferLength
1204 Routine Description:
1210 SectionBuffer - Buffer containing the section to parse.
1211 BufferLength - Length of SectionBuffer
1215 EFI_SECTION_ERROR - Problem with section parsing.
1216 (a) compression errors
1217 (b) unrecognized section
1218 EFI_UNSUPPORTED - Do not know how to parse the section.
1219 EFI_SUCCESS - Section successfully parsed.
1220 EFI_OUT_OF_RESOURCES - Memory allocation failed.
1224 EFI_SECTION_TYPE Type
;
1226 UINT32 SectionLength
;
1229 UINT32 ParsedLength
;
1230 UINT8
*CompressedBuffer
;
1231 UINT32 CompressedLength
;
1232 UINT8
*UncompressedBuffer
;
1233 UINT32 UncompressedLength
;
1234 UINT8
*ToolOutputBuffer
;
1235 UINT32 ToolOutputLength
;
1236 UINT8 CompressionType
;
1239 UINT8
*ScratchBuffer
;
1240 DECOMPRESS_FUNCTION DecompressFunction
;
1241 GETINFO_FUNCTION GetInfoFunction
;
1243 CHAR8
*ExtractionTool
;
1244 CHAR8
*ToolInputFile
;
1245 CHAR8
*ToolOutputFile
;
1246 CHAR8
*SystemCommandFormatString
;
1247 CHAR8
*SystemCommand
;
1250 while (ParsedLength
< BufferLength
) {
1251 Ptr
= SectionBuffer
+ ParsedLength
;
1253 SectionLength
= GetLength (((EFI_COMMON_SECTION_HEADER
*) Ptr
)->Size
);
1254 Type
= ((EFI_COMMON_SECTION_HEADER
*) Ptr
)->Type
;
1257 // This is sort of an odd check, but is necessary because FFS files are
1258 // padded to a QWORD boundary, meaning there is potentially a whole section
1259 // header worth of 0xFF bytes.
1261 if (SectionLength
== 0xffffff && Type
== 0xff) {
1266 SectionName
= SectionNameToStr (Type
);
1267 printf ("------------------------------------------------------------\n");
1268 printf (" Type: %s\n Size: 0x%08X\n", SectionName
, (unsigned) SectionLength
);
1272 case EFI_SECTION_RAW
:
1273 case EFI_SECTION_PE32
:
1274 case EFI_SECTION_PIC
:
1275 case EFI_SECTION_TE
:
1276 // default is no more information
1279 case EFI_SECTION_USER_INTERFACE
:
1280 // name = &((EFI_USER_INTERFACE_SECTION *) Ptr)->FileNameString;
1281 // printf (" String: %s\n", &name);
1284 case EFI_SECTION_FIRMWARE_VOLUME_IMAGE
:
1285 Status
= PrintFvInfo (((EFI_FIRMWARE_VOLUME_IMAGE_SECTION
*)Ptr
) + 1, TRUE
);
1286 if (EFI_ERROR (Status
)) {
1287 Error (NULL
, 0, 0003, "printing of FV section contents failed", NULL
);
1288 return EFI_SECTION_ERROR
;
1292 case EFI_SECTION_COMPATIBILITY16
:
1293 case EFI_SECTION_FREEFORM_SUBTYPE_GUID
:
1295 // Section does not contain any further header information.
1299 case EFI_SECTION_PEI_DEPEX
:
1300 case EFI_SECTION_DXE_DEPEX
:
1301 case EFI_SECTION_SMM_DEPEX
:
1302 DumpDepexSection (Ptr
, SectionLength
);
1305 case EFI_SECTION_VERSION
:
1306 printf (" Build Number: 0x%02X\n", ((EFI_VERSION_SECTION
*) Ptr
)->BuildNumber
);
1307 printf (" Version Strg: %s\n", (char*) ((EFI_VERSION_SECTION
*) Ptr
)->VersionString
);
1310 case EFI_SECTION_COMPRESSION
:
1311 UncompressedBuffer
= NULL
;
1312 CompressedLength
= SectionLength
- sizeof (EFI_COMPRESSION_SECTION
);
1313 UncompressedLength
= ((EFI_COMPRESSION_SECTION
*) Ptr
)->UncompressedLength
;
1314 CompressionType
= ((EFI_COMPRESSION_SECTION
*) Ptr
)->CompressionType
;
1315 printf (" Uncompressed Length: 0x%08X\n", (unsigned) UncompressedLength
);
1317 if (CompressionType
== EFI_NOT_COMPRESSED
) {
1318 printf (" Compression Type: EFI_NOT_COMPRESSED\n");
1319 if (CompressedLength
!= UncompressedLength
) {
1324 "file is not compressed, but the compressed length does not match the uncompressed length",
1327 return EFI_SECTION_ERROR
;
1330 UncompressedBuffer
= Ptr
+ sizeof (EFI_COMPRESSION_SECTION
);
1331 } else if (CompressionType
== EFI_STANDARD_COMPRESSION
) {
1332 GetInfoFunction
= EfiGetInfo
;
1333 DecompressFunction
= EfiDecompress
;
1334 printf (" Compression Type: EFI_STANDARD_COMPRESSION\n");
1336 CompressedBuffer
= Ptr
+ sizeof (EFI_COMPRESSION_SECTION
);
1338 Status
= GetInfoFunction (CompressedBuffer
, CompressedLength
, &DstSize
, &ScratchSize
);
1339 if (EFI_ERROR (Status
)) {
1340 Error (NULL
, 0, 0003, "error getting compression info from compression section", NULL
);
1341 return EFI_SECTION_ERROR
;
1344 if (DstSize
!= UncompressedLength
) {
1345 Error (NULL
, 0, 0003, "compression error in the compression section", NULL
);
1346 return EFI_SECTION_ERROR
;
1349 ScratchBuffer
= malloc (ScratchSize
);
1350 UncompressedBuffer
= malloc (UncompressedLength
);
1351 if ((ScratchBuffer
== NULL
) || (UncompressedBuffer
== NULL
)) {
1352 return EFI_OUT_OF_RESOURCES
;
1354 Status
= DecompressFunction (
1362 free (ScratchBuffer
);
1363 if (EFI_ERROR (Status
)) {
1364 Error (NULL
, 0, 0003, "decompress failed", NULL
);
1365 free (UncompressedBuffer
);
1366 return EFI_SECTION_ERROR
;
1369 Error (NULL
, 0, 0003, "unrecognized compression type", "type 0x%X", CompressionType
);
1370 return EFI_SECTION_ERROR
;
1373 Status
= ParseSection (UncompressedBuffer
, UncompressedLength
);
1375 if (CompressionType
== EFI_STANDARD_COMPRESSION
) {
1377 // We need to deallocate Buffer
1379 free (UncompressedBuffer
);
1382 if (EFI_ERROR (Status
)) {
1383 Error (NULL
, 0, 0003, "failed to parse section", NULL
);
1384 return EFI_SECTION_ERROR
;
1388 case EFI_SECTION_GUID_DEFINED
:
1389 printf (" SectionDefinitionGuid: ");
1390 PrintGuid (&((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
);
1392 printf (" DataOffset: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
);
1393 printf (" Attributes: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->Attributes
);
1396 LookupGuidedSectionToolPath (
1397 mParsedGuidedSectionTools
,
1398 &((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
1401 if (ExtractionTool
!= NULL
) {
1403 ToolInputFile
= CloneString (tmpnam (NULL
));
1404 ToolOutputFile
= CloneString (tmpnam (NULL
));
1407 // Construction 'system' command string
1409 SystemCommandFormatString
= "%s -d -o %s %s";
1410 SystemCommand
= malloc (
1411 strlen (SystemCommandFormatString
) +
1412 strlen (ExtractionTool
) +
1413 strlen (ToolInputFile
) +
1414 strlen (ToolOutputFile
) +
1419 SystemCommandFormatString
,
1424 free (ExtractionTool
);
1429 (CHAR8
*) SectionBuffer
+ ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
,
1430 BufferLength
- ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
1433 system (SystemCommand
);
1434 remove (ToolInputFile
);
1435 free (ToolInputFile
);
1440 (CHAR8
**)&ToolOutputBuffer
,
1443 remove (ToolOutputFile
);
1444 free (ToolOutputFile
);
1445 if (EFI_ERROR (Status
)) {
1446 Error (NULL
, 0, 0004, "unable to read decoded GUIDED section", NULL
);
1447 return EFI_SECTION_ERROR
;
1450 Status
= ParseSection (
1454 if (EFI_ERROR (Status
)) {
1455 Error (NULL
, 0, 0003, "parse of decoded GUIDED section failed", NULL
);
1456 return EFI_SECTION_ERROR
;
1460 // Check for CRC32 sections which we can handle internally if needed.
1462 } else if (!CompareGuid (
1463 &((EFI_GUID_DEFINED_SECTION
*) Ptr
)->SectionDefinitionGuid
,
1464 &gEfiCrc32GuidedSectionExtractionProtocolGuid
1468 // CRC32 guided section
1470 Status
= ParseSection (
1471 SectionBuffer
+ ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
,
1472 BufferLength
- ((EFI_GUID_DEFINED_SECTION
*) Ptr
)->DataOffset
1474 if (EFI_ERROR (Status
)) {
1475 Error (NULL
, 0, 0003, "parse of CRC32 GUIDED section failed", NULL
);
1476 return EFI_SECTION_ERROR
;
1480 // We don't know how to parse it now.
1482 Error (NULL
, 0, 0003, "Error parsing section", \
1483 "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).");
1484 return EFI_UNSUPPORTED
;
1490 // Unknown section, return error
1492 Error (NULL
, 0, 0003, "unrecognized section type found", "section type = 0x%X", Type
);
1493 return EFI_SECTION_ERROR
;
1496 ParsedLength
+= SectionLength
;
1498 // We make then next section begin on a 4-byte boundary
1500 ParsedLength
= GetOccupiedSize (ParsedLength
, 4);
1503 if (ParsedLength
< BufferLength
) {
1504 Error (NULL
, 0, 0003, "sections do not completely fill the sectioned buffer being parsed", NULL
);
1505 return EFI_SECTION_ERROR
;
1514 IN UINT32 SectionLength
1518 Routine Description:
1520 GC_TODO: Add function description
1524 Ptr - GC_TODO: add argument description
1525 SectionLength - GC_TODO: add argument description
1529 EFI_SUCCESS - GC_TODO: Add description for return value
1533 UINT8 GuidBuffer
[PRINTED_GUID_BUFFER_SIZE
];
1536 // Need at least a section header + data
1538 if (SectionLength
<= sizeof (EFI_COMMON_SECTION_HEADER
)) {
1542 Ptr
+= sizeof (EFI_COMMON_SECTION_HEADER
);
1543 SectionLength
-= sizeof (EFI_COMMON_SECTION_HEADER
);
1544 while (SectionLength
> 0) {
1547 case EFI_DEP_BEFORE
:
1548 printf ("BEFORE\n");
1561 PrintGuidToBuffer ((EFI_GUID
*) (Ptr
+ 1), GuidBuffer
, sizeof (GuidBuffer
), TRUE
);
1562 printf ("%s ", GuidBuffer
);
1563 PrintGuidName (GuidBuffer
);
1566 // PrintGuid ((EFI_GUID *)(Ptr + 1));
1569 SectionLength
-= 17;
1603 printf ("END DEPEX\n");
1615 printf ("Unrecognized byte in depex: 0x%X\n", *Ptr
);
1629 Routine Description:
1631 GC_TODO: Add function description
1635 GuidStr - GC_TODO: add argument description
1639 EFI_SUCCESS - GC_TODO: Add description for return value
1640 EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
1644 GUID_TO_BASENAME
*GPtr
;
1646 // If we have a list of guid-to-basenames, then go through the list to
1647 // look for a guid string match. If found, print the basename to stdout,
1648 // otherwise return a failure.
1650 GPtr
= mGuidBaseNameList
;
1651 while (GPtr
!= NULL
) {
1652 if (_stricmp ((CHAR8
*) GuidStr
, (CHAR8
*) GPtr
->Guid
) == 0) {
1653 printf ("%s", GPtr
->BaseName
);
1660 return EFI_INVALID_PARAMETER
;
1664 ParseGuidBaseNameFile (
1669 Routine Description:
1671 GC_TODO: Add function description
1675 FileName - GC_TODO: add argument description
1679 EFI_DEVICE_ERROR - GC_TODO: Add description for return value
1680 EFI_OUT_OF_RESOURCES - GC_TODO: Add description for return value
1681 EFI_SUCCESS - GC_TODO: Add description for return value
1686 CHAR8 Line
[MAX_LINE_LEN
];
1687 GUID_TO_BASENAME
*GPtr
;
1689 if ((Fptr
= fopen (FileName
, "r")) == NULL
) {
1690 printf ("ERROR: Failed to open input cross-reference file '%s'\n", FileName
);
1691 return EFI_DEVICE_ERROR
;
1694 while (fgets (Line
, sizeof (Line
), Fptr
) != NULL
) {
1696 // Allocate space for another guid/basename element
1698 GPtr
= malloc (sizeof (GUID_TO_BASENAME
));
1700 return EFI_OUT_OF_RESOURCES
;
1703 memset ((char *) GPtr
, 0, sizeof (GUID_TO_BASENAME
));
1704 if (sscanf (Line
, "%s %s", GPtr
->Guid
, GPtr
->BaseName
) == 2) {
1705 GPtr
->Next
= mGuidBaseNameList
;
1706 mGuidBaseNameList
= GPtr
;
1709 // Some sort of error. Just continue.
1720 FreeGuidBaseNameList (
1725 Routine Description:
1727 GC_TODO: Add function description
1735 EFI_SUCCESS - GC_TODO: Add description for return value
1739 GUID_TO_BASENAME
*Next
;
1741 while (mGuidBaseNameList
!= NULL
) {
1742 Next
= mGuidBaseNameList
->Next
;
1743 free (mGuidBaseNameList
);
1744 mGuidBaseNameList
= Next
;
1753 LoadGuidedSectionToolsTxt (
1754 IN CHAR8
* FirmwareVolumeFilename
1757 CHAR8
* PeerFilename
;
1764 Places
[0] = FirmwareVolumeFilename
;
1765 //Places[1] = mUtilityFilename;
1767 mParsedGuidedSectionTools
= NULL
;
1769 for (Index
= 0; Index
< (sizeof(Places
)/sizeof(Places
[0])); Index
++) {
1770 PeerFilename
= OsPathPeerFilePath (Places
[Index
], "GuidedSectionTools.txt");
1771 //printf("Loading %s...\n", PeerFilename);
1772 if (OsPathExists (PeerFilename
)) {
1773 mParsedGuidedSectionTools
= ParseGuidedSectionToolsFile (PeerFilename
);
1775 free (PeerFilename
);
1776 if (mParsedGuidedSectionTools
!= NULL
) {
1789 Routine Description:
1791 GC_TODO: Add function description
1799 GC_TODO: add return values
1806 fprintf (stdout
, "Usage: %s [options] <input_file>\n\n", UTILITY_NAME
);
1809 // Copyright declaration
1811 fprintf (stdout
, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
1816 fprintf (stdout
, "Options:\n");
1817 fprintf (stdout
, " -x xref, --xref xref\n\
1818 Parse basename to file-guid cross reference file(s).\n");
1819 fprintf (stdout
, " --offset offset\n\
1820 Offset of file to start processing FV at.\n");
1821 fprintf (stdout
, " -h, --help\n\
1822 Show this help message and exit.\n");