There’s a relatively-new UEFI library, which appears to have been created by Microsoft Project Mu, and later upstreamed to Tianocore. There’s a related extension project as well. This code would be useful for tools analyzing UEFI binaries and source projects.
Tianocore Edk2 PyTool Library (edk2toollib) is a Tianocore maintained project consisting of a python library supporting UEFI firmware development. This package’s intent is to provide an easy way to organize and share python code to facilitate reuse across environments, tools, and scripts. […] The package contains classes and modules that can be used as the building blocks of tools that are relevant to UEFI firmware developers. […] Examples:
- File parsers for edk2 specific file types. These parse the file and provide an object for interacting with the content.
- UEFI specific services for encoding/decoding binary structures.
- UEFI defined values and interfaces for usage in python
- Python wrappers for other system cli tools ( signtool, catalog file generation, inf file generation, etc)
- Python utilities to provide consistent logging, command invocation, path resolution, etc
https://github.com/tianocore/edk2-pytool-library