Documentation
¶
Index ¶
- Constants
- Variables
- func DecryptDMGWithKey(path string, keyString string) (string, error)
- func DecryptDMGWithPassword(path string, password string) (string, error)
- type Config
- type DMG
- func (d *DMG) Close() error
- func (d *DMG) DecryptedTemp() string
- func (d *DMG) GetSize() uint64
- func (d *DMG) Load() error
- func (d *DMG) Partition(name string) (*Partition, error)
- func (d *DMG) ReadAt(buf []byte, off int64) (n int, err error)
- func (d *DMG) ReadFile(w *bufio.Writer, off, length int64) (err error)
- type EncryptionHeader
- type Partition
- type UDIFChecksum
- type UDIFResourceFile
Constants ¶
View Source
const ( NONE_TYPE udifChecksumType = 0 CRC32_TYPE udifChecksumType = 2 )
View Source
const ( Flattened udifResourceFileFlag = 0x00000001 InternetEnabled udifResourceFileFlag = 0x00000004 )
View Source
const ( ZERO_FILL udifBlockChunkType = 0x00000000 UNCOMPRESSED udifBlockChunkType = 0x00000001 IGNORED udifBlockChunkType = 0x00000002 // Sparse (used for Apple_Free) COMPRESS_ADC udifBlockChunkType = 0x80000004 COMPRESS_ZLIB udifBlockChunkType = 0x80000005 COMPRESSS_BZ2 udifBlockChunkType = 0x80000006 COMPRESSS_LZFSE udifBlockChunkType = 0x80000007 COMPRESSS_LZMA udifBlockChunkType = 0x80000008 COMMENT udifBlockChunkType = 0x7ffffffe LAST_BLOCK udifBlockChunkType = 0xffffffff )
View Source
const (
EncryptedMagic = "encrcdsa"
)
Variables ¶
View Source
var ErrEncrypted = errors.New("DMG is encrypted")
View Source
var ErrNotEncrypted = fmt.Errorf("not an encrypted DMG")
Functions ¶
func DecryptDMGWithKey ¶ added in v1.0.26
DecryptDMGWithKey decrypts a DMG file using a hex-encoded key string. The key string should be 72 characters: 32 for AES key (16 bytes) + 40 for HMAC key (20 bytes).
Types ¶
type DMG ¶
type DMG struct {
Plist resourceFork
Nsiz nsiz
Partitions []Partition
// contains filtered or unexported fields
}
DMG apple disk image object
func NewDMG ¶
func NewDMG(sr *io.SectionReader) (*DMG, error)
NewDMG creates a new DMG for accessing a dmg in an underlying reader. The dmg is expected to start at position 0 in the ReaderAt.
func (*DMG) Close ¶
Close closes the DMG. If the DMG was created using NewFile directly instead of Open, Close has no effect.
func (*DMG) DecryptedTemp ¶ added in v1.0.26
type EncryptionHeader ¶ added in v1.0.25
type EncryptionHeader struct {
Magic [8]byte // "encrcdsa"
Version uint32 // 2
EncIvSize uint32
Unknown1 uint32
Unknown2 uint32
DataEncKeyBits uint32
Unknown3 uint32
HmacKeyBits uint32
UUID [16]byte
Blocksize uint32
Datasize uint64
Dataoffset uint64
Unknown4 [24]byte
KdfAlgorithm uint32
KdfPrngAlgorithm uint32
KdfIterationCount uint32
KdfSaltLen uint32
KdfSalt [32]byte
BlobEncIvSize uint32
BlobEncIv [32]byte
BlobEncKeyBits uint32
BlobEncAlgorithm uint32 // 17
BlobEncPadding uint32 // 7
BlobEncMode uint32 // 6
EncryptedKeyblobSize uint32
EncryptedKeyblob1 [32]byte
EncryptedKeyblob2 [32]byte
}
type Partition ¶ added in v1.0.20
type Partition struct {
Name string
Chunks []udifBlockChunk
// contains filtered or unexported fields
}
Partition object
type UDIFChecksum ¶
UDIFChecksum object
type UDIFResourceFile ¶
type UDIFResourceFile struct {
Signature udifSignature // magic 'koly'
Version uint32 // 4 (as of 2013)
HeaderSize uint32 // sizeof(this) = 512 (as of 2013)
Flags udifResourceFileFlag
RunningDataForkOffset uint64
DataForkOffset uint64 // usually 0, beginning of file
DataForkLength uint64
RsrcForkOffset uint64 // resource fork offset and length
RsrcForkLength uint64
SegmentNumber uint32 // Usually 1, can be 0
SegmentCount uint32 // Usually 1, can be 0
SegmentID types.UUID
DataChecksum UDIFChecksum
PlistOffset uint64 // Offset and length of the blkx plist.
PlistLength uint64
Reserved1 [64]byte
CodeSignatureOffset uint64
CodeSignatureLength uint64
Reserved2 [40]byte
MasterChecksum UDIFChecksum
ImageVariant uint32 // Unknown, commonly 1
SectorCount uint64
Reserved3 uint32
Reserved4 uint32
Reserved5 uint32
}
UDIFResourceFile - Universal Disk Image Format (UDIF) DMG Footer
Click to show internal directories.
Click to hide internal directories.