Skip to content

Variable format

variable_format

Module contains helper classes and functions to work with UEFI Variables.

VariableStoreHeader

Object representing the VARIABLE_STORE_HEADER struct.

Can parse or produce an VARIABLE_STORE_HEADER structure/byte buffer.

typedef struct { EFI_GUID Signature; UINT32 Size; UINT8 Format; UINT8 State; UINT16 Reserved; UINT32 Reserved1; } VARIABLE_STORE_HEADER;

__init__

__init__() -> VariableStoreHeader

Init the empty structure.

load_from_file

load_from_file(file: str) -> VariableStoreHeader

Load the structure from a file.

serialize

serialize() -> bytes

Serialize the structure.

VariableHeader

Object representing the VARIABLE_HEADER struct.

Can parse or produce an VARIABLE_HEADER structure/byte buffer.

typedef struct { UINT16 StartId; UINT8 State; UINT8 Reserved; UINT32 Attributes; UINT32 NameSize; UINT32 DataSize; EFI_GUID VendorGuid; } VARIABLE_HEADER;

__init__

__init__() -> VariableHeader

Init the structure.

populate_structure_fields

populate_structure_fields(in_bytes: bytes) -> None

Populate the structure field from bytes.

load_from_bytes

load_from_bytes(in_bytes: bytes) -> VariableHeader

Load the structure from a bytes.

load_from_file

load_from_file(file: str) -> VariableHeader

Load the struct from a file.

get_buffer_data_size

get_buffer_data_size() -> int

Get the buffer data size.

get_buffer_padding_size

get_buffer_padding_size() -> int

Get the buffer padding size.

get_buffer_size

get_buffer_size() -> int

Get the buffer size.

get_packed_name

get_packed_name() -> bytes

Get the name attribute.

set_name

set_name(new_name: str) -> None

Set the name attribute.

set_data

set_data(new_data: bytes) -> None

Set the data attribute.

pack_struct

pack_struct() -> bytes

Pack the object.

serialize

serialize(with_padding: bool = False) -> bytes

Serialize the object.

AuthenticatedVariableHeader

Object representing the AUTHENTICATED_VARIABLE_HEADER struct.

Can parse or produce an AUTHENTICATED_VARIABLE_HEADER structure/byte buffer.

typedef struct { UINT16 StartId; UINT8 State; UINT8 Reserved; UINT32 Attributes; UINT64 MonotonicCount; EFI_TIME TimeStamp; UINT32 PubKeyIndex; UINT32 NameSize; UINT32 DataSize; EFI_GUID VendorGuid; } AUTHENTICATED_VARIABLE_HEADER;

__init__

__init__() -> AuthenticatedVariableHeader

Initializes the struct.

populate_structure_fields

populate_structure_fields(in_bytes: bytes) -> None

Populates the struct.

pack_struct

pack_struct(with_padding: bool = False) -> bytes

Packs the struct.