go-winio: github.com/microsoft/go-winio/wim Index | Files | Directories

package wim

import "github.com/microsoft/go-winio/wim"

Package wim implements a WIM file parser.

WIM files are used to distribute Windows file system and container images. They are documented at https://msdn.microsoft.com/en-us/library/windows/desktop/dd861280.aspx.

Index

Package Files

decompress.go wim.go

Constants

const (
    FILE_ATTRIBUTE_READONLY            = 0x00000001
    FILE_ATTRIBUTE_HIDDEN              = 0x00000002
    FILE_ATTRIBUTE_SYSTEM              = 0x00000004
    FILE_ATTRIBUTE_DIRECTORY           = 0x00000010
    FILE_ATTRIBUTE_ARCHIVE             = 0x00000020
    FILE_ATTRIBUTE_DEVICE              = 0x00000040
    FILE_ATTRIBUTE_NORMAL              = 0x00000080
    FILE_ATTRIBUTE_TEMPORARY           = 0x00000100
    FILE_ATTRIBUTE_SPARSE_FILE         = 0x00000200
    FILE_ATTRIBUTE_REPARSE_POINT       = 0x00000400
    FILE_ATTRIBUTE_COMPRESSED          = 0x00000800
    FILE_ATTRIBUTE_OFFLINE             = 0x00001000
    FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000
    FILE_ATTRIBUTE_ENCRYPTED           = 0x00004000
    FILE_ATTRIBUTE_INTEGRITY_STREAM    = 0x00008000
    FILE_ATTRIBUTE_VIRTUAL             = 0x00010000
    FILE_ATTRIBUTE_NO_SCRUB_DATA       = 0x00020000
    FILE_ATTRIBUTE_EA                  = 0x00040000
)

File attribute constants from Windows.

const (
    PROCESSOR_ARCHITECTURE_INTEL         = 0
    PROCESSOR_ARCHITECTURE_MIPS          = 1
    PROCESSOR_ARCHITECTURE_ALPHA         = 2
    PROCESSOR_ARCHITECTURE_PPC           = 3
    PROCESSOR_ARCHITECTURE_SHX           = 4
    PROCESSOR_ARCHITECTURE_ARM           = 5
    PROCESSOR_ARCHITECTURE_IA64          = 6
    PROCESSOR_ARCHITECTURE_ALPHA64       = 7
    PROCESSOR_ARCHITECTURE_MSIL          = 8
    PROCESSOR_ARCHITECTURE_AMD64         = 9
    PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10
    PROCESSOR_ARCHITECTURE_NEUTRAL       = 11
    PROCESSOR_ARCHITECTURE_ARM64         = 12
)

Windows processor architectures.

type File Uses

type File struct {
    FileHeader
    Streams []*Stream
    // contains filtered or unexported fields
}

File represents a file or directory in a WIM image.

func (*File) Open Uses

func (f *File) Open() (io.ReadCloser, error)

Open returns an io.ReadCloser that can be used to read the file's contents.

func (*File) Readdir Uses

func (f *File) Readdir() ([]*File, error)

Readdir reads the directory entries.

type FileHeader Uses

type FileHeader struct {
    Name               string
    ShortName          string
    Attributes         uint32
    SecurityDescriptor []byte
    CreationTime       Filetime
    LastAccessTime     Filetime
    LastWriteTime      Filetime
    Hash               SHA1Hash
    Size               int64
    LinkID             int64
    ReparseTag         uint32
    ReparseReserved    uint32
}

FileHeader contains file metadata.

func (*FileHeader) IsDir Uses

func (f *FileHeader) IsDir() bool

IsDir returns whether the given file is a directory. It returns false when it is a directory reparse point.

type Filetime Uses

type Filetime struct {
    LowDateTime  uint32
    HighDateTime uint32
}

Filetime represents a Windows time.

func (*Filetime) Time Uses

func (ft *Filetime) Time() time.Time

Time returns the time as time.Time.

func (*Filetime) UnmarshalXML Uses

func (ft *Filetime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals the time from a WIM XML blob.

type Image Uses

type Image struct {
    ImageInfo
    // contains filtered or unexported fields
}

Image represents an image within a WIM file.

func (*Image) Open Uses

func (img *Image) Open() (*File, error)

Open parses the image and returns the root directory.

type ImageInfo Uses

type ImageInfo struct {
    Name         string       `xml:"NAME"`
    Index        int          `xml:"INDEX,attr"`
    CreationTime Filetime     `xml:"CREATIONTIME"`
    ModTime      Filetime     `xml:"LASTMODIFICATIONTIME"`
    Windows      *WindowsInfo `xml:"WINDOWS"`
}

ImageInfo contains information about the image.

type ParseError Uses

type ParseError struct {
    Oper string
    Path string
    Err  error
}

ParseError is returned when the WIM cannot be parsed.

func (*ParseError) Error Uses

func (e *ParseError) Error() string

type Reader Uses

type Reader struct {
    XMLInfo string   // The XML information about the WIM.
    Image   []*Image // The WIM's images.
    // contains filtered or unexported fields
}

Reader provides functions to read a WIM file.

func NewReader Uses

func NewReader(f io.ReaderAt) (*Reader, error)

NewReader returns a Reader that can be used to read WIM file data.

func (*Reader) Close Uses

func (r *Reader) Close() error

Close releases resources associated with the Reader.

type SHA1Hash Uses

type SHA1Hash [20]byte

SHA1Hash contains the SHA1 hash of a file or stream.

type Stream Uses

type Stream struct {
    StreamHeader
    // contains filtered or unexported fields
}

Stream represents an alternate data stream or reparse point data stream.

func (*Stream) Open Uses

func (s *Stream) Open() (io.ReadCloser, error)

Open returns an io.ReadCloser that can be used to read the stream's contents.

type StreamHeader Uses

type StreamHeader struct {
    Name string
    Hash SHA1Hash
    Size int64
}

StreamHeader contains alternate data stream metadata.

type Version Uses

type Version struct {
    Major   int `xml:"MAJOR"`
    Minor   int `xml:"MINOR"`
    Build   int `xml:"BUILD"`
    SPBuild int `xml:"SPBUILD"`
    SPLevel int `xml:"SPLEVEL"`
}

Version represents a Windows build version.

type WindowsInfo Uses

type WindowsInfo struct {
    Arch             byte     `xml:"ARCH"`
    ProductName      string   `xml:"PRODUCTNAME"`
    EditionID        string   `xml:"EDITIONID"`
    InstallationType string   `xml:"INSTALLATIONTYPE"`
    ProductType      string   `xml:"PRODUCTTYPE"`
    Languages        []string `xml:"LANGUAGES>LANGUAGE"`
    DefaultLanguage  string   `xml:"LANGUAGES>DEFAULT"`
    Version          Version  `xml:"VERSION"`
    SystemRoot       string   `xml:"SYSTEMROOT"`
}

WindowsInfo contains information about the Windows installation in the image.

Directories

PathSynopsis
lzxPackage lzx implements a decompressor for the the WIM variant of the LZX compression algorithm.
validate

Package wim imports 13 packages (graph). Updated 2019-05-08. Refresh now. Tools for package owners.