parser

package
v0.0.0-...-b3a60a0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CATALOG_PAGE_NUMBER = 4
)
View Source
const (
	// Read at most 10Mb
	MAX_MEMORY = 10 * 1024 * 1024
)
View Source
const (
	TAG_COMMON = 4
)

Variables

View Source
var (
	// General purpose debug statements.
	Debug = false

	// Debugging during walk
	DebugWalk = false
)

Functions

func DebugPageHeader

func DebugPageHeader(ctx *ESEContext, page *PageHeader) string

func DebugTag

func DebugTag(ctx *ESEContext, tag *Tag, page *PageHeader) string

func Decompress7BitCompression

func Decompress7BitCompression(buf []byte) []byte

func DecompressLongValue

func DecompressLongValue(buf []byte) []byte

func DlvDebug

func DlvDebug()

func DumpPage

func DumpPage(ctx *ESEContext, id int64)

func IsSmallPage

func IsSmallPage(page_size int64) bool

func NewOffsetReader

func NewOffsetReader(reader io.ReaderAt, offset, size int64) io.ReaderAt

func ParseArray_byte

func ParseArray_byte(profile *ESEProfile, reader io.ReaderAt, offset int64, count int) []byte

func ParseInt16

func ParseInt16(reader io.ReaderAt, offset int64) int16

func ParseInt32

func ParseInt32(reader io.ReaderAt, offset int64) int32

func ParseInt64

func ParseInt64(reader io.ReaderAt, offset int64) int64

func ParseLongText

func ParseLongText(buf []byte, cp uint32) string

func ParseString

func ParseString(reader io.ReaderAt, offset int64, length int64) string

func ParseTaggedValues

func ParseTaggedValues(ctx *ESEContext, buffer []byte) map[uint32]TaggedValue

func ParseTerminatedString

func ParseTerminatedString(reader io.ReaderAt, offset int64) string

func ParseTerminatedUTF16String

func ParseTerminatedUTF16String(reader io.ReaderAt, offset int64) string

func ParseText

func ParseText(reader io.ReaderAt, offset int64, len int64, flags uint32) string

func ParseTwoValue

func ParseTwoValue(buffer []byte, parseFn func([]byte) any) []any

func ParseUTF16String

func ParseUTF16String(reader io.ReaderAt, offset int64, length int64) string

func ParseUint8

func ParseUint8(reader io.ReaderAt, offset int64) byte

func ParseUint16

func ParseUint16(reader io.ReaderAt, offset int64) uint16

func ParseUint32

func ParseUint32(reader io.ReaderAt, offset int64) uint32

func ParseUint64

func ParseUint64(reader io.ReaderAt, offset int64) uint64

func UTF16BytesToUTF8

func UTF16BytesToUTF8(b []byte, o binary.ByteOrder) string

func WalkPages

func WalkPages(ctx *ESEContext,
	id int64,
	cb func(header *PageHeader, page_id int64, value *Value) error) error

WalkPages walks the b tree starting with the page id specified and extracts all tagged values into the callback. The callback may return an error which will cause WalkPages to stop and relay that error to our caller.

func WinFileTime64

func WinFileTime64(reader io.ReaderAt, offset int64) time.Time

func WinFileTime64Bin

func WinFileTime64Bin(bytes []byte) time.Time

Types

type BufferReaderAt

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

func (*BufferReaderAt) ReadAt

func (self *BufferReaderAt) ReadAt(buf []byte, offset int64) (int, error)

type CATALOG_TYPE_COLUMN

type CATALOG_TYPE_COLUMN struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*CATALOG_TYPE_COLUMN) CodePage

func (self *CATALOG_TYPE_COLUMN) CodePage() uint32

func (*CATALOG_TYPE_COLUMN) ColumnFlags

func (self *CATALOG_TYPE_COLUMN) ColumnFlags() uint32

func (*CATALOG_TYPE_COLUMN) ColumnType

func (self *CATALOG_TYPE_COLUMN) ColumnType() *Enumeration

func (*CATALOG_TYPE_COLUMN) DebugString

func (self *CATALOG_TYPE_COLUMN) DebugString() string

func (*CATALOG_TYPE_COLUMN) Size

func (self *CATALOG_TYPE_COLUMN) Size() int

func (*CATALOG_TYPE_COLUMN) SpaceUsage

func (self *CATALOG_TYPE_COLUMN) SpaceUsage() uint32

type CATALOG_TYPE_INDEX

type CATALOG_TYPE_INDEX struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*CATALOG_TYPE_INDEX) DebugString

func (self *CATALOG_TYPE_INDEX) DebugString() string

func (*CATALOG_TYPE_INDEX) FatherDataPageNumber

func (self *CATALOG_TYPE_INDEX) FatherDataPageNumber() uint32

func (*CATALOG_TYPE_INDEX) IndexFlags

func (self *CATALOG_TYPE_INDEX) IndexFlags() uint32

