Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:UEFI firmware volume (PI)

From ReverseEngineering.wiki
Format
Platforms UEFI firmware (x86, ARM, RISC-V)
Magic _FVH at offset 0x28 of the volume header
Extensions .fd, .rom, .fv, .bin
Endianness little
License BSD-2-Clause-Patent (edk2 headers)
On this wiki Facts · Code · Notes · Topics

The Platform Initialization container of UEFI/BIOS flash images: a firmware volume (header with signature _FVH at offset 0x28) holding FFS files made of typed sections (PE32, TE, depex, compressed, GUID-defined), as parsed by UEFITool.

Overview

A UEFI flash image (SPI dump, .fd, vendor update file) is a sequence of firmware volumes (FV), often behind an Intel flash descriptor (x86) and padded with 0xFF. Find them by scanning for the ASCII signature _FVH (5F 46 56 48); the volume starts 0x28 bytes earlier. Firmware files (FFS) inside the volume hold drivers and applications as PE32 or Format:TE image sections; see also Format:UEFI capsule for update packages.

A flash image that begins with the Intel flash descriptor is described on Format:Intel flash descriptor. A volume's file-system GUID can also be a legacy or vendor one (see the identification fact on vendor volume GUIDs); the volume top file 1BA0062E-C779-4582-8566-336AE8F78F09 must end at the last byte of its volume (edk2 FirmwareFileSystem2.h), which is where the x86 reset vector lives.

Volume header (EFI_FIRMWARE_VOLUME_HEADER)

Offset Size Field
0x00 16 ZeroVector (reset vector code on the boot FV)
0x10 16 FileSystemGuid: FFS2 8C8CE578-8A3D-4F1C-9935-896185C32DD3, FFS3 5473C07A-3DCB-4DCA-BD6F-1E9689E7349A
0x20 8 FvLength (whole volume including header)
0x28 4 Signature _FVH
0x2C 4 Attributes (EFI_FVB2_*: bit 0x800 ERASE_POLARITY, bits 0x001F0000 alignment as power of two, 0x400 MEMORY_MAPPED)
0x30 2 HeaderLength
0x32 2 Checksum (16-bit words of the header sum to zero)
0x34 2 ExtHeaderOffset (0 = none; extension has FvName GUID and ExtHeaderSize)
0x36 1 Reserved (0)
0x37 1 Revision (2)
0x38 8n BlockMap: (NumBlocks u32, Length u32) pairs ended by {0,0}

After the header come FFS files, each aligned to 8 bytes. Free space is filled with the erase polarity byte (0xFF normally).

FFS file header (EFI_FFS_FILE_HEADER, 24 bytes)

Name GUID (16), IntegrityCheck header byte and file byte (2), Type (1), Attributes (1), Size[3] (little endian 24-bit, includes header), State (1). If Attributes has FFS_ATTRIB_LARGE_FILE (0x01), Size is 0 and an 8-byte ExtendedSize follows (32-byte header, FFS3 only). Attribute bits: 0x01 large file, 0x02 and 0x38 data alignment, 0x04 fixed, 0x40 data checksum. If 0x40 is clear the file checksum byte is the constant 0xAA. State is stored inverted when erase polarity is 1.

Checked against edk2 PiFirmwareFile.h: Size[3] is little endian and includes the header, IntegrityCheck.Header is an 8-bit checksum computed with State and the File byte zeroed, and IntegrityCheck.File is 0xAA when attribute 0x40 is clear (UEFITool also lists 0x5A for older volumes). Unverified: the claim above that State is stored inverted when the erase polarity is 1: edk2 headers do not say so in the lines read; UEFITool notes only that State bits other than the defined ones must equal the erase polarity (0x80 bit). Test on a dump whose volume attributes have 0x800 set.

File types

