=============================================================================== DriverPilot 1.0.0 Driver Safety Center -- Windows .inf driver package parser and inventory differ =============================================================================== WHAT IT IS DriverPilot reads Windows .inf driver package files, builds an inventory of a driver folder, and diffs two inventories so you can see exactly which driver packages were added, removed, upgraded or downgraded between two points in time. Take an inventory before a driver update and another one after, diff them, and you have a precise record of what changed. Windows .inf files are plain-text INI-style files, so DriverPilot works on any platform against any folder of driver packages. It needs no privileged APIs and no Windows. ------------------------------------------------------------------------------- WHAT IS IMPLEMENTED ------------------------------------------------------------------------------- * A real .inf parser: - INI-style [Section] headers, "key = value" pairs, ';' comments (comments are honoured inside quoted strings correctly). - Line continuations (a trailing backslash after a comma, space or '='). - Section names, key names and cross-references between them are all CASE-INSENSITIVE, as the INF format requires. - %Token% references are resolved from the [Strings] section, including localised [Strings.0409]-style sections. * Encoding detection. Real-world .inf files are frequently UTF-16LE. The parser detects and decodes: - UTF-16LE with BOM (FF FE) - UTF-16BE with BOM (FE FF) - UTF-8 with BOM (EF BB BF) - UTF-8 without BOM - BOM-less UTF-16LE, by heuristic - legacy single-byte (ANSI) content as a fallback Genuinely binary content is rejected with a clear message rather than producing garbage. * Field extraction per package: Provider, Class, ClassGuid, CatalogFile, DriverVer (BOTH the date and the dotted version, parsed separately), every [Manufacturer] entry with the models sections it targets, every model with its install section and description, and every hardware ID found on the right-hand side of the model lines (several comma-separated IDs per line are all captured). * Inventory of a whole driver folder, optionally recursive, written as JSON. A file that fails to parse is recorded as an individual failure; it never aborts the scan. Every other .inf is still inventoried. * Diff of two inventories, reporting ADDED, REMOVED and version changes. Identity is provider + class + hardware ID. Version comparison is NUMERIC PER COMPONENT, so 10.0.1.0 is correctly newer than 9.9.9.9 and 1.2.10 is correctly newer than 1.2.9. A naive string sort gets both of those backwards. Each change is labelled UPGRADED, DOWNGRADED, or REDATED (same version, different DriverVer date). * Quality check over a driver folder, reporting: - .inf files that fail to parse - packages with no DriverVer at all - packages whose CatalogFile is referenced but is ABSENT from the folder (an incomplete or unsigned package) - hardware IDs claimed by more than one package in the same folder * --json on every command, for scripting. * DriverPilot is strictly READ-ONLY with respect to driver files. It only ever writes the inventory file you name with --out. ------------------------------------------------------------------------------- WHAT IS *NOT* IMPLEMENTED ------------------------------------------------------------------------------- Read this part. DriverPilot parses driver PACKAGE FILES on disk. It is not a driver management tool. * It does NOT talk to the live Windows driver store. It does not enumerate installed drivers, does not read DriverStore\FileRepository state, does not query PnP, SetupAPI, CIM/WMI or the registry. Pointing it at a folder tells you what is in that FOLDER, not what Windows has actually installed or which driver is currently bound to a device. * It does NOT install, update, remove, roll back, stage, import or export drivers. It changes nothing about your system. * It does NOT verify SIGNATURES. It does not check Authenticode, does not validate the contents of a .cat catalog, does not check certificate chains, timestamps or WHQL status. The only catalog-related thing it does is notice that a .inf references a CatalogFile that is not present in the folder. A package that passes that check is NOT thereby signed, trusted or valid. * It does NOT verify the rest of the package: it does not confirm that the .sys/.dll files listed in CopyFiles exist, does not check file hashes, and does not evaluate whether an install section is correct or complete. * It does NOT decide which driver Windows would actually rank highest for a device. Hardware ID matching here is exact-string, not PnP rank order. * It does NOT parse every INF directive. Sections such as [DestinationDirs], [DDInstall.Services], [AddReg] and [SourceDisksFiles] are lexed but not interpreted. * A DriverVer date is reported as the literal text found in the file. It is not validated, normalised, or compared. Only the dotted version is used to decide upgrade direction. ------------------------------------------------------------------------------- USAGE ------------------------------------------------------------------------------- driverpilot [options] parse [--json] Parse one .inf and report Provider, Class, ClassGuid, DriverVer date and version, CatalogFile, the [Manufacturer] entries and every hardware ID found in the model sections. inventory [--recursive] --out [--json] Parse every .inf in a directory into one inventory file. Use --recursive to descend into subdirectories. Parse failures are reported per file and do not abort the scan. diff --before --after [--json] Compare two inventories produced by "inventory". check [--json] Quality report over a driver folder. Always scans recursively. help, -h, --help Show help on stdout and exit 0. version Print the version. Flags may appear before or after the positional argument; both orders work. EXIT CODES 0 success, and for "check" no findings 1 usage error, or an input that could not be read or parsed 2 "check" completed and found at least one finding EXAMPLES driverpilot parse C:\drivers\net\acmenet.inf driverpilot parse ./acmenet.inf --json driverpilot inventory ./drivers --recursive --out before.json ... apply your driver update ... driverpilot inventory ./drivers --recursive --out after.json driverpilot diff --before before.json --after after.json driverpilot check ./drivers driverpilot check ./drivers --json > report.json ------------------------------------------------------------------------------- INVENTORY FILE FORMAT ------------------------------------------------------------------------------- The file written by --out is JSON with a stable shape: tool "driverpilot" version tool version that produced it format integer format version (currently 1) generated RFC3339 UTC timestamp root the directory that was scanned recursive whether the scan descended into subdirectories packages[] one entry per .inf that parsed, with file, encoding, sizeBytes, provider, class, classGuid, driverVerDate, driverVerVersion, catalogFile, manufacturers[], models[] and hardwareIds[] failures[] one entry per .inf that did not parse, with file and error "diff" only accepts files carrying tool = "driverpilot". ------------------------------------------------------------------------------- BUILDING ------------------------------------------------------------------------------- Go standard library only. No third-party dependencies, no network access needed to build. go build -o driverpilot . Cross-compiling: GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dist/driverpilot-windows-amd64.exe . GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o dist/driverpilot-darwin-arm64 . GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o dist/driverpilot-darwin-amd64 . GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/driverpilot-linux-amd64 . ------------------------------------------------------------------------------- ROADMAP ------------------------------------------------------------------------------- * Live driver-store enumeration on Windows via SetupAPI, so an inventory can describe what is actually installed rather than what is sitting in a folder. * Real signature verification: Authenticode and catalog validation, including certificate chain and timestamp checks and WHQL status. * Backup and rollback of installed drivers, so a bad update can be reverted from a DriverPilot snapshot. * Update checking against vendor catalogs, to report when an inventoried package is behind the vendor's current release. ===============================================================================