ole2

package
v0.0.0-...-8bdd4ce Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 6 Imported by: 0

README

ole2

Microsoft Compound Document File Format library in Golang

Documentation

Index

Constants

View Source
const (
	EMPTY       = iota
	USERSTORAGE = iota
	USERSTREAM  = iota
	LOCKBYTES   = iota
	PROPERTY    = iota
	ROOT        = iota
)

Variables

View Source
var (
	ENDOFCHAIN = uint32(0xFFFFFFFE) //-2
	FREESECT   = uint32(0xFFFFFFFF) // -1
)
View Source
var DEBUG = false

Functions

This section is empty.

Types

type File

type File struct {
	NameBts   [32]uint16
	Bsize     uint16
	Type      byte
	Flag      byte
	Left      uint32
	Right     uint32
	Child     uint32
	Guid      [8]uint16
	Userflags uint32
	Time      [2]uint64
	Sstart    uint32
	Size      uint32
	Proptype  uint32
}

func (*File) Name

func (d *File) Name() string
type Header struct {
	Id        [2]uint32
	Clid      [4]uint32
	Verminor  uint16
	Verdll    uint16
	Byteorder uint16
	Lsectorb  uint16
	Lssectorb uint16

	Cfat     uint32 // Total number of sectors used for the sector allocation table
	Dirstart uint32 // SecID of first sector of the directory stream

	Sectorcutoff uint32 // Minimum size of a standard stream
	Sfatstart    uint32 // SecID of first sector of the short-sector allocation table
	Csfat        uint32 // Total number of sectors used for the short-sector allocation table
	Difstart     uint32 // SecID of first sector of the master sector allocation table
	Cdif         uint32 // Total number of sectors used for the master sector allocation table
	Msat         [109]uint32
	// contains filtered or unexported fields
}

type Ole

type Ole struct {
	Lsector  uint32
	Lssector uint32
	SecID    []uint32
	SSecID   []uint32
	Files    []File
	// contains filtered or unexported fields
}

func Open

func Open(reader io.ReadSeeker, charset string) (ole *Ole, err error)

func (*Ole) ListDir

func (o *Ole) ListDir() (dir []*File, err error)

func (*Ole) OpenFile

func (o *Ole) OpenFile(file *File, root *File) io.ReadSeeker

type PSS

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

type Sector

type Sector []byte

func (*Sector) AllValues

func (s *Sector) AllValues(size uint32) []uint32

func (*Sector) MsatValues

func (s *Sector) MsatValues(size uint32) []uint32

func (*Sector) NextSid

func (s *Sector) NextSid(size uint32) uint32

func (*Sector) Uint32

func (s *Sector) Uint32(bit uint32) uint32

type Stream

type Stream struct {
	Ole     *Ole
	Start   uint32
	Pos     uint32
	Cfat    int
	Size    int
	Fatpos  uint32
	Bufsize uint32
	Eof     byte
	Sfat    bool
}

type StreamReader

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

func (*StreamReader) Read

func (r *StreamReader) Read(p []byte) (n int, err error)

func (*StreamReader) Seek

func (r *StreamReader) Seek(offset int64, whence int) (offset_result int64, err error)

Jump to

Keyboard shortcuts

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