Documentation ¶
Index ¶
Constants ¶
View Source
const ( SECTOR_SIZE = 512 COWD_MAGIC = "COWD" VMDK_MAGIC = "KDMV" SESPARSE_MAGIC = "\xbe\xba\xfe\xca" CONFIG_FILE_MAGIC = "# Di" SPARSEFLAG_COMPRESSED = 0x10000 SPARSEFLAG_EMBEDDED_LBA = 0x20000 SESPARSE_GRAIN_TYPE_MASK = 0xF000000000000000 SESPARSE_GRAIN_TYPE_UNALLOCATED = 0x0000000000000000 SESPARSE_GRAIN_TYPE_FALLTHROUGH = 0x1000000000000000 SESPARSE_GRAIN_TYPE_ZERO = 0x2000000000000000 SESPARSE_GRAIN_TYPE_ALLOCATED = 0x3000000000000000 )
Variables ¶
View Source
var ErrFileAccessorNotAvailable = errors.New("file accessor needed to access for parent and extents from file")
Functions ¶
This section is empty.
Types ¶
type COWDSparseExtentHeader ¶
type COWDSparseExtentHeader struct { Magic [4]byte Version uint32 Flags uint32 Capacity uint32 GrainSize uint32 PrimaryGrainDirectoryOffset uint32 NumGrainDirectoryEntries uint32 NextFreeGrain uint32 }
COWDSparseExtentHeader struct
func (*COWDSparseExtentHeader) GetCapacity ¶
func (r *COWDSparseExtentHeader) GetCapacity() uint64
func (*COWDSparseExtentHeader) GetGrainSize ¶
func (r *COWDSparseExtentHeader) GetGrainSize() uint64
func (*COWDSparseExtentHeader) GrainOffset ¶
func (r *COWDSparseExtentHeader) GrainOffset() uint64
func (*COWDSparseExtentHeader) IsCompressed ¶
func (r *COWDSparseExtentHeader) IsCompressed() bool
func (*COWDSparseExtentHeader) IsEmeddedLBA ¶
func (r *COWDSparseExtentHeader) IsEmeddedLBA() bool
type DiskDescriptor ¶
type DiskDescriptor struct { Attr map[string]string Extents []DiskExtent Ddb map[string]string Sectors int64 Raw string }
func ParseDiskDescriptor ¶
func ParseDiskDescriptor(data string) (*DiskDescriptor, error)
type DiskExtent ¶
type FileAccessorFn ¶
type FileAccessorFn func(string) (io.ReadSeeker, error)
var FileAccessor FileAccessorFn
type RawDisk ¶
type RawDisk struct {
// contains filtered or unexported fields
}
func NewRawDisk ¶
func NewRawDisk(fh io.ReadSeeker, size int64) (*RawDisk, error)
func (*RawDisk) GetSectorCount ¶
func (*RawDisk) GetSectorOffset ¶
func (*RawDisk) ReadSectors ¶
type RawSparseExtentHeader ¶
type SparseDisk ¶
type SparseDisk struct {
// contains filtered or unexported fields
}
func NewSparseDisk ¶
func NewSparseDisk(fh io.ReadSeeker, parent *VMDK) (*SparseDisk, error)
func (*SparseDisk) GetSectorCount ¶
func (rd *SparseDisk) GetSectorCount() int64
func (*SparseDisk) GetSectorOffset ¶
func (rd *SparseDisk) GetSectorOffset() int64
func (*SparseDisk) GetSize ¶
func (rd *SparseDisk) GetSize() int64
func (*SparseDisk) ReadSectors ¶
func (sd *SparseDisk) ReadSectors(sector int64, count int) ([]byte, error)
readSectors method for SparseDisk
func (*SparseDisk) SetOffset ¶
func (rd *SparseDisk) SetOffset(offset, sectorOffset int64)
type SparseExtentHeader ¶
type SparseExtentHeader struct { Magic string Flags uint64 Raw RawSparseExtentHeader }
func ParseSparseExtentHeader ¶
func ParseSparseExtentHeader(fh io.ReadSeeker) (*SparseExtentHeader, error)
ParseSparseExtentHeader function
func (*SparseExtentHeader) AsCOWD ¶
func (s *SparseExtentHeader) AsCOWD() (*COWDSparseExtentHeader, bool)
func (*SparseExtentHeader) AsVMDK ¶
func (s *SparseExtentHeader) AsVMDK() (*VMDKSparseExtentHeader, bool)
func (*SparseExtentHeader) AsVMDKSES ¶
func (s *SparseExtentHeader) AsVMDKSES() (*VMDKSESparseConstHeader, bool)
type SparseGrainLBAHeader ¶
type VMDK ¶
type VMDKSESparseConstHeader ¶
type VMDKSESparseConstHeader struct { Magic uint64 Version uint64 Capacity uint64 GrainSize uint64 GrainTableSize uint64 Flags uint64 Reserved1 uint64 Reserved2 uint64 Reserved3 uint64 Reserved4 uint64 VolatileHeaderOffset uint64 VolatileHeaderSize uint64 JournalHeaderOffset uint64 JournalHeaderSize uint64 JournalOffset uint64 JournalSize uint64 GrainDirectoryOffset uint64 GrainDirectorySize uint64 GrainTablesOffset uint64 GrainTablesSize uint64 FreeBitmapOffset uint64 FreeBitmapSize uint64 BackmapOffset uint64 BackmapSize uint64 GrainsOffset uint64 GrainsSize uint64 Pad [304]byte }
VMDKSESparseConstHeader struct
func (*VMDKSESparseConstHeader) GetCapacity ¶
func (r *VMDKSESparseConstHeader) GetCapacity() uint64
func (*VMDKSESparseConstHeader) GetGrainSize ¶
func (r *VMDKSESparseConstHeader) GetGrainSize() uint64
func (*VMDKSESparseConstHeader) GrainOffset ¶
func (r *VMDKSESparseConstHeader) GrainOffset() uint64
func (*VMDKSESparseConstHeader) IsCompressed ¶
func (r *VMDKSESparseConstHeader) IsCompressed() bool
func (*VMDKSESparseConstHeader) IsEmeddedLBA ¶
func (r *VMDKSESparseConstHeader) IsEmeddedLBA() bool
type VMDKSparseExtentHeader ¶
type VMDKSparseExtentHeader struct { Magic [4]byte Version uint32 Flags uint32 Capacity uint64 GrainSize uint64 DescriptorOffset uint64 DescriptorSize uint64 NumGrainTableEntries uint32 SecondaryGrainDirectoryOffset uint64 PrimaryGrainDirectoryOffset uint64 Overhead uint64 IsDirty uint8 SingleEndLineChar byte NonEndLineChar byte DoubleEndLineChars [2]byte CompressAlgorithm uint16 Pad [433]byte }
VMDKSparseExtentHeader struct
func (*VMDKSparseExtentHeader) GetCapacity ¶
func (r *VMDKSparseExtentHeader) GetCapacity() uint64
func (*VMDKSparseExtentHeader) GetGrainSize ¶
func (r *VMDKSparseExtentHeader) GetGrainSize() uint64
func (*VMDKSparseExtentHeader) GrainOffset ¶
func (r *VMDKSparseExtentHeader) GrainOffset() uint64
func (*VMDKSparseExtentHeader) IsCompressed ¶
func (r *VMDKSparseExtentHeader) IsCompressed() bool
func (*VMDKSparseExtentHeader) IsEmeddedLBA ¶
func (r *VMDKSparseExtentHeader) IsEmeddedLBA() bool
Click to show internal directories.
Click to hide internal directories.