Versions in this module Expand all Collapse all v1 v1.0.0 Aug 16, 2018 Changes in this version + const EmptyBodyChecksum + const FileHeaderExtMinLength + const FileHeaderMinLength + const FirmwareVolumeExtHeaderMinSize + const FirmwareVolumeFixedHeaderSize + const FirmwareVolumeMinSize + const FlashDescriptorLength + const FlashDescriptorMapMaxBase + const FlashDescriptorMapSize + const FlashMasterSectionSize + const FlashParamsSize + const FlashRegionSectionSize + const FlashSignatureLength + const RegionBlockSize + const SectionMinLength + var AppleBoot *uuid.UUID + var EVSA *uuid.UUID + var EVSA2 *uuid.UUID + var FFGUID = uuid.MustParse("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF") + var FFS1 *uuid.UUID + var FFS2 *uuid.UUID + var FFS3 *uuid.UUID + var FVGUIDs map[uuid.UUID]string + var FlashFrequencyStringMap = map[FlashFrequency]string + var FlashSignature = []byte + var NVAR *uuid.UUID + var PFH1 *uuid.UUID + var PFH2 *uuid.UUID + var ZeroGUID = uuid.MustParse("00000000-0000-0000-0000-000000000000") + func Align(val uint64, base uint64) uint64 + func Align4(val uint64) uint64 + func Align8(val uint64) uint64 + func Checksum16(buf []byte) (uint16, error) + func Checksum8(buf []byte) uint8 + func ExtractBinary(buf []byte, dirPath string, filename string) (string, error) + func FindFirmwareVolumeOffset(data []byte) int64 + func FindSignature(buf []byte) (int, error) + func MarshalFirmware(f Firmware) ([]byte, error) + func Read3Size(size [3]uint8) uint64 + func Write3Size(size uint64) [3]uint8 + type BIOSRegion struct + ExtractPath string + FirmwareVolumes []*FirmwareVolume + Position *Region + func NewBIOSRegion(buf []byte, r *Region) (*BIOSRegion, error) + func (br *BIOSRegion) Assemble() ([]byte, error) + func (br *BIOSRegion) Extract(parentPath string) error + func (br *BIOSRegion) Validate() []error + type Block struct + Count uint32 + Size uint32 + type FVFileType uint8 + type File struct + DataOffset uint64 + ExtractPath string + Header FileHeaderExtended + Sections []*Section + func CreatePadFile(size uint64) (*File, error) + func NewFile(buf []byte) (*File, error) + func (f *File) Assemble() ([]byte, error) + func (f *File) Extract(parentPath string) error + func (f *File) HeaderLen() uint64 + func (f *File) Validate() []error + type FileHeader struct + Attributes fileAttr + Checksum IntegrityCheck + Size [3]uint8 + State uint8 + Type FVFileType + UUID uuid.UUID + type FileHeaderExtended struct + ExtendedSize uint64 + type Firmware interface + Assemble func() ([]byte, error) + Extract func(dirpath string) error + Validate func() []error + func Parse(buf []byte) (Firmware, error) + func UnmarshalFirmware(b []byte) (Firmware, error) + type FirmwareVolume struct + Blocks []Block + DataOffset uint64 + ExtractPath string + FVOffset uint64 + Files []*File + func NewFirmwareVolume(data []byte, fvOffset uint64) (*FirmwareVolume, error) + func (fv *FirmwareVolume) Assemble() ([]byte, error) + func (fv *FirmwareVolume) Extract(parentPath string) error + func (fv *FirmwareVolume) GetErasePolarity() uint8 + func (fv *FirmwareVolume) Validate() []error + type FirmwareVolumeExtHeader struct + ExtHeaderSize uint32 + FVName uuid.UUID + type FirmwareVolumeFixedHeader struct + Attributes uint32 + Checksum uint16 + ExtHeaderOffset uint16 + FileSystemGUID uuid.UUID + HeaderLen uint16 + Length uint64 + Reserved uint8 + Revision uint8 + Signature uint32 + type FlashDescriptor struct + DescriptorMap *FlashDescriptorMap + DescriptorMapStart uint + ExtractPath string + Master *FlashMasterSection + MasterStart uint + Region *FlashRegionSection + RegionStart uint + func (fd *FlashDescriptor) Assemble() ([]byte, error) + func (fd *FlashDescriptor) Extract(parentPath string) error + func (fd *FlashDescriptor) ParseFlashDescriptor() error + func (fd *FlashDescriptor) Validate() []error + type FlashDescriptorMap struct + ComponentBase uint8 + DmiTableBase uint8 + IccTableBase uint8 + MasterBase uint8 + NumberOfDmiTableEntries uint8 + NumberOfFlashChips uint8 + NumberOfIccTableEntries uint8 + NumberOfMasters uint8 + NumberOfPchStraps uint8 + NumberOfProcStraps uint8 + NumberOfRegions uint8 + PchStrapsBase uint8 + ProcStrapsBase uint8 + RegionBase uint8 + Reserved0 uint8 + Reserved1 uint8 + func NewFlashDescriptorMap(buf []byte) (*FlashDescriptorMap, error) + func (d *FlashDescriptorMap) String() string + func (d *FlashDescriptorMap) Validate() []error + type FlashFrequency uint + const Freq17MHz + const Freq20MHz + const Freq33MHz + const Freq48MHz + const Freq50MHz30MHz + type FlashImage struct + BIOS *BIOSRegion + ExtractPath string + GBE *GBERegion + IFD FlashDescriptor + ME *MERegion + PD *PDRegion + func NewFlashImage(buf []byte) (*FlashImage, error) + func (f *FlashImage) Assemble() ([]byte, error) + func (f *FlashImage) Extract(dirPath string) error + func (f *FlashImage) FindSignature() (int, error) + func (f *FlashImage) IsPCH() bool + func (f *FlashImage) String() string + func (f *FlashImage) Validate() []error + type FlashMasterSection struct + BIOS RegionPermissions + GBE RegionPermissions + ME RegionPermissions + func NewFlashMasterSection(buf []byte) (*FlashMasterSection, error) + func (m *FlashMasterSection) String() string + type FlashParams [4]byte + func NewFlashParams(buf []byte) (*FlashParams, error) + func (p *FlashParams) DualOutputFastReadSupported() uint + func (p *FlashParams) FastReadEnabled() uint + func (p *FlashParams) FastReadFrequency() FlashFrequency + func (p *FlashParams) FirstChipDensity() uint + func (p *FlashParams) FlashReadStatusFrequency() FlashFrequency + func (p *FlashParams) FlashWriteFrequency() FlashFrequency + func (p *FlashParams) ReadClockFrequency() FlashFrequency + func (p *FlashParams) SecondChipDensity() uint + func (p *FlashParams) String() string + type FlashRegionSection struct + BIOS Region + FlashBlockEraseSize uint16 + GBE Region + ME Region + PD Region + func NewFlashRegionSection(data []byte) (*FlashRegionSection, error) + func (f *FlashRegionSection) String() string + func (f *FlashRegionSection) ValidRegions() []string + type GBERegion struct + ExtractPath string + Position *Region + func NewGBERegion(buf []byte, r *Region) (*GBERegion, error) + func (gbe *GBERegion) Assemble() ([]byte, error) + func (gbe *GBERegion) Extract(parentPath string) error + func (gbe *GBERegion) Validate() []error + type GUIDEDSectionAttribute uint16 + const GUIDEDSectionAuthStatusValid + const GUIDEDSectionProcessingRequired + type IntegrityCheck struct + File uint8 + Header uint8 + type MERegion struct + ExtractPath string + Position *Region + func NewMERegion(buf []byte, r *Region) (*MERegion, error) + func (me *MERegion) Assemble() ([]byte, error) + func (me *MERegion) Extract(parentPath string) error + func (me *MERegion) Validate() []error + type PDRegion struct + ExtractPath string + Position *Region + func NewPDRegion(buf []byte, r *Region) (*PDRegion, error) + func (pd *PDRegion) Assemble() ([]byte, error) + func (pd *PDRegion) Extract(parentPath string) error + func (pd *PDRegion) Validate() []error + type ROMAttributes struct + ErasePolarity byte + var Attributes ROMAttributes + type Region struct + Base uint16 + Limit uint16 + func (r *Region) BaseOffset() uint32 + func (r *Region) EndOffset() uint32 + func (r *Region) String() string + func (r *Region) Valid() bool + type RegionPermissions struct + ID uint16 + Read uint8 + Write uint8 + func (r *RegionPermissions) String() string + type Section struct + Encapsulated *TypedFirmware + ExtractPath string + Header SectionExtHeader + Name string + Type string + TypeSpecific interface{} + func NewSection(buf []byte, fileOrder int) (*Section, error) + func (s *Section) Assemble() ([]byte, error) + func (s *Section) Extract(parentPath string) error + func (s *Section) Validate() []error + type SectionExtHeader struct + ExtendedSize uint32 + type SectionGUIDDefined struct + Attributes uint16 + DataOffset uint16 + GUID uuid.UUID + type SectionHeader struct + Size [3]uint8 + Type SectionType + type SectionType uint8 + const SectionMMDepEx + const SectionTypeAll + const SectionTypeCompatibility16 + const SectionTypeCompression + const SectionTypeDXEDepEx + const SectionTypeDisposable + const SectionTypeFirmwareVolumeImage + const SectionTypeFreeformSubtypeGUID + const SectionTypeGUIDDefined + const SectionTypePE32 + const SectionTypePEIDepEx + const SectionTypePIC + const SectionTypeRaw + const SectionTypeTE + const SectionTypeUserInterface + const SectionTypeVersion + type TypedFirmware struct + Type string + Value Firmware + func (f TypedFirmware) UnmarshalJSON(b []byte) error