func (*CATALOG_TYPE_INDEX) Locale

func (self *CATALOG_TYPE_INDEX) Locale() uint32

func (*CATALOG_TYPE_INDEX) Size

func (self *CATALOG_TYPE_INDEX) Size() int

func (*CATALOG_TYPE_INDEX) SpaceUsage

func (self *CATALOG_TYPE_INDEX) SpaceUsage() uint32

type CATALOG_TYPE_LONG_VALUE

type CATALOG_TYPE_LONG_VALUE struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*CATALOG_TYPE_LONG_VALUE) DebugString

func (self *CATALOG_TYPE_LONG_VALUE) DebugString() string

func (*CATALOG_TYPE_LONG_VALUE) FatherDataPageNumber

func (self *CATALOG_TYPE_LONG_VALUE) FatherDataPageNumber() uint32

func (*CATALOG_TYPE_LONG_VALUE) InitialNumberOfPages

func (self *CATALOG_TYPE_LONG_VALUE) InitialNumberOfPages() uint32

func (*CATALOG_TYPE_LONG_VALUE) LVFlags

func (self *CATALOG_TYPE_LONG_VALUE) LVFlags() uint32

func (*CATALOG_TYPE_LONG_VALUE) Size

func (self *CATALOG_TYPE_LONG_VALUE) Size() int

func (*CATALOG_TYPE_LONG_VALUE) SpaceUsage

func (self *CATALOG_TYPE_LONG_VALUE) SpaceUsage() uint32

type CATALOG_TYPE_TABLE

type CATALOG_TYPE_TABLE struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*CATALOG_TYPE_TABLE) DebugString

func (self *CATALOG_TYPE_TABLE) DebugString() string

func (*CATALOG_TYPE_TABLE) FatherDataPageNumber

func (self *CATALOG_TYPE_TABLE) FatherDataPageNumber() uint32

func (*CATALOG_TYPE_TABLE) Size

func (self *CATALOG_TYPE_TABLE) Size() int

func (*CATALOG_TYPE_TABLE) SpaceUsage

func (self *CATALOG_TYPE_TABLE) SpaceUsage() uint32

type Catalog

type Catalog struct {
	Tables *ordereddict.Dict
	// contains filtered or unexported fields
}

Catalog represents the database's catalog.

func ReadCatalog

func ReadCatalog(ctx *ESEContext) (*Catalog, error)

func (*Catalog) Dump

func (self *Catalog) Dump(options DumpOptions) string

func (*Catalog) DumpTable

func (self *Catalog) DumpTable(name string, cb func(row *ordereddict.Dict) error) error

DumpTable extracts all rows in the named table and passes them into the callback. The callback may cancel the walk at any time by returning an error which is passed to our caller.

type ColumnSpec

type ColumnSpec struct {
	FDPId      uint32
	Name       string
	Identifier uint32
	Type       string
	Flags      uint32
	SpaceUsage int64
	CodePage   uint32
}

Store a simple struct of column spec for speed.

type DBTime

type DBTime struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*DBTime) DebugString

func (self *DBTime) DebugString() string

func (*DBTime) Hours

func (self *DBTime) Hours() uint16

func (*DBTime) Min

func (self *DBTime) Min() uint16

func (*DBTime) Sec

func (self *DBTime) Sec() uint16

func (*DBTime) Size

func (self *DBTime) Size() int

type DumpOptions

type DumpOptions struct {
	LongValueTables bool
	Indexes         bool
	Tables          bool
}

type ESEContext

type ESEContext struct {
	Reader   io.ReaderAt
	Profile  *ESEProfile
	PageSize int64
	Header   *FileHeader
	Version  uint32
	Revision uint32
}

func NewESEContext

func NewESEContext(reader io.ReaderAt) (*ESEContext, error)

func (*ESEContext) GetPage

func (self *ESEContext) GetPage(id int64) *PageHeader

func (*ESEContext) GetTaggedValueFlags

func (self *ESEContext) GetTaggedValueFlags(tagData uint16) uint16

func (*ESEContext) GetTaggedValueOffset

func (self *ESEContext) GetTaggedValueOffset(tagData uint16) uint16

func (*ESEContext) IsExtendedPageRevision

func (self *ESEContext) IsExtendedPageRevision() bool

func (*ESEContext) IsSmallPage

func (self *ESEContext) IsSmallPage() bool

func (*ESEContext) MaskIb

func (self *ESEContext) MaskIb() uint16

type ESENT_BRANCH_ENTRY

type ESENT_BRANCH_ENTRY struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func NewESENT_BRANCH_ENTRY

func NewESENT_BRANCH_ENTRY(ctx *ESEContext, value *Value) *ESENT_BRANCH_ENTRY

NewESENT_BRANCH_ENTRY creates a new ESENT_BRANCH_ENTRY object. Depending on the Tag flags, there may be present a CommonPageKeySize field before the struct. This construstor then positions the struct appropriately.

