GenFw.exe

Name

GenFw.exe - build a UEFI image or other image.

Synopsis

GenFw.exe -r | -o <OutputFile> [-e <EfiType>]
[-c | -t | -l | -u | -b | -z | -s <TimeDate> |
-m | -j | --hiipackage | --hiibinpackage]
[-a] [-p] <InputFile>
GenFw.exe -h
GenFw.exe --version

Description

Genfw is mainly used to process PE32 image to get the expected image data or image file. PE32 is a general-purpose image format that contains, among other information, data identifying the target environment for execution of the image. This utility can modify the standard PE32 image to create UEFI image with EFI subsystem type, PI Terse Executable image with the compact TE image header, zero its dubug data or reset its time stamp. It can also extract PE32 image data to create bin file, extract PE32 image data section to create Acpi table image, or dump PI TE image header information. It can also parse the text MicroCode definition file to create the MicroCode binary image, merge (concatenate) several MicroCode binary images into a single file by pad value and alignment requirement. This tool also supports the override the input file with the output contents.

Options

If no options are specified, tool prints usage.

-o FileName, --outputfile FileName
File will be created to store the ouput 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,
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 pacakges 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 pacakges 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.
--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

Status codes returned

Return Code

Description

STATUS_SUCCESS 0

The action was completed as requested.

STATUS_ERROR 2

The action failed.

Example

  1. Generate Efi image with the input PE image, module type and the output file name.

    GenFw -e PEI_CORE PeiMain.dll -o PeiMain.efi
  2. Generate Te image with the input PE image and the output file name.

    GenFw -t PeiMain.dll -o PeiMain.te
  3. Generate acpi table image with the input PE image and the output file name.

    GenFw -c Facs.dll -o Facs.acpi
  4. Dump TeImage Header with the input Te Image and the output file name.

    GenFw -u PeiMain.te -o PeiMain.teheader
  5. Modify PeImage by zero its debug data.

    GenFw -z PeiMain.dll -o Peimain.zero
  6. Modify PeImage by set new timestamp and override the input image without the output file name.

    GenFw -s "2007-8-16 16:06:32" PeiMain.dll -r
  7. Extract bin image from PeImage.

    GenFw -b PeiMain.dll -o PeiMain.bin
  8. Generate the microcode binary file from the micro code txt file.

    GenFw -m Mci.txt -o Mci.bin
  9. Merge the multiple mci binary files to one file.

    GenFw -j Mci.bin1 Mci.bin2 Mci.bin3 -a 32 -p 0xFF -o Mci.bin
  10. Generate the text resource file (RC format) based on all input binary HII packages and their package list GUID.

    GenFw -o SampleHii.rc -g D49D2EB0-44D5-4621-9FD6-1A92C9109B99 -hiipackage SampleStr.hpk SampleVfr.hpk
  11. Generate the binary resource section based on all input binary HII packages and their package list guid.

    GenFw -o SampleHii.bin -g D49D2EB0-44D5-4621-9FD6-1A92C9109B99 -hiibinpackage SampleStr.hpk SampleVfr.hpk

Bugs

No known bugs.

Report bugs to [email protected]

Files

None

See also

None

License

Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at:

http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.