Skip to content

Pi firmware file

pi_firmware_file

Module containing helper classes and functions for working with UEFI FFs.

EfiFirmwareFileSystemHeader

An object representing an EFI_FFS_FILE_HEADER.

Can parse or produce an EFI_FFS_FILE_HEADER structure/byte buffer.

typedef struct {
    EFI_GUID                Name;
    EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
    EFI_FV_FILETYPE         Type;
    EFI_FFS_FILE_ATTRIBUTES Attributes;
    UINT8                   Size[3];
    EFI_FFS_FILE_STATE      State;
} EFI_FFS_FILE_HEADER;

__init__

__init__() -> EfiFirmwareFileSystemHeader

Inits an empty object.

get_size

get_size() -> int

Returns the size of the header.

load_from_file

load_from_file(file: IO) -> EfiFirmwareFileSystemHeader

Loads data into the object from a filestream.

Parameters:

Name Type Description Default
file obj

An open file that has been seeked to the correct location.

required

Returns:

Type Description
EfiFirmwareFileSystemHeader

self

serialize

serialize() -> bytes

Serializes the object.

Returns:

Type Description
bytes

string representing packed data as bytes (i.e. b'\x01\x00\x03')