backup

package
v0.0.0-...-59e6dc4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 21 Imported by: 1

Documentation

Overview

Package backup wraps an iOS backup directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	DeviceName string
	FileName   string
}

func Enumerate

func Enumerate() ([]Backup, error)

Enumerate lists the available backups

type DBReader

type DBReader struct {
	io.Reader
	// contains filtered or unexported fields
}

type Manifest

type Manifest struct {
	BackupKeyBag []byte
	Lockdown     struct {
		DeviceName string
	}
	Applications map[string]map[string]interface{}
	IsEncrypted  bool
	ManifestKey  []byte // this is wrapped
}

type MetaData

type MetaData struct {
	Mode          uint16
	Inode         uint64
	Uid           uint32
	Gid           uint32
	Mtime         uint32
	Atime         uint32
	Ctime         uint32
	Length        uint64
	ProtClass     uint8
	PropertyCount uint8
}

type MobileBackup

type MobileBackup struct {
	Dir      string
	Manifest Manifest
	Records  []Record
	Keybag   keybag.Keybag

	BlobKey []byte
}

MobileBackup encapsulates a mobile backup manifest

func Open

func Open(guid string) (*MobileBackup, error)

Open opens a MobileBackup directory corresponding to a given guid.

func (*MobileBackup) Domains

func (mb *MobileBackup) Domains() []string

Domains lists the file domains in a backup manifest.

func (*MobileBackup) FileKey

func (mb *MobileBackup) FileKey(rec Record) []byte

FileKey finds the key for a given file record

func (*MobileBackup) FileReader

func (mb *MobileBackup) FileReader(rec Record) (io.ReadCloser, error)

FileReader returns an io.Reader for the unencrypted contents of a file record

func (*MobileBackup) Load

func (mb *MobileBackup) Load() error

Load loads the backup. It must be called after "SetPassword" for ios 10.2+ encrypted backups, and must be called before attempting to use any other methods on MobileBackup.

func (*MobileBackup) ReadFile

func (mb *MobileBackup) ReadFile(rec Record) ([]byte, error)

ReadFile reads the contents of an encrypted file.

func (*MobileBackup) SetPassword

func (mb *MobileBackup) SetPassword(pass string) error

SetPassword decrypts the keychain.

type Record

type Record struct {
	MetaData
	Domain     string
	Path       string
	LinkTarget string
	Digest     []byte
	Key        []byte
	Properties map[string][]byte
}

func (*Record) HashCode

func (r *Record) HashCode() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL