util

package
v0.0.0-...-48be911 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const SizeofEFIGUID uint32 = 16
View Source
const SizeofEFITime = 2 + 6 + 4 + 2 + 2

Variables

View Source
var (
	EFI_TIME_ADJUST_DAYLIGHT uint8  = 0x01
	EFI_TIME_IN_DAYLIGHT     uint8  = 0x02
	EFI_UNSPECIFIED_TIMEZONE uint16 = 0x07FF
)

Functions

func CmpEFIGUID

func CmpEFIGUID(cmp1 EFIGUID, cmp2 EFIGUID) bool

Compare two EFIGUID structs

func GUIDToBytes

func GUIDToBytes(g *EFIGUID) []byte

Convert an EFIGUID to a byte slice

func ParseUtf16Var

func ParseUtf16Var(data *bytes.Buffer) (string, error)

Parse an efivar as a UTF-16 string.

func ReadCert

func ReadCert(b []byte) (*x509.Certificate, error)

func ReadCertFromFile

func ReadCertFromFile(path string) (*x509.Certificate, error)

func ReadKey

func ReadKey(b []byte) (*rsa.PrivateKey, error)

func ReadKeyFromFile

func ReadKeyFromFile(path string) (*rsa.PrivateKey, error)

func ReadNullString

func ReadNullString(f io.Reader) []byte

Read a null terminated string

func WriteGUID

func WriteGUID(b *bytes.Buffer, g *EFIGUID)

Write an EFIGUID to a bytes.Buffer

Types

type EFIGUID

type EFIGUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]uint8
}

func BytesToGUID

func BytesToGUID(s []byte) *EFIGUID

Convert a byte slice to an EFIGUID

func StringToGUID

func StringToGUID(s string) *EFIGUID

Convert a string to an EFIGUID

func (*EFIGUID) Bytes

func (e *EFIGUID) Bytes() []byte

func (*EFIGUID) Format

func (e *EFIGUID) Format() string

Pretty print an EFIGUID struct

type EFITImeCapabilitie

type EFITImeCapabilitie struct {
	Resolution uint32
	Accuracy   uint32
	SetsToZero bool
}

type EFITime

type EFITime struct {
	Year       uint16 // 1900 - 9999 AKA Y99K y'all
	Month      uint8  // 1-12
	Day        uint8  // 1 -31
	Hour       uint8  // 0 - 23
	Minute     uint8  // 0 - 59
	Second     uint8  // 0 - 59
	Pad1       uint8
	Nanosecond uint32 // 0 - 999,999,999
	TimeZone   int16  // -1440 to 1440 or 2047
	Daylight   uint8
	Pad2       uint8
}

func NewEFITime

func NewEFITime() *EFITime

func (*EFITime) Format

func (e *EFITime) Format() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL