imagetools

package
v0.0.0-...-79a645e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SkippedNotTouched : File was skipped because it was not touched during runtime
	SkippedNotTouched CopyResult = 0
	// SkippedAbnormalFile : File was skipped because it was not a dir, file or symlink
	SkippedAbnormalFile = 1
	// CopiedRegularFile : File was regular and copied during decompile
	CopiedRegularFile = 2
	// CopiedSymlink : File was a symlink, and was reconstructed during decompile
	CopiedSymlink = 3
	// CopiedMkDir : File was a dir, and was reconstructed during decompile
	CopiedMkDir = 4
)

Variables

This section is empty.

Functions

func CatImageFile

func CatImageFile(vorteilImage *vdecompiler.IO, imageFilePath string, os bool) (io.Reader, error)

CatImageFile returns a io.Reader that reads the contents of the file at the imageFilePath inside

the passed vorteilImage. If the path does not exist inside vorteilImage the reader is returned
as nil accompanied by an error.

func CopyImageFile

func CopyImageFile(vorteilImage *vdecompiler.IO, imageFilePath string, destFilePath string, seekOS bool) error

CopyImageFile copies a the file at imageFilePath from inside the vorteilImage to destFilePath in the system

SeekOS can be set to true, to copy a file from inside of the images Vorteil Os Partition.

func FSIMGImage

func FSIMGImage(vorteilImage *vdecompiler.IO, destPath string) error

FSIMGImage copies a vorteil image's file system partition to destPath

func MDSumImageFile

func MDSumImageFile(vorteilImagePath string, imageFilePath string, seekOS bool) (string, error)

MDSumImageFile returns the md5sum of a imageFilePath stored in vorteilImage

Types

type CopyResult

type CopyResult int

CopyResult : Enum const for the results of a decompiled file

type DUImageReport

type DUImageReport struct {
	FreeSpace  int
	ImageFiles []duImageInfo
}

DUImageReport Returns a Disk usage report

func DUImageFile

func DUImageFile(vorteilImage *vdecompiler.IO, imageFilePath string, calcFreeSpace bool, maxDepth int, all bool) (DUImageReport, error)

DUImageFile returns the disk usage calculations of a path (imageFilePath) in a vorteilImage.

Disk usuage is recursive will be calculated at a depth set to maxDepth.

type DecompileReport

type DecompileReport struct {
	SkipNotTouched bool
	ImageFiles     []DecompiledFile
}

DecompileReport : Info on the results of a Decompile Operation

func DecompileImage

func DecompileImage(vorteilImage *vdecompiler.IO, outputPath string, skipNotTouched bool) (DecompileReport, error)

DecompileImage will copy the contents inside vorteilImage to the outputPath on the local filesystem.

If skipNotTouched is set to true, only files that have been touched during runtime will be copied.
Returns a DecompileReport Object that provides information of the result of each file.

type DecompiledFile

type DecompiledFile struct {
	Path   string
	Result CopyResult
}

DecompiledFile holds the path of the decompiled file, and its results

type FSFileReport

type FSFileReport struct {
	FirstLBA        int
	LastLBA         int
	Type            string
	BlockSize       int
	BlocksAllocated int
	BlocksAvaliable int
	BlockGroups     int
	MaxBlock        int
	InodesAllocated int
	InodesAvaliable int
	MaxInodes       int
	LastMountTime   time.Time
	LastWriteTime   time.Time
}

FSFileReport : Contains information that summarizes a file-systems metadata

func FSImageFile

func FSImageFile(vorteilImage *vdecompiler.IO) (FSFileReport, error)

FSImageFile Returns a summary of a vorteil image's file-system's metadata

type GPTEntry

type GPTEntry struct {
	Name     string
	FirstLBA int
	LastLBA  int
}

GPTEntry : Info on a GPT entry

type ImageGPTReport

type ImageGPTReport struct {
	HeaderLBA       int
	BackupLBA       int
	FirstUsableLBA  int
	LastUsableLBA   int
	FirstEntriesLBA int
	Entries         []GPTEntry
}

ImageGPTReport : Info on a Images GUID Partition Table

func ImageGPT

func ImageGPT(vorteilImage *vdecompiler.IO) (ImageGPTReport, error)

ImageGPT returns a summary of the information in a Vorteil Image's GUID Partition Table

type StatFileReport

type StatFileReport struct {
	FileName    string
	FileType    string
	Size        int
	Inode       int
	UID         uint16
	User        string
	GID         uint16
	Group       string
	Permissions string
	Access      time.Time
	Modify      time.Time
	Create      time.Time
}

StatFileReport ...

func StatImageFile

func StatImageFile(vorteilImagePath string, imageFilePath string, seekOS bool) (StatFileReport, error)

StatImageFile returns the stats of a file at imageFilePath stored inside vorteilImagePath

type TreeReport

type TreeReport struct {
	Name     string
	Children []TreeReport
}

TreeReport ...

func TreeImageFile

func TreeImageFile(vorteilImagePath string, imageFilePath string, seekOS bool) (TreeReport, error)

TreeImageFile returns the stats on the contents stored at imageFilePath on vorteilImagePath.

Any child file stats from imageFilePath are also returned

func (*TreeReport) String

func (tR *TreeReport) String() string

Jump to

Keyboard shortcuts

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