func (*ESENT_BRANCH_ENTRY) ChildPageNumber

func (self *ESENT_BRANCH_ENTRY) ChildPageNumber() int64

func (*ESENT_BRANCH_ENTRY) DebugString

func (self *ESENT_BRANCH_ENTRY) DebugString() string

func (*ESENT_BRANCH_ENTRY) Dump

func (self *ESENT_BRANCH_ENTRY) Dump()

func (*ESENT_BRANCH_ENTRY) LocalPageKeySize

func (self *ESENT_BRANCH_ENTRY) LocalPageKeySize() uint16

func (*ESENT_BRANCH_ENTRY) Size

func (self *ESENT_BRANCH_ENTRY) Size() int

type ESENT_BRANCH_HEADER

type ESENT_BRANCH_HEADER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func GetBranch

func GetBranch(ctx *ESEContext, value *Value) *ESENT_BRANCH_HEADER

func (*ESENT_BRANCH_HEADER) CommonPageKey

func (self *ESENT_BRANCH_HEADER) CommonPageKey() string

func (*ESENT_BRANCH_HEADER) DebugString

func (self *ESENT_BRANCH_HEADER) DebugString() string

func (*ESENT_BRANCH_HEADER) Dump

func (self *ESENT_BRANCH_HEADER) Dump()

func (*ESENT_BRANCH_HEADER) Size

func (self *ESENT_BRANCH_HEADER) Size() int

type ESENT_CATALOG_DATA_DEFINITION_ENTRY

type ESENT_CATALOG_DATA_DEFINITION_ENTRY struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Column

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) DebugString

func (self *ESENT_CATALOG_DATA_DEFINITION_ENTRY) DebugString() string

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) FDPId

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Identifier

func (self *ESENT_CATALOG_DATA_DEFINITION_ENTRY) Identifier() uint32

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Index

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) LongValue

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Size

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Table

func (*ESENT_CATALOG_DATA_DEFINITION_ENTRY) Type

type ESENT_DATA_DEFINITION_HEADER

type ESENT_DATA_DEFINITION_HEADER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_DATA_DEFINITION_HEADER) DebugString

func (self *ESENT_DATA_DEFINITION_HEADER) DebugString() string

func (*ESENT_DATA_DEFINITION_HEADER) LastFixedType

func (self *ESENT_DATA_DEFINITION_HEADER) LastFixedType() byte

func (*ESENT_DATA_DEFINITION_HEADER) LastVariableDataType

func (self *ESENT_DATA_DEFINITION_HEADER) LastVariableDataType() byte

func (*ESENT_DATA_DEFINITION_HEADER) Size

func (self *ESENT_DATA_DEFINITION_HEADER) Size() int

func (*ESENT_DATA_DEFINITION_HEADER) VariableSizeOffset

func (self *ESENT_DATA_DEFINITION_HEADER) VariableSizeOffset() uint16

type ESENT_INDEX_ENTRY

type ESENT_INDEX_ENTRY struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_INDEX_ENTRY) DebugString

func (self *ESENT_INDEX_ENTRY) DebugString() string

func (*ESENT_INDEX_ENTRY) Dump

func (self *ESENT_INDEX_ENTRY) Dump()

func (*ESENT_INDEX_ENTRY) RecordPageKey

func (self *ESENT_INDEX_ENTRY) RecordPageKey() string

func (*ESENT_INDEX_ENTRY) Size

func (self *ESENT_INDEX_ENTRY) Size() int

type ESENT_LEAF_ENTRY

type ESENT_LEAF_ENTRY struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func NewESENT_LEAF_ENTRY

func NewESENT_LEAF_ENTRY(ctx *ESEContext, value *Value) *ESENT_LEAF_ENTRY

NewESENT_LEAF_ENTRY creates a new ESENT_LEAF_ENTRY object. Depending on the Tag flags, there may be present a CommonPageKeySize field before the struct. This constructor then positions the struct appropriately.

func (*ESENT_LEAF_ENTRY) CommonPageKeySize

func (self *ESENT_LEAF_ENTRY) CommonPageKeySize() uint16

func (*ESENT_LEAF_ENTRY) DebugString

func (self *ESENT_LEAF_ENTRY) DebugString() string

func (*ESENT_LEAF_ENTRY) Dump

func (self *ESENT_LEAF_ENTRY) Dump()

func (*ESENT_LEAF_ENTRY) EntryData

func (self *ESENT_LEAF_ENTRY) EntryData() int64

func (*ESENT_LEAF_ENTRY) LocalPageKeySize

func (self *ESENT_LEAF_ENTRY) LocalPageKeySize() uint64

func (*ESENT_LEAF_ENTRY) Size

func (self *ESENT_LEAF_ENTRY) Size() int

type ESENT_LEAF_HEADER

type ESENT_LEAF_HEADER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_LEAF_HEADER) CommonPageKey

func (self *ESENT_LEAF_HEADER) CommonPageKey() string

