Skip to content

unable to parse the buffer entry name #8

@RRancio

Description

@RRancio

hello!, i've experienced some issues while trying to read the $FILE_NAME attribute, it just doesn't send me any character and remains with 0 data in the whole $MFT

C:\Users\Lucas\Documents\Golang\mfttest>main.exe C:\Users\Lucas\Downloads\MFTECmd\xd.jaja
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
 0
package main

import (
   "errors"
   "fmt"
   "io"
   "log"
   "os"

   "github.com/t9t/gomft/mft"
)

func main() {
   f, err := os.Open(os.Args[1])
   if err != nil {
   	log.Fatalln("Unable to open file", err)
   }
   defer f.Close()

   recordSize := 1024
   for {
   	buf := make([]byte, recordSize)
   	_, err := io.ReadFull(f, buf)
   	if err != nil {
   		if errors.Is(err, io.EOF) {
   			break
   		}
   		log.Fatalln("Unable to read record data", err)
   	}

   	jaja, err := mft.ParseFileName(buf)
   	if err != nil {
   		continue
   	}
   	fmt.Println(jaja.Name, len(jaja.Name))

   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions