Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CRCMode ¶
type CRCMode int64
CRCMode represent whether or not CRC is present at the end of the firmware
type FileEntry ¶
FileEntry contains the complete file path, file start in sector, file size in bytes
type Firmware ¶
type Firmware struct { File *os.File Reader *bufio.Reader Path string Header Structure Files []FileEntry }
Firmware represent the firmware file
func (*Firmware) ReadHeader ¶
ReadHeader takes in input the path of a Fiio firmware file and reads header information into a Structure struct.
This function will return the reader initialized, with the seek pointer already pointing at the file list.
type Structure ¶
type Structure struct { HeaderStartToken string // offset 0x0, length 4 - confirmed FilesystemSectors int64 // offset 0x4, length 4 - unsure HeaderSize int64 // offset 0x8, length 4 - unsure CreationTime time.Time // offset 0x10, length 12 - confirmed NumberOfFiles int64 // offset 0x1c, length 4 - confirmed CRC CRCMode // offset 0x20, length 4 - confirmed but always true MachineString string // offset 0x30, length 8 - confirmed FilesystemSizeBytes int64 // not sure FilesystemSectorSize int64 // confirmed, always 512 }
Structure represents the firmware header
Click to show internal directories.
Click to hide internal directories.