parser

package
v0.0.0-...-a941913 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(arg interface{})

func DlvBreak

func DlvBreak()

func GetComponents

func GetComponents(path string) []string

func ParseString

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

func ParseTerminatedString

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

func ParseTerminatedUTF16String

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

func ParseUTF16String

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

func ParseUint16

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

func ParseUint32

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

func ParseUint8

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

func UTF16BytesToUTF8

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

Types

type DirectoryEntry

type DirectoryEntry struct {
	Name         string
	ShortName    string
	Size         uint64
	Mtime        time.Time
	Atime        time.Time
	Ctime        time.Time
	Attribute    *ordereddict.Dict
	IsDir        bool
	IsDeleted    bool
	FirstCluster int32
}

type DirectoryListing

type DirectoryListing struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *FATProfile
	// contains filtered or unexported fields
}

func (*DirectoryListing) DebugString

func (self *DirectoryListing) DebugString() string

func (*DirectoryListing) Entries

func (self *DirectoryListing) Entries() []*FolderEntry

func (*DirectoryListing) Size

func (self *DirectoryListing) Size() int

type FAT32MBR

type FAT32MBR struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *FATProfile
	// contains filtered or unexported fields
}

func (*FAT32MBR) ClusterOfRoot

func (self *FAT32MBR) ClusterOfRoot() uint32

func (*FAT32MBR) DebugString

func (self *FAT32MBR) DebugString() string

func (*FAT32MBR) Flags

func (self *FAT32MBR) Flags() uint16

func (*FAT32MBR) Magic

func (self *FAT32MBR) Magic() uint16

func (*FAT32MBR) SectorsPerFat

func (self *FAT32MBR) SectorsPerFat() uint32

func (*FAT32MBR) Signature

func (self *FAT32MBR) Signature() byte

func (*FAT32MBR) Size

func (self *FAT32MBR) Size() int

func (*FAT32MBR) System_id

func (self *FAT32MBR) System_id() string

func (*FAT32MBR) Version

func (self *FAT32MBR) Version() uint16

func (*FAT32MBR) Volume_label

func (self *FAT32MBR) Volume_label() string

func (*FAT32MBR) Volume_serial_number

func (self *FAT32MBR) Volume_serial_number() uint32

type FATContext

type FATContext struct {
	DiskReader        io.ReaderAt
	Profile           *FATProfile
	MBR               *MBR
	FAT32MBR          *FAT32MBR
	Bytes_per_cluster int64

	Bytes_per_sector    int64
	Sectors_per_cluster int64
	// contains filtered or unexported fields
}

func GetFATContext

func GetFATContext(reader io.ReaderAt) (*FATContext, error)

func (*FATContext) DebugString

func (self *FATContext) DebugString() string

func (*FATContext) FATType

func (self *FATContext) FATType() string

func (*FATContext) ICat

func (self *FATContext) ICat(first_cluster int32) (io.ReaderAt, error)

func (*FATContext) ListDirectory

func (self *FATContext) ListDirectory(path string) ([]*DirectoryEntry, error)

func (*FATContext) Open

func (self *FATContext) Open(path string) (*FATReader, error)

func (*FATContext) Stat

func (self *FATContext) Stat(path string) (*DirectoryEntry, error)

type FATProfile

type FATProfile struct {
	Off_DirectoryListing_Entries            int64
	Off_FAT32MBR_SectorsPerFat              int64
	Off_FAT32MBR_Flags                      int64
	Off_FAT32MBR_Version                    int64
	Off_FAT32MBR_ClusterOfRoot              int64
	Off_FAT32MBR_Signature                  int64
	Off_FAT32MBR_Volume_serial_number       int64
	Off_FAT32MBR_Volume_label               int64
	Off_FAT32MBR_System_id                  int64
	Off_FAT32MBR_Magic                      int64
	Off_FolderEntry_Name                    int64
	Off_FolderEntry_Attribute               int64
	Off_FolderEntry__CreateTimeTenthSeconds int64
	Off_FolderEntry__CreateTime             int64
	Off_FolderEntry__CreateDate             int64
	Off_FolderEntry__LastAccessDate         int64
	Off_FolderEntry__ClusterHigh            int64
	Off_FolderEntry__LastModTime            int64
	Off_FolderEntry__LastModDate            int64
	Off_FolderEntry__ClusterLow             int64
	Off_FolderEntry_FileSize                int64
	Off_LFNEntry_Order                      int64
	Off_LFNEntry_Name1                      int64
	Off_LFNEntry_Name2                      int64
	Off_LFNEntry_Name3                      int64
	Off_MBR_Oemname                         int64
	Off_MBR_Bytes_per_sector                int64
	Off_MBR_Sectors_per_cluster             int64
	Off_MBR_Reserved_sectors                int64
	Off_MBR_Number_of_fats                  int64
	Off_MBR_Root_entries                    int64
	Off_MBR_Small_sectors                   int64
	Off_MBR_Sectors_per_fat                 int64
	Off_MBR_Large_sectors                   int64
	Off_MBR_Signature                       int64
	Off_MBR_Volume_serial_number            int64
	Off_MBR_Volume_label                    int64
	Off_MBR_System_id                       int64
	Off_MBR_Magic                           int64
}

