Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 615 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 615 Bytes

Golang Cabinet File Parser

This package provides a simple parser for Microsoft Cabinet (.cab) files, written in Golang.

Example

package main

import (
	"io"
	"os"
	
	"github.com/secDre4mer/go-cab"
)

func main() {
	file, _ := os.Open("path/to/cabfile.cab")
	defer file.Close()
	info, _ := file.Stat()
	
	cabinetFile, _ := cab.Open(file, info.Size())

	for _, file := range cabinetFile.Files {
		reader, _ := file.Open()
		_, _ = io.Copy(os.Stdout, reader)
	}
}

For simplicity's sake, error handling is omitted in this example.

Limitations

  • Cabinet that span multiple files are not supported