Documentation ¶
Overview ¶
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 ¶
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.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { FileHeader Streams []*Stream // contains filtered or unexported fields }
File represents a file or directory in a WIM image.
func (*File) Open ¶
func (f *File) Open() (io.ReadCloser, error)
Open returns an io.ReadCloser that can be used to read the file's contents.
type FileHeader ¶
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 ¶
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 ¶
Filetime represents a Windows time.
type Image ¶
type Image struct { ImageInfo // contains filtered or unexported fields }
Image represents an image within a WIM file.
type ImageInfo ¶
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 ¶
ParseError is returned when the WIM cannot be parsed.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Reader ¶
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 ¶
NewReader returns a Reader that can be used to read WIM file data.
type Stream ¶
type Stream struct { StreamHeader // contains filtered or unexported fields }
Stream represents an alternate data stream or reparse point data stream.
func (*Stream) Open ¶
func (s *Stream) Open() (io.ReadCloser, error)
Open returns an io.ReadCloser that can be used to read the stream's contents.
type StreamHeader ¶
StreamHeader contains alternate data stream metadata.
type Version ¶
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 ¶
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.