Name
GenFw.exe – build a UEFI image or other image.
Synopsis
GenFw.exe [options] Filename [Filename]…
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
Filename1 [FilenameN]
Input PE/PE32+ image, or TE image, or MicroCode Txt file, or MicroCode bin file.
-o FileName, --outputfile FileName
The EFI image, TeImage, AcpiImage, MicroBin or other modified PE image will be created.
-e EFI_FILETYPE, --efiImage EFI_FILETYPE
Create Efi image. EFI_FILETYPE is one of BASE, SEC, PEI_CORE, PEIM, DXE_CORE, DXE_RUNTIME_DRIVER, DXE_SAL_DRIVER, DXE_SMM_DRIVER, UEFI_DRIVER, UEFI_APPLICATIOn, SECURITY_CORE, COMBINED_PEIM_DRIVER, PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER, APPLICATION, SAL_RT_DRIVER, which contains all module types.
-c, --acpi
Create Acpi table.
-t, --terse
Create Te Image.
-u, --dump
Dump TeImage Header information.
-z, --zero
Zero the Debug Data Fields in the PE image file.
-b, --exe2bin
Convert the input EXE to the output BIN file.
-l, --stripped
Strip off the Relocation info from input PE or TE image.
-r, --replace
Overwrite the input file with the output content.
-s timedate, --stamp timedate
timedate format is “yyyy-mm-dd 00:00:00”. if timedata is set to “NOW”, current system time is used.
-m, --mcifile
Convert input microcode txt definition file to microcode bin file.
-j, --join
Merge multiple microcode bin files to one file.
--keepexceptiontable
Don’t clear exception table.
--keepzeropending
Don’t strip zero pending of .reloc.
-a NUM, --align NUM
NUM is one HEX or DEC format alignment value, which is used to combine multip microcode bin files.
-p NUM, --pad NUM
NUM is one HEX or DEC format padding value, which is used to combine multip microcode bin files.
-v, --verbose
Turn on verbose output with informational messages.
-d, --debug level
	Enable debug message with specified level.
--version
Show program's version number and exit
-h, --help
Show this help message and exit
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
Bugs
No known bugs.
Report bugs to issues@buildtools.tianocore.org
Files
None
See also
None
License
Copyright (c) 2007-2009 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.