mft function rewrite
This commit is contained in:
+2
-4
@@ -5,7 +5,6 @@ import (
|
||||
"b612.me/wincmd/ntfs/fragment"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/t9t/gomft/mft"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
@@ -13,7 +12,6 @@ import (
|
||||
|
||||
const supportedOemId = "NTFS "
|
||||
|
||||
|
||||
const isWin = runtime.GOOS == "windows"
|
||||
|
||||
func GetMFTFileBytes(volume string) ([]byte, error) {
|
||||
@@ -85,12 +83,12 @@ func GetMFTFile(volume string) (io.Reader, int64, error) {
|
||||
return nil, 0, fmt.Errorf("Unable to read $MFT record: %v\n", err)
|
||||
}
|
||||
|
||||
record, err := mft.ParseRecord(mftData)
|
||||
record, err := ParseRecord(mftData)
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("Unable to parse $MFT record: %v\n", err)
|
||||
}
|
||||
|
||||
dataAttributes := record.FindAttributes(mft.AttributeTypeData)
|
||||
dataAttributes := record.FindAttributes(AttributeTypeData)
|
||||
if len(dataAttributes) == 0 {
|
||||
return nil, 0, fmt.Errorf("No $DATA attribute found in $MFT record\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user