0x01 RAW, 0x02 FREEFORM, 0x03 SECURITY_CORE, 0x04 PEI_CORE, 0x05 DXE_CORE, 0x06 PEIM, 0x07 DRIVER, 0x08 COMBINED_PEIM_DRIVER, 0x09 APPLICATION, 0x0A MM (SMM), 0x0B FIRMWARE_VOLUME_IMAGE (nested FV), 0x0C COMBINED_MM_DXE, 0x0D MM_CORE, 0x0E MM_STANDALONE, 0x0F MM_CORE_STANDALONE, 0xC0-0xDF OEM, 0xE0-0xEF debug, 0xF0 FFS_PAD (padding).

Sections

Section header: Size[3] (includes header) and Type (1); Size 0xFFFFFF means a u32 ExtendedSize follows. Sections are 4-byte aligned in the file.

Type Meaning
0x01 COMPRESSION: UncompressedLength u32, CompressionType u8 (0 none, 1 EFI/Tiano standard compression), then nested sections
0x02 GUID_DEFINED: SectionDefinitionGuid, DataOffset u16, Attributes u16 (PROCESSING_REQUIRED 0x01, AUTH_STATUS_VALID 0x02); used for LZMA-compressed or signed data
0x03 DISPOSABLE
0x10 PE32 image, 0x11 PIC, 0x12 TE (Format:TE image)
0x13 DXE_DEPEX, 0x1B PEI_DEPEX, 0x1C MM_DEPEX (dependency expression opcodes)
0x14 VERSION (build number u16 + UCS-2 string)
0x15 USER_INTERFACE (UCS-2 file name; the readable module name)
0x16 COMPATIBILITY16
0x17 FIRMWARE_VOLUME_IMAGE (nested FV)
0x18 FREEFORM_SUBTYPE_GUID, 0x19 RAW

Details with source lines (edk2 and UEFITool, see the Facts attached to this page): the GUID-defined section carries SectionDefinitionGuid, DataOffset (from the section start) and Attributes; the payload of an LZMA section starts at DataOffset and decodes to a series of sections. A Brotli section payload begins with two u64 values (decompressed size, scratch buffer size) in UEFITool's definition. A compression section (0x01) is 9 bytes of header: UncompressedLength u32 and CompressionType (0 none, 1 Tiano/EFI standard; UEFITool also names 2 and 0x86).

Unverified: sections inside a file start at 4-byte aligned offsets relative to the file data; the headers read do not state it. Test by walking a real file with the section sizes.

Analyst workflow

  1. Search the dump for _FVH, validate the header checksum and FvLength.
  2. Walk files; the UI section gives the module name, the PE32 or TE section the code to load in a disassembler (x86-64 or AArch64 PE; PEI modules are often TE).
  3. Decompress compression and GUID-defined sections (the LZMA GUID EE4E5898-3914-4259-9D6E-DC7BD79403CF is defined in edk2 MdeModulePkg/Include/Guid/LzmaDecompress.h; Brotli is 3D532050-5CDA-4FD0-879E-0F7F630D5AFB per UEFITool; see the identification fact on GUID-defined section GUIDs); nested FVs repeat the process.
  4. Tools: LongSoft UEFITool (parse/extract, BSD-2-Clause), UEFIExtract, edk2 GenFv/GenFfs tools.

Sources: edk2 MdePkg/Include/Pi/PiFirmwareVolume.h and PiFirmwareFile.h.

Code & repositories

  • https://github.com/tianocore/edk2 @ c1415771ac592ad8509351c46cd3cda4f38d7d52 · license: BSD-2-Clause (read from License-History.txt; GitHub's detector did not classify it)
    EDK2 reference headers for PI firmware volumes, FFS, sections, TE and capsules (MdePkg/Include/Pi, Uefi, IndustryStandard/PeImage.h)
    Tested on: source read, not run: source read · checked 2026-10-18; last activity 2026-10-16
  • https://github.com/LongSoft/UEFITool @ dac91b26733ca21cb204e41614c1b8c81cc50860 · license: BSD-2-Clause
    UEFITool/UEFIExtract: parser and editor for UEFI firmware images (listed as a lead, not read) UEFITool/UEFIExtract; common/ffs.h and descriptor.h read for FFS, section, GUID and capsule constants
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-07-29; Note: the latest release ships binaries; the wiki links only the source, never the binaries