package main import ( "fmt" "git.cheetah.cat/cheetah/moto-flash-data/motolol/cpe" ) func main() { //, err := cpe.NewReader("../testdata/20230825-2021-dmosck-SN[121TUL1221]_TEI[00016C9C2238810]_ISSI[133705]_CP[1020]_SW[R35.010.9426]_USB1.cpe") test, err := cpe.NewReader("../testdata/20231023-Transceiver-pei115200_SN[938TSG4891]_TEI[000148231294920]_ISSI[133706]_CP[1511]_SW[R27.000.9840]_USB2.cpe") if err != nil { panic(err) } defer test.Close() err = test.ValidateHeader() if err != nil { panic(err) } err = test.ReadData() if err != nil { panic(err) } for _, seg := range test.Metadata.Segments { fmt.Printf("Segment Found: %s (%d bytes)\n", seg.Name, seg.Size) } fmt.Println("all alright") // cp, err := cp.NewReader("./output.cpe.test") // if err != nil { // panic(err) // } // defer cp.Close() // err = cp.Test() // if err != nil { // panic(err) // } }