{"id":24779,"library":"uefi-firmware","title":"uefi-firmware","description":"Python library for parsing and manipulating UEFI firmware volumes, files, sections, and capsules. It supports common UEFI structures like FFS, FV, FFSv3, compressed sections, and more. The latest version on PyPI is 1.11, but the GitHub repo has releases up to 1.13. Active development with occasional updates.","status":"active","version":"1.11","language":"python","source_language":"en","source_url":"https://github.com/theopolis/uefi-firmware-parser","tags":["uefi","firmware","parsing","bios","security"],"install":[{"cmd":"pip install uefi-firmware","lang":"bash","label":"default"}],"dependencies":[{"reason":"Used for binary structure definitions and parsing.","package":"construct","optional":true},{"reason":"Used for cryptographic operations (e.g., capsule authentication).","package":"pycryptodome","optional":true}],"imports":[{"note":"AutoParser is a top-level class, not in a submodule.","wrong":"from uefi_firmware.parser import AutoParser","symbol":"AutoParser","correct":"from uefi_firmware import AutoParser"},{"note":"Common usage for low-level access.","symbol":"FirmwareVolume","correct":"from uefi_firmware.volume import FirmwareVolume"}],"quickstart":{"code":"import os\nfrom uefi_firmware import AutoParser\n\n# Path to a UEFI firmware image (e.g., a BIOS update file)\nfirmware_path = os.environ.get('FIRMWARE_PATH', 'test.rom')\nwith open(firmware_path, 'rb') as f:\n    data = f.read()\n\nparser = AutoParser(data)\nprint(f\"Parsed {len(parser.objects)} objects\")\nfor obj in parser.objects:\n    print(type(obj).__name__)","lang":"python","description":"Parses a firmware file using AutoParser and lists all recognized objects."},"warnings":[{"fix":"Use Python 3.6+ or pin to 'uefi-firmware<1.8'.","message":"Python 2 support was dropped in version 1.8. If you are still on Python 2, pin to <1.8.","severity":"breaking","affected_versions":">=1.8"},{"fix":"Install 'construct' separately if needed, and import from the 'construct' package, not from 'uefi_firmware'.","message":"The 'construct' dependency is optional but old examples may try to import directly from 'uefi_firmware.constructs'. Use 'construct' package directly if needed.","severity":"deprecated","affected_versions":"all"},{"fix":"Wrap parsing in try-except to handle parse failures, and consider using lower-level classes if AutoParser fails.","message":"AutoParser may not detect all structures in fragmented or corrupted firmware images. It will raise exceptions for invalid data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from construct import Container, Struct' etc., and install construct if needed.","cause":"Trying to import constructs submodule that doesn't exist in modern versions.","error":"ImportError: No module named 'uefi_firmware.constructs'"},{"fix":"Access parser.result instead of parser.objects.","cause":"AutoParser returns a list stored as 'result' attribute, not 'objects'.","error":"uefi_firmware.AutoParser' object has no attribute 'objects'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}