func (*ESENT_LEAF_HEADER) DebugString

func (self *ESENT_LEAF_HEADER) DebugString() string

func (*ESENT_LEAF_HEADER) Dump

func (self *ESENT_LEAF_HEADER) Dump()

func (*ESENT_LEAF_HEADER) Size

func (self *ESENT_LEAF_HEADER) Size() int

type ESENT_ROOT_HEADER

type ESENT_ROOT_HEADER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func GetRoot

func GetRoot(ctx *ESEContext, value *Value) *ESENT_ROOT_HEADER

func (*ESENT_ROOT_HEADER) DebugString

func (self *ESENT_ROOT_HEADER) DebugString() string

func (*ESENT_ROOT_HEADER) Dump

func (self *ESENT_ROOT_HEADER) Dump()

func (*ESENT_ROOT_HEADER) ExtentSpace

func (self *ESENT_ROOT_HEADER) ExtentSpace() *Enumeration

func (*ESENT_ROOT_HEADER) InitialNumberOfPages

func (self *ESENT_ROOT_HEADER) InitialNumberOfPages() uint32

func (*ESENT_ROOT_HEADER) ParentFDP

func (self *ESENT_ROOT_HEADER) ParentFDP() uint32

func (*ESENT_ROOT_HEADER) Size

func (self *ESENT_ROOT_HEADER) Size() int

func (*ESENT_ROOT_HEADER) SpaceTreePageNumber

func (self *ESENT_ROOT_HEADER) SpaceTreePageNumber() uint32

type ESENT_SPACE_TREE_ENTRY

type ESENT_SPACE_TREE_ENTRY struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_SPACE_TREE_ENTRY) DebugString

func (self *ESENT_SPACE_TREE_ENTRY) DebugString() string

func (*ESENT_SPACE_TREE_ENTRY) Dump

func (self *ESENT_SPACE_TREE_ENTRY) Dump()

func (*ESENT_SPACE_TREE_ENTRY) LastPageNumber

func (self *ESENT_SPACE_TREE_ENTRY) LastPageNumber() uint32

func (*ESENT_SPACE_TREE_ENTRY) NumberOfPages

func (self *ESENT_SPACE_TREE_ENTRY) NumberOfPages() uint32

func (*ESENT_SPACE_TREE_ENTRY) PageKeySize

func (self *ESENT_SPACE_TREE_ENTRY) PageKeySize() uint16

func (*ESENT_SPACE_TREE_ENTRY) Size

func (self *ESENT_SPACE_TREE_ENTRY) Size() int

type ESENT_SPACE_TREE_HEADER

type ESENT_SPACE_TREE_HEADER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*ESENT_SPACE_TREE_HEADER) DebugString

func (self *ESENT_SPACE_TREE_HEADER) DebugString() string

func (*ESENT_SPACE_TREE_HEADER) Dump

func (self *ESENT_SPACE_TREE_HEADER) Dump()

func (*ESENT_SPACE_TREE_HEADER) Size

func (self *ESENT_SPACE_TREE_HEADER) Size() int

type ESEProfile

