func (fd *FlashDescriptor) Apply(v Visitor) error {
	return v.Visit(fd)
}
Apply calls the visitor on the FlashDescriptor.
package uefi
import (
	"bytes"
	"encoding/hex"
	"fmt"
	"sort"
)
var (
	FlashSignature = []byte{0x5a, 0xa5, 0xf0, 0x0f}
)
const (
	FlashDescriptorLength = 0x1000
)
type FlashDescriptor struct {
	buf                []byte
	DescriptorMapStart uint
	RegionStart        uint
	MasterStart        uint
	DescriptorMap      *FlashDescriptorMap
	Region             *FlashRegionSection
	Master             *FlashMasterSection
	ExtractPath string
}
func FindSignature(buf []byte) (int, error) {
	if bytes.Equal(buf[16:16+len(FlashSignature)], FlashSignature) {
		return 20, nil
	}
	if bytes.Equal(buf[:len(FlashSignature)], FlashSignature) {
		return len(FlashSignature), nil
	}
	return -1, fmt.Errorf("flash signature not found: first 20 bytes are:\n%s",
		hex.Dump(buf[:20]))
}
func (fd *FlashDescriptor) Buf() []byte {
	return fd.buf
}
func (fd *FlashDescriptor) SetBuf(buf []byte) {
	fd.buf = buf
}