cfb

package module
v0.0.0-...-b8422ec Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

cfb

Microsoft CFB(Compound File Binary) parser

Status

WIP

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInsufficientData   = errors.New("insufficient data")
	ErrWrongSector        = errors.New("wrong sector")
	ErrInvalidSectorChain = errors.New("invalid sector chain")
	ErrInvalidSeek        = errors.New("invalid seek operation")
	ErrInvalidOffset      = errors.New("invalid offset")
	ErrWrongObjectType    = errors.New("wrong object type")
	ErrInvalidObject      = errors.New("invalid object")
	ErrObjectNotFound     = errors.New("object not found")
	ErrValidation         = errors.New("validation error")
)

Functions

This section is empty.

Types

type DirectoryEntry

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

func (*DirectoryEntry) Name

func (d *DirectoryEntry) Name() string

func (*DirectoryEntry) Path

func (d *DirectoryEntry) Path() string

func (*DirectoryEntry) Size

func (d *DirectoryEntry) Size() uint64

func (*DirectoryEntry) StartingSector

func (d *DirectoryEntry) StartingSector() uint32

func (*DirectoryEntry) Type

func (d *DirectoryEntry) Type() ObjectType

type File

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

func New

func New(r io.ReaderAt) (*File, error)

func (*File) Get

func (f *File) Get(path string) (Object, error)

func (*File) Header

func (f *File) Header() *FileHeader

func (*File) Objects

func (f *File) Objects() ([]Object, error)

type FileHeader

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

func (*FileHeader) MiniSectorSize

func (h *FileHeader) MiniSectorSize() uint32

func (*FileHeader) SectorSize

func (h *FileHeader) SectorSize() uint32

type Object

type Object interface {
	Name() string
	Path() string
	Type() ObjectType
	Size() uint64
	ReadAt([]byte, int64) (int, error)
	Seek(int64, int) (int64, error)
	Read([]byte) (int, error)
}

type ObjectType

type ObjectType uint8
const (
	UnknownObject     ObjectType = 0x00
	StorageObject     ObjectType = 0x01
	StreamObject      ObjectType = 0x02
	RootStorageObject ObjectType = 0x05
)

func (ObjectType) String

func (i ObjectType) String() string

type SectorReader

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

func (*SectorReader) Read

func (sr *SectorReader) Read(b []byte) (int, error)

func (*SectorReader) ReadAt

func (sr *SectorReader) ReadAt(b []byte, offset int64) (int, error)

func (*SectorReader) Seek

func (sr *SectorReader) Seek(offset int64, whence int) (int64, error)

type Storage

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

func (*Storage) Name

func (s *Storage) Name() string

func (*Storage) Path

func (s *Storage) Path() string

func (*Storage) Read

func (s *Storage) Read(b []byte) (int, error)

func (*Storage) ReadAt

func (s *Storage) ReadAt(b []byte, offset int64) (int, error)

func (*Storage) Seek

func (s *Storage) Seek(offset int64, whence int) (int64, error)

func (*Storage) Size

func (s *Storage) Size() uint64

func (*Storage) String

func (s *Storage) String() string

func (*Storage) Type

func (s *Storage) Type() ObjectType

type Stream

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

func (*Stream) Name

func (s *Stream) Name() string

func (*Stream) Path

func (s *Stream) Path() string

func (*Stream) Read

func (s *Stream) Read(b []byte) (int, error)

func (*Stream) ReadAt

func (s *Stream) ReadAt(b []byte, offset int64) (int, error)

func (*Stream) Seek

func (s *Stream) Seek(offset int64, whence int) (int64, error)

func (*Stream) Size

func (s *Stream) Size() uint64

func (*Stream) String

func (s *Stream) String() string

func (*Stream) Type

func (s *Stream) Type() ObjectType

Jump to

Keyboard shortcuts

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