type ESEProfile struct {
	Off_CATALOG_TYPE_COLUMN_ColumnType                    int64
	Off_CATALOG_TYPE_COLUMN_SpaceUsage                    int64
	Off_CATALOG_TYPE_COLUMN_ColumnFlags                   int64
	Off_CATALOG_TYPE_COLUMN_CodePage                      int64
	Off_CATALOG_TYPE_INDEX_FatherDataPageNumber           int64
	Off_CATALOG_TYPE_INDEX_SpaceUsage                     int64
	Off_CATALOG_TYPE_INDEX_IndexFlags                     int64
	Off_CATALOG_TYPE_INDEX_Locale                         int64
	Off_CATALOG_TYPE_LONG_VALUE_FatherDataPageNumber      int64
	Off_CATALOG_TYPE_LONG_VALUE_SpaceUsage                int64
	Off_CATALOG_TYPE_LONG_VALUE_LVFlags                   int64
	Off_CATALOG_TYPE_LONG_VALUE_InitialNumberOfPages      int64
	Off_CATALOG_TYPE_TABLE_FatherDataPageNumber           int64
	Off_CATALOG_TYPE_TABLE_SpaceUsage                     int64
	Off_DBTime_Hours                                      int64
	Off_DBTime_Min                                        int64
	Off_DBTime_Sec                                        int64
	Off_ESENT_BRANCH_ENTRY_LocalPageKeySize               int64
	Off_ESENT_BRANCH_HEADER_CommonPageKey                 int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_FDPId         int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_Type          int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_Identifier    int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_Column        int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_Table         int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_Index         int64
	Off_ESENT_CATALOG_DATA_DEFINITION_ENTRY_LongValue     int64
	Off_ESENT_DATA_DEFINITION_HEADER_LastFixedType        int64
	Off_ESENT_DATA_DEFINITION_HEADER_LastVariableDataType int64
	Off_ESENT_DATA_DEFINITION_HEADER_VariableSizeOffset   int64
	Off_ESENT_INDEX_ENTRY_RecordPageKey                   int64
	Off_ESENT_LEAF_ENTRY_CommonPageKeySize                int64
	Off_ESENT_LEAF_ENTRY_LocalPageKeySize                 int64
	Off_ESENT_LEAF_HEADER_CommonPageKey                   int64
	Off_ESENT_ROOT_HEADER_InitialNumberOfPages            int64
	Off_ESENT_ROOT_HEADER_ParentFDP                       int64
	Off_ESENT_ROOT_HEADER_ExtentSpace                     int64
	Off_ESENT_ROOT_HEADER_SpaceTreePageNumber             int64
	Off_ESENT_SPACE_TREE_ENTRY_PageKeySize                int64
	Off_ESENT_SPACE_TREE_ENTRY_LastPageNumber             int64
	Off_ESENT_SPACE_TREE_ENTRY_NumberOfPages              int64
	Off_FileHeader_Magic                                  int64
	Off_FileHeader_FormatVersion                          int64
	Off_FileHeader_FormatRevision                         int64
	Off_FileHeader_FileType                               int64
	Off_FileHeader_DataBaseTime                           int64
	Off_FileHeader_Signature                              int64
	Off_FileHeader_PageSize                               int64
	Off_GUID_Data1                                        int64
	Off_GUID_Data2                                        int64
	Off_GUID_Data3                                        int64
	Off_GUID_Data4                                        int64
	Off_JET_LOGTIME_Sec                                   int64
	Off_JET_LOGTIME_Min                                   int64
	Off_JET_LOGTIME_Hours                                 int64
	Off_JET_LOGTIME_Days                                  int64
	Off_JET_LOGTIME_Month                                 int64
	Off_JET_LOGTIME_Year                                  int64
	Off_JET_SIGNATURE_Creation                            int64
	Off_JET_SIGNATURE_CreatorMachine                      int64
	Off_LVKEY32_Lid                                       int64
	Off_LVKEY32_SegmentOffset                             int64
	Off_LVKEY64_Lid                                       int64
	Off_LVKEY64_SegmentOffset                             int64
	Off_LVKEY_BUFFER_PrefixLength                         int64
	Off_LVKEY_BUFFER_SuffixLength                         int64
	Off_LVKEY_BUFFER_KeyBuffer                            int64
	Off_Misc_Misc                                         int64
	Off_Misc_Misc2                                        int64
	Off_Misc_Misc3                                        int64
	Off_Misc_Misc5                                        int64
	Off_Misc_Misc4                                        int64
	Off_PageHeader__LastModified                          int64
	Off_PageHeader__PreviousPageNumber                    int64
	Off_PageHeader__NextPageNumber                        int64
	Off_PageHeader__FatherPage                            int64
	Off_PageHeader__AvailableDataSize                     int64
	Off_PageHeader__AvailableDataOffset                   int64
	Off_PageHeader__AvailablePageTag                      int64
	Off_PageHeader__Flags                                 int64
	Off_RecordTag_Identifier                              int64
	Off_RecordTag_TagData                                 int64
	Off_Tag__ValueSize                                    int64
	Off_Tag__ValueOffset                                  int64
	Off_Tag_Flags_                                        int64
	Off_Tag_Flags                                         int64
}

func NewESEProfile

func NewESEProfile() *ESEProfile

func (*ESEProfile) CATALOG_TYPE_COLUMN

func (self *ESEProfile) CATALOG_TYPE_COLUMN(reader io.ReaderAt, offset int64) *CATALOG_TYPE_COLUMN

func (*ESEProfile) CATALOG_TYPE_INDEX

func (self *ESEProfile) CATALOG_TYPE_INDEX(reader io.ReaderAt, offset int64) *CATALOG_TYPE_INDEX

func (*ESEProfile) CATALOG_TYPE_LONG_VALUE

func (self *ESEProfile) CATALOG_TYPE_LONG_VALUE(reader io.ReaderAt, offset int64) *CATALOG_TYPE_LONG_VALUE

func (*ESEProfile) CATALOG_TYPE_TABLE

func (self *ESEProfile) CATALOG_TYPE_TABLE(reader io.ReaderAt, offset int64) *CATALOG_TYPE_TABLE

func (*ESEProfile) DBTime

func (self *ESEProfile) DBTime(reader io.ReaderAt, offset int64) *DBTime

func (*ESEProfile) ESENT_BRANCH_ENTRY

func (self *ESEProfile) ESENT_BRANCH_ENTRY(reader io.ReaderAt, offset int64) *ESENT_BRANCH_ENTRY

func (*ESEProfile) ESENT_BRANCH_HEADER

func (self *ESEProfile) ESENT_BRANCH_HEADER(reader io.ReaderAt, offset int64) *ESENT_BRANCH_HEADER

