Actually GenFw [1] already does a lot of PE/COFF magic, so it should be relatively easy to add a -I, —info, and dump out an overview of a PE/COFF image, and make comments on things that are not secure. It would also probably be useful to dump out information about the Debug Directory entries, His sections, etc. for general debug.
/Volumes/Case/edk2-github(eng/PR-557-XcodeResourceSections)>. edksetup.sh
Loading previous configuration from /Volumes/Case/edk2-github/Conf/BuildEnv.sh
WORKSPACE: /Volumes/Case/edk2-github
EDK_TOOLS_PATH: /Volumes/Case/edk2-github/BaseTools
CONF_PATH: /Volumes/Case/edk2-github/Conf
/Volumes/Case/edk2-github(eng/PR-557-XcodeResourceSections)>GenFw -h
GenFw Version 0.2 Developer Build based on Revision: Unknown
Usage: GenFw [options] <input_file>
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
Options:
-o FileName, --outputfile FileName
File will be created to store the output content.
-e EFI_FILETYPE, --efiImage EFI_FILETYPE
Create Efi Image. EFI_FILETYPE is one of BASE,SMM_CORE,
PEI_CORE, PEIM, DXE_CORE, DXE_DRIVER, UEFI_APPLICATION,
SEC, DXE_SAL_DRIVER, UEFI_DRIVER, DXE_RUNTIME_DRIVER,
DXE_SMM_DRIVER, SECURITY_CORE, COMBINED_PEIM_DRIVER,
MM_STANDALONE, MM_CORE_STANDALONE,
PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER,
APPLICATION, SAL_RT_DRIVER to support all module types
It can only be used together with --keepexceptiontable,
--keepzeropending, --keepoptionalheader, -r, -o option.
It is a action option. If it is combined with other action options,
the later input action option will override the previous one.
-c, --acpi Create Acpi table.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-t, --terse Create Te Image.
It can only be used together with --keepexceptiontable,
--keepzeropending, --keepoptionalheader, -r, -o option.
It is a action option. If it is combined with other action options,
the later input action option will override the previous one.
-u, --dump Dump TeImage Header.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-z, --zero Zero the Debug Data Fields in the PE input image file.
It also zeros the time stamp fields.
This option can be used to compare the binary efi image.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-b, --exe2bin Convert the input EXE to the output BIN file.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-l, --stripped Strip off the relocation info from PE or TE image.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-s timedate, --stamp timedate
timedate format is "yyyy-mm-dd 00:00:00". if timedata
is set to NOW, current system time is used. The support
date scope is 1970-01-01 00+timezone:00:00
~ 2038-01-19 03+timezone:14:07
The scope is adjusted according to the different zones.
It can't be combined with other action options
except for -o, -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-m, --mcifile Convert input microcode txt file to microcode bin file.
It can't be combined with other action options
except for -o option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-j, --join Combine multi microcode bin files to one file.
It can be specified with -a, -p, -o option.
No other options can be combined with it.
If it is combined with other action options, the later
input action option will override the previous one.
-a NUM, --align NUM NUM is one HEX or DEC format alignment value.
This option is only used together with -j option.
-p NUM, --pad NUM NUM is one HEX or DEC format padding value.
This option is only used together with -j option.
--keepexceptiontable Don't clear exception table.
This option can be used together with -e or -t.
It doesn't work for other options.
--keepoptionalheader Don't zero PE/COFF optional header fields.
This option can be used together with -e or -t.
It doesn't work for other options.
--keepzeropending Don't strip zero pending of .reloc.
This option can be used together with -e or -t.
It doesn't work for other options.
-r, --replace Overwrite the input file with the output content.
If more input files are specified,
the last input file will be as the output file.
-g HiiPackageListGuid, --hiiguid HiiPackageListGuid
Guid is used to specify hii package list guid.
Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
If not specified, the first Form FormSet guid is used.
--hiipackage Combine all input binary hii packages into
a single package list as the text resource data(RC).
It can't be combined with other action options
except for -o option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
--hiibinpackage Combine all input binary hii packages into
a single package list as the binary resource section.
It can't be combined with other action options
except for -o option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
--rc FlieName Append a Hii resource section to the
last PE/COFF section. The FileName is the resource section to append
If FileName does not exist this operation is skipped. This feature is
only intended for toolchains, like XCODE, that don't suport $(RC).
This option can only be combined with -e
--rebase NewAddress Rebase image to new base address. New address
is also set to the first none code section header.
It can't be combined with other action options
except for -o or -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
--address NewAddress Set new address into the first none code
section header of the input image.
It can't be combined with other action options
except for -o or -r option. It is a action option.
If it is combined with other action options, the later
input action option will override the previous one.
-v, --verbose Turn on verbose output with informational messages.
-q, --quiet Disable all messages except key message and fatal error
-d, --debug level Enable debug messages, at input debug level.
--version Show program's version number and exit
-h, --help Show this help message and exit