Metadata-Version: 2.5
Name: amd-ucode-patch
Version: 2.0.0
Summary: A Python library for parsing and interpreting AMD microcode patch files
Project-URL: Homepage, https://github.com/amd-zenith/amd-ucode-patch
Project-URL: Repository, https://github.com/amd-zenith/amd-ucode-patch
Project-URL: Issues, https://github.com/amd-zenith/amd-ucode-patch/issues
Author: Kaya Erchiran
Author-email: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
License-Expression: GPL-2.0-or-later
License-File: LICENSE.md
Keywords: amd,microcode,parser,patch,ucode,x86
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: amd-cpuid==1.0.2
Requires-Dist: pycryptodome==3.23.0
Requires-Dist: rich==15.0.0
Description-Content-Type: text/markdown

# AMD Microcode Patch

[![Build](https://github.com/amd-zenith/amd-ucode-patch/actions/workflows/build.yml/badge.svg)](https://github.com/amd-zenith/amd-ucode-patch/actions/workflows/build.yml)
[![CodeQL](https://github.com/amd-zenith/amd-ucode-patch/actions/workflows/codeql.yml/badge.svg)](https://github.com/amd-zenith/amd-ucode-patch/actions/workflows/codeql.yml)
[![PyPI version](https://img.shields.io/pypi/v/amd-ucode-patch.svg)](https://pypi.org/project/amd-ucode-patch/)
[![Python versions](https://img.shields.io/pypi/pyversions/amd-ucode-patch.svg)](https://pypi.org/project/amd-ucode-patch/)
[![Snyk package health](https://img.shields.io/badge/Snyk-package%20health-4C4A73?logo=snyk&logoColor=white)](https://snyk.io/advisor/python/amd-ucode-patch)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/amd-zenith/amd-ucode-patch/badge)](https://scorecard.dev/viewer/?uri=github.com/amd-zenith/amd-ucode-patch)

A Python library for parsing and interpreting AMD microcode patch files.

## Installation

```bash
pip install amd-ucode-patch
```

## Command line tools

Installing the package provides the following command line tools. Run any tool
with `--help` for usage details.

| Tool                   | Description                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------- |
| `amd_ucode_patch_info` | Inspect patch files and print their decoded fields as a table (text, Markdown or CSV). |
| `amd_ucode_patch_sign` | Inspect, verify (`verify`) and re-sign (`resign`) patch signatures.                    |

## Library usage

The package can also be used programmatically:

```python
from pathlib import Path
from amd_ucode_patch.structures.patch import Patch

patch = Patch.from_file(Path("firmware.bin"))
print(patch.header.patch_level)                          # e.g. 0a000033
print(f"{patch.header.data.cpuid.cpuid_signature:08X}")  # e.g. 00A00F00
print(patch.name_canonical)                              # canonical filename
```