func (*ESEProfile) ESENT_CATALOG_DATA_DEFINITION_ENTRY

func (self *ESEProfile) ESENT_CATALOG_DATA_DEFINITION_ENTRY(reader io.ReaderAt, offset int64) *ESENT_CATALOG_DATA_DEFINITION_ENTRY

func (*ESEProfile) ESENT_DATA_DEFINITION_HEADER

func (self *ESEProfile) ESENT_DATA_DEFINITION_HEADER(reader io.ReaderAt, offset int64) *ESENT_DATA_DEFINITION_HEADER

func (*ESEProfile) ESENT_INDEX_ENTRY

func (self *ESEProfile) ESENT_INDEX_ENTRY(reader io.ReaderAt, offset int64) *ESENT_INDEX_ENTRY

func (*ESEProfile) ESENT_LEAF_ENTRY

func (self *ESEProfile) ESENT_LEAF_ENTRY(reader io.ReaderAt, offset int64) *ESENT_LEAF_ENTRY

func (*ESEProfile) ESENT_LEAF_HEADER

func (self *ESEProfile) ESENT_LEAF_HEADER(reader io.ReaderAt, offset int64) *ESENT_LEAF_HEADER

func (*ESEProfile) ESENT_ROOT_HEADER

func (self *ESEProfile) ESENT_ROOT_HEADER(reader io.ReaderAt, offset int64) *ESENT_ROOT_HEADER

func (*ESEProfile) ESENT_SPACE_TREE_ENTRY

func (self *ESEProfile) ESENT_SPACE_TREE_ENTRY(reader io.ReaderAt, offset int64) *ESENT_SPACE_TREE_ENTRY

func (*ESEProfile) ESENT_SPACE_TREE_HEADER

func (self *ESEProfile) ESENT_SPACE_TREE_HEADER(reader io.ReaderAt, offset int64) *ESENT_SPACE_TREE_HEADER

func (*ESEProfile) FileHeader

func (self *ESEProfile) FileHeader(reader io.ReaderAt, offset int64) *FileHeader

func (*ESEProfile) GUID

func (self *ESEProfile) GUID(reader io.ReaderAt, offset int64) *GUID

func (*ESEProfile) JET_LOGTIME

func (self *ESEProfile) JET_LOGTIME(reader io.ReaderAt, offset int64) *JET_LOGTIME

func (*ESEProfile) JET_SIGNATURE

func (self *ESEProfile) JET_SIGNATURE(reader io.ReaderAt, offset int64) *JET_SIGNATURE

func (*ESEProfile) LVKEY32

func (self *ESEProfile) LVKEY32(reader io.ReaderAt, offset int64) *LVKEY32

func (*ESEProfile) LVKEY64

func (self *ESEProfile) LVKEY64(reader io.ReaderAt, offset int64) *LVKEY64

func (*ESEProfile) LVKEY_BUFFER

func (self *ESEProfile) LVKEY_BUFFER(reader io.ReaderAt, offset int64) *LVKEY_BUFFER

func (*ESEProfile) Misc

func (self *ESEProfile) Misc(reader io.ReaderAt, offset int64) *Misc

func (*ESEProfile) PageHeader_

func (self *ESEProfile) PageHeader_(reader io.ReaderAt, offset int64) *PageHeader_

func (*ESEProfile) RecordTag

func (self *ESEProfile) RecordTag(reader io.ReaderAt, offset int64) *RecordTag

func (*ESEProfile) Tag

func (self *ESEProfile) Tag(reader io.ReaderAt, offset int64) *Tag

type Enumeration

type Enumeration struct {
	Value uint64
	Name  string
}

func (Enumeration) DebugString

func (self Enumeration) DebugString() string

type FileHeader

type FileHeader struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*FileHeader) DataBaseTime

func (self *FileHeader) DataBaseTime() *DBTime

func (*FileHeader) DebugString

func (self *FileHeader) DebugString() string

func (*FileHeader) FileType

func (self *FileHeader) FileType() *Enumeration

func (*FileHeader) FormatRevision

func (self *FileHeader) FormatRevision() uint32

func (*FileHeader) FormatVersion

func (self *FileHeader) FormatVersion() uint32

func (*FileHeader) Magic

func (self *FileHeader) Magic() uint32

func (*FileHeader) PageSize

func (self *FileHeader) PageSize() uint32

func (*FileHeader) Signature

func (self *FileHeader) Signature() *JET_SIGNATURE

func (*FileHeader) Size

func (self *FileHeader) Size() int

type Flags

type Flags struct {
	Value uint64
	Names map[string]bool
}

func (Flags) DebugString

func (self Flags) DebugString() string

func (Flags) IsSet

func (self Flags) IsSet(flag string) bool

func (Flags) Values

func (self Flags) Values() []string

type GUID

type GUID struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (GUID) AsString

func (self GUID) AsString() string

func (*GUID) Data1

func (self *GUID) Data1() uint32

