detector

package
v0.0.0-...-313bb7c Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ZIP_ECD_FIELD_CENTRAL_DIRECTORY_SIZE = 12

Size of the central directory in bytes

View Source
const ZIP_ECD_FIELD_COMMENT_SIZE = 20

Size of the variable-length comment field in the end-of-central-directory record

View Source
const ZIP_ECD_FIELD_START_ARCHIVE_OFFSET = 16

Offset in bytes from the start of the central directory to the start of the zip file

Variables

View Source
var GZIP_HEADER = []byte{0x1f, 0x8b}
View Source
var ZIP_ECD_HEADER = []byte{0x50, 0x4b, 0x05, 0x06}

Magic preamble for the end-of-central-directory record

Functions

func FileSize

func FileSize(path string) (int64, error)

func Scan

func Scan(startOffset int64, path string, onDetection func(Detection), onProgress func(ProgressInfo)) error

Bootstrap and run the detection system, scanning the given path for remnants of wallets. Normally, the path given would be a raw device file handle, like /dev/sdb or some such; the system would then scan every sector of that device

Types

type Block

type Block struct {
	// contains filtered or unexported fields
}

A block of data being worked on

var EOF *Block = &Block{}

func NewBlock

func NewBlock(size int) *Block

type Detection

type Detection struct {
	Description string
}

Describes a detected wallet

type ProgressInfo

type ProgressInfo struct {
	// Description of the target currently being scanned
	CurrentTarget string
	// Number of bytes scanned in the current target
	ScannedBytes int64
	// Bytes in the current target
	TotalBytes int64
	// Number of targets remaining to be scanned; this may grow dynamically as new targets
	// are discovered inside existing targets (eg. compressed files)
	UnscannedTargets int
}

type TargetReader

type TargetReader interface {
	io.ReaderAt
	io.Reader
	io.Closer
	io.Seeker
}

Jump to

Keyboard shortcuts

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