Versions in this module Expand all Collapse all v1 v1.2.0 May 11, 2023 Changes in this version + var CbfsHeaderMagicNotFound = errors.New("CBFS header magic doesn't match") type File + func NewFile(r io.ReadSeeker) (*File, error) + func (f *File) Compression() Compression + func (f *File) Decompress() ([]byte, error) + func (f *File) FindAttribute(t Tag) ([]byte, error) type ReadWriter + func NewUnknownRecord(f *File) (ReadWriter, error) + type UnknownRecord struct + func (r *UnknownRecord) GetFile() *File + func (r *UnknownRecord) Read(in io.ReadSeeker) error + func (r *UnknownRecord) String() string + func (r *UnknownRecord) Write(w io.Writer) error v1.1.3 Sep 23, 2022 v1.1.2 May 13, 2022 v1.1.1 May 12, 2022 v1.1.0 Mar 22, 2022 Changes in this version + type BootSplashRecord struct + func (r *BootSplashRecord) GetFile() *File + func (r *BootSplashRecord) Read(in io.ReadSeeker) error + func (r *BootSplashRecord) String() string + func (r *BootSplashRecord) Write(w io.Writer) error + type CMOSRecord struct + func (r *CMOSRecord) GetFile() *File + func (r *CMOSRecord) Read(in io.ReadSeeker) error + func (r *CMOSRecord) String() string + func (r *CMOSRecord) Write(w io.Writer) error + type OptionROMRecord struct + func (r *OptionROMRecord) GetFile() *File + func (r *OptionROMRecord) Read(in io.ReadSeeker) error + func (r *OptionROMRecord) String() string + func (r *OptionROMRecord) Write(w io.Writer) error type ReadWriter + func NewBootSplash(f *File) (ReadWriter, error) + func NewCMOS(f *File) (ReadWriter, error) + func NewOptionROM(f *File) (ReadWriter, error) v1.0.5 Jan 18, 2022 v1.0.4 Dec 17, 2021 Changes in this version + const Alignment + const FileMagic + const FileSize + const HeaderMagic + const HeaderV1 + const HeaderV2 + const HeaderVersion + const MasterHeaderLen + var Debug = func(format string, v ...interface{}) + var Endian = binary.BigEndian + var ListOutput = ... + var Master = []byte + var SegReaders = make(map[FileType]*SegReader) + func Read(r io.Reader, f interface{}) error + func ReadAttributes(r io.Reader, f *File) error + func ReadData(r io.ReadSeeker, f *File) error + func ReadLE(r io.Reader, f interface{}) error + func ReadName(r io.Reader, f *File, size uint32) error + func RegisterFileReader(f *SegReader) error + func Write(w io.Writer, f interface{}) error + func WriteLE(r io.Writer, f interface{}) error + type Architecture uint32 + const ARM + const X86 + type BootBlockRecord struct + func (r *BootBlockRecord) GetFile() *File + func (r *BootBlockRecord) Read(in io.ReadSeeker) error + func (r *BootBlockRecord) String() string + func (r *BootBlockRecord) Write(w io.Writer) error + type CMOSLayoutRecord struct + func (r *CMOSLayoutRecord) GetFile() *File + func (r *CMOSLayoutRecord) Read(in io.ReadSeeker) error + func (r *CMOSLayoutRecord) String() string + func (r *CMOSLayoutRecord) Write(w io.Writer) error + type Compression uint32 + const LZ4 + const LZMA + const None + func (c Compression) String() string + type EmptyRecord struct + func (r *EmptyRecord) GetFile() *File + func (r *EmptyRecord) Read(in io.ReadSeeker) error + func (r *EmptyRecord) String() string + func (r *EmptyRecord) Write(w io.Writer) error + type FSPRecord struct + func (r *FSPRecord) GetFile() *File + func (r *FSPRecord) Read(in io.ReadSeeker) error + func (r *FSPRecord) String() string + func (r *FSPRecord) Write(w io.Writer) error + type File struct + Attr []byte + FData []byte + Name string + RecordStart uint32 + func (f *File) MarshalJSON() ([]byte, error) + type FileAttr struct + Data []byte + Size uint32 + Tag uint32 + type FileAttrAlign struct + Align uint32 + Size uint32 + Tag Tag + type FileAttrCompression struct + Compression Compression + DecompressedSize uint32 + Size uint32 + Tag Tag + type FileAttrHash struct + Data []byte + HashType uint32 + Size uint32 + Tag Tag + type FileAttrPos struct + Pos uint32 + Size uint32 + Tag Tag + type FileAttrStageHeader struct + EntryOffset uint32 + LoadAddress uint64 + MemSize uint32 + Size uint32 + Tag Tag + func (h *FileAttrStageHeader) String() string + type FileHeader struct + AttrOffset uint32 + Magic [8]byte + Size uint32 + SubHeaderOffset uint32 + Type FileType + func (h *FileHeader) Deleted() bool + type FileType uint32 + const TypeBootBlock + const TypeBootSplash + const TypeCMOS + const TypeCMOSLayout + const TypeDeleted + const TypeDeleted2 + const TypeEFI + const TypeFIT + const TypeFSP + const TypeLegacyStage + const TypeMBI + const TypeMMA + const TypeMRC + const TypeMRCCache + const TypeMaster + const TypeMicroCode + const TypeOptionRom + const TypeRaw + const TypeSELF + const TypeSPD + const TypeStage + const TypeStruct + const TypeVSA + func (f FileType) String() string + type Image struct + Area *fmap.Area + Data []byte + FMAP *fmap.FMap + FMAPMetadata *fmap.Metadata + Segs []ReadWriter + func NewImage(rs io.ReadSeeker) (*Image, error) + func Open(n string) (*Image, error) + func (i *Image) MarshalJSON() ([]byte, error) + func (i *Image) Remove(n string) error + func (i *Image) String() string + func (i *Image) Update() error + func (i *Image) WriteFile(name string, perm os.FileMode) error + type LegacyStageRecord struct + Data []byte + func (h *LegacyStageRecord) MarshalJSON() ([]byte, error) + func (h *LegacyStageRecord) String() string + func (r *LegacyStageRecord) GetFile() *File + func (r *LegacyStageRecord) Read(in io.ReadSeeker) error + func (r *LegacyStageRecord) Write(w io.Writer) error + type MasterHeader struct + Align uint32 + Architecture Architecture + BootBlockSize uint32 + Magic uint32 + Offset uint32 + RomSize uint32 + Version uint32 + type MasterRecord struct + func (r *MasterRecord) GetFile() *File + func (r *MasterRecord) Read(in io.ReadSeeker) error + func (r *MasterRecord) String() string + func (r *MasterRecord) Write(w io.Writer) error + type MicrocodeRecord struct + func (r *MicrocodeRecord) GetFile() *File + func (r *MicrocodeRecord) Read(in io.ReadSeeker) error + func (r *MicrocodeRecord) String() string + func (r *MicrocodeRecord) Write(w io.Writer) error + type OptionRom struct + Compression Compression + Size uint32 + type PayloadHeader struct + Compression Compression + LoadAddress uint64 + MemSize uint32 + Offset uint32 + Size uint32 + Type SegmentType + func (r *PayloadHeader) String() string + type PayloadRecord struct + Data []byte + Segs []PayloadHeader + func (h *PayloadRecord) String() string + func (p *PayloadRecord) Read(in io.ReadSeeker) error + func (r *PayloadRecord) GetFile() *File + func (r *PayloadRecord) Write(w io.Writer) error + type Props struct + Offset uint32 + Size uint32 + type RawRecord struct + func (r *RawRecord) GetFile() *File + func (r *RawRecord) Read(in io.ReadSeeker) error + func (r *RawRecord) String() string + func (r *RawRecord) Write(w io.Writer) error + type ReadWriter interface + GetFile func() *File + Read func(r io.ReadSeeker) error + String func() string + Write func(f io.Writer) error + func NewBootBlock(f *File) (ReadWriter, error) + func NewCMOSLayout(f *File) (ReadWriter, error) + func NewEmptyRecord(f *File) (ReadWriter, error) + func NewFSP(f *File) (ReadWriter, error) + func NewLegacyStageRecord(f *File) (ReadWriter, error) + func NewMaster(f *File) (ReadWriter, error) + func NewMicrocode(f *File) (ReadWriter, error) + func NewPayloadRecord(f *File) (ReadWriter, error) + func NewRaw(f *File) (ReadWriter, error) + func NewSPD(f *File) (ReadWriter, error) + func NewStageRecord(f *File) (ReadWriter, error) + type SPDRecord struct + func (r *SPDRecord) GetFile() *File + func (r *SPDRecord) Read(in io.ReadSeeker) error + func (r *SPDRecord) String() string + func (r *SPDRecord) Write(w io.Writer) error + type SegReader struct + Name string + New func(f *File) (ReadWriter, error) + Type FileType + type SegmentType uint32 + const SegBSS + const SegCode + const SegData + const SegEntry + const SegParams + func (s SegmentType) String() string + type StageHeader struct + Compression Compression + Entry uint64 + LoadAddress uint64 + MemSize uint32 + Size uint32 + func (h *StageHeader) String() string + type StageRecord struct + Data []byte + func (h *StageRecord) String() string + func (r *StageRecord) GetFile() *File + func (r *StageRecord) Read(in io.ReadSeeker) error + func (r *StageRecord) Write(w io.Writer) error + type Tag uint32 + const ALCB + const Compressed + const Hash + const PSCB + const SHCB + const Unused + const Unused2