func (*GUID) Data2

func (self *GUID) Data2() uint16

func (*GUID) Data3

func (self *GUID) Data3() uint16

func (*GUID) Data4

func (self *GUID) Data4() []byte

func (*GUID) DebugString

func (self *GUID) DebugString() string

func (*GUID) Size

func (self *GUID) Size() int

type JET_LOGTIME

type JET_LOGTIME struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*JET_LOGTIME) Days

func (self *JET_LOGTIME) Days() byte

func (*JET_LOGTIME) DebugString

func (self *JET_LOGTIME) DebugString() string

func (*JET_LOGTIME) Hours

func (self *JET_LOGTIME) Hours() byte

func (*JET_LOGTIME) Min

func (self *JET_LOGTIME) Min() byte

func (*JET_LOGTIME) Month

func (self *JET_LOGTIME) Month() byte

func (*JET_LOGTIME) Sec

func (self *JET_LOGTIME) Sec() byte

func (*JET_LOGTIME) Size

func (self *JET_LOGTIME) Size() int

func (*JET_LOGTIME) Year

func (self *JET_LOGTIME) Year() byte

type JET_SIGNATURE

type JET_SIGNATURE struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*JET_SIGNATURE) Creation

func (self *JET_SIGNATURE) Creation() *JET_LOGTIME

func (*JET_SIGNATURE) CreatorMachine

func (self *JET_SIGNATURE) CreatorMachine() string

func (*JET_SIGNATURE) DebugString

func (self *JET_SIGNATURE) DebugString() string

func (*JET_SIGNATURE) Size

func (self *JET_SIGNATURE) Size() int

type Key

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

func (*Key) DebugString

func (self *Key) DebugString() string

func (*Key) EndOffset

func (self *Key) EndOffset() uint64

func (*Key) Key

func (self *Key) Key() string

type LVKEY32

type LVKEY32 struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*LVKEY32) DebugString

func (self *LVKEY32) DebugString() string

func (*LVKEY32) Lid

func (self *LVKEY32) Lid() uint32

func (*LVKEY32) SegmentOffset

func (self *LVKEY32) SegmentOffset() uint32

func (*LVKEY32) Size

func (self *LVKEY32) Size() int

type LVKEY64

type LVKEY64 struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*LVKEY64) DebugString

func (self *LVKEY64) DebugString() string

func (*LVKEY64) Lid

func (self *LVKEY64) Lid() uint64

func (*LVKEY64) SegmentOffset

func (self *LVKEY64) SegmentOffset() uint32

func (*LVKEY64) Size

func (self *LVKEY64) Size() int

type LVKEY_BUFFER

type LVKEY_BUFFER struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*LVKEY_BUFFER) DebugString

func (self *LVKEY_BUFFER) DebugString() string

func (*LVKEY_BUFFER) KeyBuffer

func (self *LVKEY_BUFFER) KeyBuffer() string

func (*LVKEY_BUFFER) ParseKey

func (self *LVKEY_BUFFER) ParseKey(ctx *ESEContext, header *PageHeader, value *Value) (key Key)

func (*LVKEY_BUFFER) PrefixLength

func (self *LVKEY_BUFFER) PrefixLength() uint16

func (*LVKEY_BUFFER) Size

func (self *LVKEY_BUFFER) Size() int

func (*LVKEY_BUFFER) SuffixLength

func (self *LVKEY_BUFFER) SuffixLength() uint16

type LongValue

type LongValue struct {
	Value *Value

	// Calculated key for this long value object.
	Key Key
	// contains filtered or unexported fields
}

func (*LongValue) Buffer

func (self *LongValue) Buffer() []byte

func (*LongValue) Reader

func (self *LongValue) Reader() io.ReaderAt

type LongValueLookup

type LongValueLookup map[string]*LongValue

func NewLongValueLookup

func NewLongValueLookup() LongValueLookup

func (LongValueLookup) GetLid

func (self LongValueLookup) GetLid(lid []byte) ([]byte, bool)

This can potentially return a lot of data

type Misc

type Misc struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*Misc) DebugString

func (self *Misc) DebugString() string

func (*Misc) Misc

func (self *Misc) Misc() int32

func (*Misc) Misc2

func (self *Misc) Misc2() int16

func (*Misc) Misc3

func (self *Misc) Misc3() int64

func (*Misc) Misc4

func (self *Misc) Misc4() string

func (*Misc) Misc5

func (self *Misc) Misc5() uint64

func (*Misc) Size

func (self *Misc) Size() int

type OffsetReader

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

func (OffsetReader) ReadAt

func (self OffsetReader) ReadAt(buff []byte, off int64) (int, error)
type PageHeader struct {
	*PageHeader_
	// contains filtered or unexported fields
}

func (*PageHeader) EndOffset

func (self *PageHeader) EndOffset(ctx *ESEContext) int64

func (*PageHeader) ExternalValue