func NewFATProfile

func NewFATProfile() *FATProfile

func (*FATProfile) DirectoryListing

func (self *FATProfile) DirectoryListing(reader io.ReaderAt, offset int64) *DirectoryListing

func (*FATProfile) FAT32MBR

func (self *FATProfile) FAT32MBR(reader io.ReaderAt, offset int64) *FAT32MBR

func (*FATProfile) FolderEntry

func (self *FATProfile) FolderEntry(reader io.ReaderAt, offset int64) *FolderEntry

func (*FATProfile) LFNEntry

func (self *FATProfile) LFNEntry(reader io.ReaderAt, offset int64) *LFNEntry

func (*FATProfile) MBR

func (self *FATProfile) MBR(reader io.ReaderAt, offset int64) *MBR

type FATReader

type FATReader struct {

	// If present this is the directory we have
	Info *DirectoryEntry
	// contains filtered or unexported fields
}

func NewFATReader

func NewFATReader(context *FATContext, first_cluster int32) (*FATReader, error)

func (*FATReader) ReadAt

func (self *FATReader) ReadAt(buff []byte, off int64) (int, error)

func (*FATReader) Runs

func (self *FATReader) Runs() []int64

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 FolderEntry

type FolderEntry struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *FATProfile
	// contains filtered or unexported fields
}

func ParseArray_FolderEntry

func ParseArray_FolderEntry(profile *FATProfile, reader io.ReaderAt, offset int64, count int) []*FolderEntry

func (*FolderEntry) Attribute

func (self *FolderEntry) Attribute() *Flags

func (*FolderEntry) DebugString

func (self *FolderEntry) DebugString() string

func (*FolderEntry) FileSize

func (self *FolderEntry) FileSize() uint32

func (*FolderEntry) Name

func (self *FolderEntry) Name() string

func (*FolderEntry) Size

func (self *FolderEntry) Size() int

type LFNEntry

type LFNEntry struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *FATProfile
	// contains filtered or unexported fields
}

func (*LFNEntry) DebugString

func (self *LFNEntry) DebugString() string

func (*LFNEntry) Name1

func (self *LFNEntry) Name1() string

func (*LFNEntry) Name2

func (self *LFNEntry) Name2() string

func (*LFNEntry) Name3

func (self *LFNEntry) Name3() string

func (*LFNEntry) Order

func (self *LFNEntry) Order() byte

func (*LFNEntry) Size

func (self *LFNEntry) Size() int

type MBR

type MBR struct {
	Reader  io.ReaderAt
	Offset  int64
	Profile *FATProfile
	// contains filtered or unexported fields
}

func (*MBR) Bytes_per_sector

func (self *MBR) Bytes_per_sector() uint16

func (*MBR) DebugString

func (self *MBR) DebugString() string

func (*MBR) Large_sectors

func (self *MBR) Large_sectors() uint32

func (*MBR) Magic

func (self *MBR) Magic() uint16

func (*MBR) Number_of_fats

func (self *MBR) Number_of_fats() byte

func (*MBR) Oemname

func (self *MBR) Oemname() string

func (*MBR) Reserved_sectors

func (self *MBR) Reserved_sectors() uint16

func (*MBR) Root_entries

func (self *MBR) Root_entries() uint16

func (*MBR) Sectors_per_cluster

func (self *MBR) Sectors_per_cluster() byte

func (*MBR) Sectors_per_fat

func (self *MBR) Sectors_per_fat() uint16

func (*MBR) Signature

func (self *MBR) Signature() byte

func (*MBR) Size

func (self *MBR) Size() int

func (*MBR) Small_sectors

func (self *MBR) Small_sectors() uint16

func (*MBR) System_id

func (self *MBR) System_id() string

func (*MBR) Volume_label

func (self *MBR) Volume_label() string

func (*MBR) Volume_serial_number

func (self *MBR) Volume_serial_number() uint32

Jump to

Keyboard shortcuts

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