{"id":13798368,"url":"https://github.com/Vector35/efi-resolver","last_synced_at":"2025-05-13T05:32:04.376Z","repository":{"id":175490645,"uuid":"653873241","full_name":"Vector35/efi-resolver","owner":"Vector35","description":"A Binary Ninja plugin that automatically resolves type information for EFI protocol usage.","archived":false,"fork":false,"pushed_at":"2025-04-09T13:39:14.000Z","size":104,"stargazers_count":37,"open_issues_count":10,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-08T10:11:56.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vector35.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-14T23:44:54.000Z","updated_at":"2025-04-09T13:36:15.000Z","dependencies_parsed_at":"2024-05-06T15:53:53.493Z","dependency_job_id":"51ad3a82-9c48-4699-b509-fbf9168d1de3","html_url":"https://github.com/Vector35/efi-resolver","commit_stats":null,"previous_names":["vector35/efi-resolver"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fefi-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fefi-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fefi-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fefi-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vector35","download_url":"https://codeload.github.com/Vector35/efi-resolver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253883121,"owners_count":21978611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:00:42.662Z","updated_at":"2025-05-13T05:32:04.369Z","avatar_url":"https://github.com/Vector35.png","language":"Python","funding_links":[],"categories":["Tools :hammer:"],"sub_categories":[],"readme":"# EFI Resolver (v1.3.0)\nAuthor: **Vector 35 Inc**\n\n_A Binary Ninja plugin that automatically resolves type information for EFI protocol usage._\n\n## Description:\n\nEFI Resolver is a Binary Ninja plugin that automates the task of resolving EFI protocol type information. It supports both DXE files and PEI files. It propagates parameter pointers from entry points to system table, MM system table, boot services, and runtime services to any global variables where they are stored. For PEI files, it also support identifying [processor-specific mechanisms](https://uefi.org/specs/PI/1.8/V1_PEI_Foundation.html#pei-services-table-retrieval) for retrieving PEI services pointers. The plugin also identifies references to the boot services, MM protocol functions and PEI services, and applies type information according to the GUID passed to these functions. The plugin supports the core UEFI specification, but does not support vendor protocols.\n\n## Installation Instructions\n\n### Darwin\n\nno special instructions, package manager is recommended\n\n### Linux\n\nno special instructions, package manager is recommended\n\n### Windows\n\nno special instructions, package manager is recommended\n\n## Minimum Version\n\nThis plugin requires the following minimum version of Binary Ninja:\n\n* 4333\n\n## Required Dependencies\n\nThe following dependencies are required for this plugin:\n\n## License\n\nThis plugin is released under a Apache-2.0 license.\n## Metadata Version\n\n3\n\n## Supplying Custom UEFI Protocol GUIDs and Types\n\nBy default EFI Resolver propagates types and GUIDs using Binary Ninja's native platform types for EFI. Many UEFI\nfirmware binaries include types (and GUIDs) for proprietary protocols. This section describes how users can supply\ncustom UEFI types and GUIDs for use with EFI Resolver type propagation.\n\n### User-supplied EFI GUIDs\n\nEFI Resolver uses a JSON file to associate user-supplied EFI GUIDs with types for propagation. GUIDs for proprietary\nprotocol types can be used with EFI Resolver by creating a file at `\u003cuser folder\u003e/types/efi-guids.json` containing JSON\nentries in the following format:\n\n```json\n{\n  \"EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID\": [\n    19088743,\n    35243,\n    52719,\n    1,\n    35,\n    69,\n    103,\n    137,\n    171,\n    205,\n    239\n ]\n}\n```\n\nIn this example, the protocol type of `EFI_EXAMPLE_CUSTOM_PROTOCOL` is mapped to the\n`{0x01234567,0x89ab,0xcdef,{0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}}` GUID (named `EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID`).\nTo test that the file is a valid JSON file, run `python -m json.tool \u003c efi-guids.json`.\n\n__Note: user-supplied propretary GUIDs from `efi-guids.json` are used to name variables regardless of whether or not an associated platform type has been loaded. If EFI Resolver fails to query the type for an EFI protocol interface, it will set the variable type for the protocol interface pointer to `VOID*`.__\n\n### User-supplied EFI Platform Types\n\nTypes and structures for proprietary protocols are to be imported using Binary Ninja's standard mechanism for loading\nuser-supplied platform types. Instructions on adding custom platform types can be found [here](https://docs.binary.ninja/guide/types/platformtypes.html). Available EFI platform names include:\n- `efi-x86`\n- `efi-x86_64`\n- `efi-thumb2`\n- `efi-armv7`\n- `efi-aarch64`\n- `efi-windows-aarch64`\n- `efi-windows-x86`\n- `efi-windows-x86_64`\n\nTo avoid having to add duplicate types in each platform-specific `*.c` file, it is recommended to add common types\nto a top-level `efi.c` file and `#include` the file in the platform-specific `*.c` files. For example:\n\n```C\n// \u003cuser folder\u003e/types/platform/efi-x86_64.c including \u003cuser folder\u003e/types/efi.c\n#include \"../efi.c\"\n```\n\nTo test that C source files containing custom EFI platform types are in the correct format, use the `bv.platform.parse_types_from_source_file` API.\n\nAlternatively, user types can be supplied manually from type libraries, header files, or any other mechanism supported\nby Binary Ninja. Just ensure that the name for types associated with GUIDs match what is in `efi-guids.json`. Protocol\nGUID names in `efi-guids.json` should end with `_PROTOCOL_GUID` and the prefix must be identical to the associated\nprotocol type name. For example, if the GUID is named `EFI_EXAMPLE_PROTOCOL_GUID`, EFI Resolver will attempt to\nlookup a type named `EFI_EXAMPLE_PROTOCOL`.\n\n### Full Example\n\nIn summary, including a custom platform type of `EFI_EXAMPLE_CUSTOM_PROTOCOL` for the `efi-x86` platform and associating\nit with a GUID named `EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID` requires two steps:\n\n1. Create the `\u003cuser folder\u003e/types/platform/efi-x86.c` header file:\n\n```C\nstruct EFI_EXAMPLE_CUSTOM_PROTOCOL\n{\n    uint32_t length;\n}\n```\n\n2. Create the `\u003cuser folder\u003e/types/efi-guids.json` file:\n\n```json\n{\n    \"EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID\": [\n      19088743,\n      35243,\n      52719,\n      1,\n      35,\n      69,\n      103,\n      137,\n      171,\n      205,\n      239\n    ]\n}\n```\n\nAfter a Binary Ninja restart, when a binary is loaded with the `efi-x86` platform, the `EFI_EXAMPLE_CUSTOM_PROTOCOL`\ntype will be imported. When EFI Resolver runs, it will detect uses of `EFI_EXAMPLE_CUSTOM_PROTOCOL_GUID` and propagate\nthe `EFI_EXAMPLE_CUSTOM_PROTOCOL` type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVector35%2Fefi-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVector35%2Fefi-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVector35%2Fefi-resolver/lists"}