GenSec.exe

Name

GenSec.exe - build one PI section file.

Synopsis

GenSec.exe [-v | -d] [-s <SectionType>] [-c <CompressType>] [-g <GuidValue>]
[-l <GuidHeaderLength>] [-r <GuidAttr>] [-n <UiString>] [-j <Number>]
-o <OutputFile> <InputFile1> [<InputFile2>] ...
GenSec.exe -h
GenSec.exe --version

Description

GenSec generates valid EFI_SECTION type files, which conform to the firmware file section defined in the PI specification, from PE32/PE32+/COFF image files or other binary files. This utility will produce a file that is the section header concatenated with the contents of the input file. It does not validate that the contents of the input file match the section added.

PI SECTION Types referred to the Volume 3 of the PI 1.0 specification.

Mnemonic

PI Section Type

COMPRESS

EFI_SECTION_COMPRESSION

GUID

EFI_SECTION_GUID_DEFINED

PE32

EFI_SECTION_PE32

PIC

EFI_SECTION_PIC

TE

EFI_SECTION_TE

DXE_DEPEX

EFI_SECTION_DXE_DEPEX

VERSION

EFI_SECTION_VERSION

UI

EFI_SECTION_USER_INTERFACE

COMPAT16

EFI_SECTION_COMPATIBILITY16

FVIMAGE

EFI_SECTION_FIRMWARE_VOLUME_IMAGE

SUBGUID

EFI_SECTION_FREEFORM_SUBTYPE_GUID

RAW

EFI_SECTION_RAW

PEI_DEPEX

EFI_SECTION_PEI_DEPEX

Options

If no options are specified, tool prints usage.

-o FileName, --outputfile FileName
File is the SectionFile to be created.
-s [SectionType], --sectiontype [SectionType]
SectionType defined in PI spec is one type of
EFI_SECTION_COMPRESSION, EFI_SECTION_GUID_DEFINED,
EFI_SECTION_PE32, EFI_SECTION_PIC, EFI_SECTION_TE,
EFI_SECTION_DXE_DEPEX, EFI_SECTION_COMPATIBILITY16,
EFI_SECTION_USER_INTERFACE, EFI_SECTION_VERSION,
EFI_SECTION_FIRMWARE_VOLUME_IMAGE, EFI_SECTION_RAW,
EFI_SECTION_FREEFORM_SUBTYPE_GUID,
EFI_SECTION_PEI_DEPEX, EFI_SECTION_SMM_DEPEX.
if -s option is not given,
EFI_SECTION_ALL is default section type.
-c [Type], --compress [Type]
Compress method type can be PI_NONE or PI_STD.
if -c option is not given, PI_STD is default type.
-g GuidValue, --vendor GuidValue
GuidValue is one specific vendor guid value.
Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-l GuidHeaderLength, --HeaderLength GuidHeaderLength
GuidHeaderLength is the size of header of guided data
-r GuidAttr, --attributes GuidAttr
GuidAttr is guid section atttributes, which may be
PROCESSING_REQUIRED, AUTH_STATUS_VALID and NONE.
if -r option is not given, default PROCESSING_REQUIRED
-n String, --name String
String is a NULL terminated string used in Ui section.
-j Number, --buildnumber Number
Number is an integer value between 0 and 65535
used in Ver section.
--sectionalign SectionAlign
SectionAlign points to section alignment, which support
the alignment scope 1~64K. It is specified in same
order that the section file is input.
-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 Value

Description

STATUS_SUCCESS 0

The action was completed as requested.

STATUS_ERROR 2

The action failed.

Example

  1. Generate PE32 section file with the input PE image, PE32 section type and the output file name.

    GenSec -s EFI_SECTION_PE32 PeiMain.efi -o PeiMain.pe32
  2. Generate compression section file with the input section files, compression method and the output file name.

    GenSec -s EFI_SECTION_COMPRESSION -c PI_STD PeiMain.pe32 PeiMain.ui PeiMain.ver -o PeiMain.com
  3. Generate the default CRC32 guided section file with the input section files, and the output file name.

    GenSec -s EFI_SECTION_GUID_DEFINED PeiMain.pe32 PeiMain.ui PeiMain.ver -o PeiMain.guided
  4. Generate the vendor specific guided section file with the input vendor raw files, the vendor guid, and the output file name.

    GenSec -s EFI_SECTION_GUID_DEFINED -g A31280AD-481E-41B6-95E8-127F-4C984779 -r PROCESSING_REQUIRED -r AUTH_STATUS_VALID PeiMain.raw -o PeiMain.guided
  5. Generate UI section with the input string and the output file name.

    Gensec -s EFI_SECTION_USER_INTERFACE -n "PeiMain" -o PeiMain.ui
  6. Generate VER section with the input build number and the output file name.

    GenSec -s EFI_SECTION_VERSION -j 20 -o PeiMain.ver

Bugs

No known issues.

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.