msi

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package msi parses a Windows Installer (.msi) file — a pure-Go, dependency-free reader for the OLE2 Compound File Binary Format (MS-CFB) container plus the MSI table layout on top of it — to recover the installed product's identity (name, version, manufacturer, product code) for cataloging. It resolves no external resources and never executes the installer; it only reads bytes, with hard bounds throughout so a crafted/corrupt file degrades to an error rather than exhausting memory or looping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cataloger

type Cataloger struct{}

Cataloger discovers Windows Installer (.msi) artifacts under a workspace directory and recovers each installer's product identity from its Property table, emitting one SBOM component per .msi. It never executes an installer — it only reads compound-file bytes. Best-effort: an unreadable/corrupt .msi is skipped, never fatal to the scan.

func New

func New() *Cataloger

New returns a Cataloger.

func (*Cataloger) CatalogArtifacts

func (c *Cataloger) CatalogArtifacts(ctx context.Context, dir string) ([]sbom.Component, error)

CatalogArtifacts walks dir for *.msi files and returns a component for each one whose Property table yields a product name. Directory-walk and per-file errors are swallowed (best-effort inventory); a canceled context stops the walk.

type Info

type Info struct {
	ProductName    string
	ProductVersion string
	Manufacturer   string
	ProductCode    string // {GUID}
	UpgradeCode    string // {GUID}
}

Info is the identity recovered from an MSI's Property table (the authoritative source). Fields are empty when the installer does not set the corresponding property.

func Parse

func Parse(data []byte) (Info, error)

Parse reads an MSI (.msi) file and returns the product Info from its Property table. It never resolves or executes anything — it only decodes the compound-file bytes. A non-MSI / corrupt input returns an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL