|
|
@ -20,6 +20,7 @@ type MFTFile struct {
|
|
|
|
Path string
|
|
|
|
Path string
|
|
|
|
ModTime time.Time
|
|
|
|
ModTime time.Time
|
|
|
|
Size uint64
|
|
|
|
Size uint64
|
|
|
|
|
|
|
|
Aszie uint64
|
|
|
|
IsDir bool
|
|
|
|
IsDir bool
|
|
|
|
Node uint64
|
|
|
|
Node uint64
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -69,16 +70,20 @@ func GetFileListsByMftFn(driver string, fn func(string, bool) bool) ([]MFTFile,
|
|
|
|
parent := uint64(0)
|
|
|
|
parent := uint64(0)
|
|
|
|
for _, v := range record.Attributes {
|
|
|
|
for _, v := range record.Attributes {
|
|
|
|
if v.Type == mft.AttributeTypeFileName {
|
|
|
|
if v.Type == mft.AttributeTypeFileName {
|
|
|
|
if file.Name != "" {
|
|
|
|
name := utf16.DecodeString(v.Data[66:], binary.LittleEndian)
|
|
|
|
|
|
|
|
if len(file.Name) < len(name) && len(name) > 0 {
|
|
|
|
|
|
|
|
if len(name) > 2 && name[len(name)-2] == '~' {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
file.Name = utf16.DecodeString(v.Data[66:], binary.LittleEndian)
|
|
|
|
file.Name = name
|
|
|
|
|
|
|
|
}
|
|
|
|
if file.Name != "" {
|
|
|
|
if file.Name != "" {
|
|
|
|
parent = binutil.NewLittleEndianReader(v.Data[:8]).Uint64(0)
|
|
|
|
parent = binutil.NewLittleEndianReader(v.Data[:8]).Uint64(0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if v.Type == mft.AttributeTypeData {
|
|
|
|
if v.Type == mft.AttributeTypeData {
|
|
|
|
file.Size = v.ActualSize
|
|
|
|
file.Size = v.ActualSize
|
|
|
|
|
|
|
|
file.Aszie = v.AllocatedSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if v.Type == mft.AttributeTypeStandardInformation {
|
|
|
|
if v.Type == mft.AttributeTypeStandardInformation {
|
|
|
|
if len(v.Data) < 48 {
|
|
|
|
if len(v.Data) < 48 {
|
|
|
@ -168,16 +173,20 @@ func GetFileListsFromMftFileFn(filepath string, fn func(string, bool) bool) ([]M
|
|
|
|
parent := uint64(0)
|
|
|
|
parent := uint64(0)
|
|
|
|
for _, v := range record.Attributes {
|
|
|
|
for _, v := range record.Attributes {
|
|
|
|
if v.Type == mft.AttributeTypeFileName {
|
|
|
|
if v.Type == mft.AttributeTypeFileName {
|
|
|
|
if file.Name != "" {
|
|
|
|
name := utf16.DecodeString(v.Data[66:], binary.LittleEndian)
|
|
|
|
|
|
|
|
if len(file.Name) < len(name) && len(name) > 0 {
|
|
|
|
|
|
|
|
if len(name) > 2 && name[len(name)-2] == '~' {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
file.Name = utf16.DecodeString(v.Data[66:], binary.LittleEndian)
|
|
|
|
file.Name = name
|
|
|
|
|
|
|
|
}
|
|
|
|
if file.Name != "" {
|
|
|
|
if file.Name != "" {
|
|
|
|
parent = binutil.NewLittleEndianReader(v.Data[:8]).Uint64(0)
|
|
|
|
parent = binutil.NewLittleEndianReader(v.Data[:8]).Uint64(0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if v.Type == mft.AttributeTypeData {
|
|
|
|
if v.Type == mft.AttributeTypeData {
|
|
|
|
file.Size = v.ActualSize
|
|
|
|
file.Size = v.ActualSize
|
|
|
|
|
|
|
|
file.Aszie = v.AllocatedSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if v.Type == mft.AttributeTypeStandardInformation {
|
|
|
|
if v.Type == mft.AttributeTypeStandardInformation {
|
|
|
|
if len(v.Data) < 48 {
|
|
|
|
if len(v.Data) < 48 {
|
|
|
|