func (self *PageHeader) ExternalValue(ctx *ESEContext) *Value

The External value is the zero'th tag

func (*PageHeader) ExternalValueBytes

func (self *PageHeader) ExternalValueBytes(ctx *ESEContext) []byte

func (*PageHeader) IsBranch

func (self *PageHeader) IsBranch() bool

func (*PageHeader) IsLeaf

func (self *PageHeader) IsLeaf() bool

type PageHeader_

type PageHeader_ struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*PageHeader_) AvailableDataOffset

func (self *PageHeader_) AvailableDataOffset() uint16

func (*PageHeader_) AvailableDataSize

func (self *PageHeader_) AvailableDataSize() uint16

func (*PageHeader_) AvailablePageTag

func (self *PageHeader_) AvailablePageTag() uint16

func (*PageHeader_) DebugString

func (self *PageHeader_) DebugString() string

func (*PageHeader_) FatherPage

func (self *PageHeader_) FatherPage() uint32

func (*PageHeader_) Flags

func (self *PageHeader_) Flags() *Flags

func (*PageHeader_) LastModified

func (self *PageHeader_) LastModified() *DBTime

func (*PageHeader_) NextPageNumber

func (self *PageHeader_) NextPageNumber() uint32

func (*PageHeader_) PreviousPageNumber

func (self *PageHeader_) PreviousPageNumber() uint32

func (*PageHeader_) Size

func (self *PageHeader_) Size() int

type RecordTag

type RecordTag struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*RecordTag) DebugString

func (self *RecordTag) DebugString() string

func (*RecordTag) FlagSkip

func (self *RecordTag) FlagSkip() uint64

func (*RecordTag) Identifier

func (self *RecordTag) Identifier() uint16

func (*RecordTag) Size

func (self *RecordTag) Size() int

func (*RecordTag) TagData

func (self *RecordTag) TagData() uint16

type Table

type Table struct {
	Header               *CATALOG_TYPE_TABLE
	FatherDataPageNumber uint32
	Name                 string
	Columns              []*ColumnSpec
	Indexes              *ordereddict.Dict
	LongValueLookup      LongValueLookup
	// contains filtered or unexported fields
}

func (*Table) ParseMultiValue

func (self *Table) ParseMultiValue(buffer []byte, parseFn func([]byte) any, fLongValue bool, fCompressed bool) []any

func (*Table) ParseTaggedValueWithPrimitiveDecoder

func (self *Table) ParseTaggedValueWithPrimitiveDecoder(ctx *ESEContext, value TaggedValue, parseFn func([]byte) any) any

type Tag

type Tag struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *ESEProfile
}

func (*Tag) DebugString

func (self *Tag) DebugString() string

func (*Tag) FFlags

func (self *Tag) FFlags() uint16

func (*Tag) Flags

func (self *Tag) Flags() *Flags

func (*Tag) Flags_

func (self *Tag) Flags_() uint16

func (*Tag) Size

func (self *Tag) Size() int

func (*Tag) ValueOffsetInPage

func (self *Tag) ValueOffsetInPage(ctx *ESEContext, page *PageHeader) int64

func (*Tag) ValueSize

func (self *Tag) ValueSize(ctx *ESEContext) uint16

type TaggedValue

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

Tagged values are used to store sparse values.

They consist of an array of RecordTag, each RecordTag has an Identifier and an offset to the start of its data. The length of the data in each record is determine by the start of the next record.

Example:

00000050 00 01 0c 40 a4 01 21 00 a5 01 23 00 01 6c 00 61 |...@..!...#..l.a| 00000060 00 62 00 5c 00 64 00 63 00 2d 00 31 00 24 00 00 |.b.\.d.c.-.1.$..| 00000070 00 3d 00 f9 00 |.=...|

Slice is 0x50-0x75 00010c40a4012100a5012300016c00610062005c00640063002d003100240000003d00f900 Consumed 0x15 bytes of TAGGED space from 0xc to 0x21 for tag 0x100 Consumed 0x2 bytes of TAGGED space from 0x21 to 0x23 for tag 0x1a4 Consumed 0x2 bytes of TAGGED space from 0x23 to 0x25 for tag 0x1a5

type Value

type Value struct {
	Tag    *Tag
	PageID int64
	Flags  uint64

	BufferOffset int64
	BufferSize   int64
	// contains filtered or unexported fields
}

TODO: This is called LINE in the MS code. It represents a single node in the page. Depending on the page type it needs to be further parsed.

func GetPageValues

func GetPageValues(ctx *ESEContext, header *PageHeader, id int64) []*Value

func NewReaderValue

func NewReaderValue(ctx *ESEContext, tag *Tag, PageID int64,
	reader io.ReaderAt, start, length int64) *Value

func (*Value) GetBuffer

func (self *Value) GetBuffer() []byte

func (*Value) Reader

func (self *Value) Reader() io.ReaderAt

Jump to

Keyboard shortcuts

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