We are excited to introduce native UEFI firmware analysis support in IDA 9.5! Firmware is a prime target for persistent malware and a fertile hunting ground for vulnerabilities. It is also one of the most challenging environments in which to understand what code is actually doing.
If you've reverse-engineered the UEFI - Unified Extensible Firmware Interface - architecture before, you know the drill. First, you extract the PE32 sections from the firmware image using an external tool. Then, you load the drivers into IDA one by one, only to find that IDA treats each of them like an ordinary PE file: the boot services pointer is an anonymous qword, protocol GUIDs appear as 16 raw bytes, and calls into other modules are represented as offsets into tables you have to decipher manually. Before you can even begin investigating the interesting parts of the code, you've already spent considerable time reconstructing the context needed to make sense of it.
Over the years, some of the most advanced cybersecurity research teams have developed and generously shared powerful IDA plugins for firmware analysis, such as efiXplorer. These community contributions have helped bridge the gap between IDA's out-of-the-box capabilities and the specialized needs of firmware researchers.
Inspired by the pioneering work of Alex Matrosov, Yegor Vasilenko, and the broader REHints team, as well as other outstanding community projects, IDA 9.5 now takes care of much of that firmware analysis groundwork for you!
Simply open a complete firmware image, such as an SPI flash dump or a firmware update package, and IDA automatically loads its constituent modules. It identifies boot services, runtime services, and SMM tables, resolves protocol GUIDs into meaningful names, and applies types to the interfaces that drivers install and consume.
The result? Pseudocode that looks remarkably close to the original EDK2 source code:
v7 = DiskIoDxe_gBS->LocateProtocol(
&DiskIoDxe_gEfiDevicePathUtilitiesProtocolGuid,
nullptr,
(void **)&DiskIoDxe_gEfiDevicePathUtilitiesProtocol);
The new loader opens a firmware image into a single database. No more extracting individual PE32 sections with an external tool first. Built on UEFITool, the loader walks the firmware volumes, unpacks the compressed ones, and maps each PE or TE module at its own address.
To keep hundreds of modules manageable, the Functions window groups the code into <module kind>/<module> folders, such as DXE_DRIVER/DiskIoDxe.
Two load formats, for two address sizes. Firmware images often mix 64-bit DXE drivers with 32-bit PEI modules, while a database has a single address size. The loader therefore offers two formats: the default 64-bit load, and "UEFI firmware image, 32-bit modules" for IA32 PEI code. AArch64 images are supported as well.
Single modules work too. If you only need one driver, open the .efi file with the PE loader. It gets the same analysis described below.
Function tree on a loaded firmware, showing grouping by modules
In almost every DXE module, the entry point receives ImageHandle and SystemTable, then copies the boot services and runtime services pointers into globals. Every later call goes through those globals. IDA now follows these values from the entry point and through the functions it calls, then names and types the globals after EDK2 conventions: gImageHandle, gST, gBS and gRT.
Here's the entry point of OVMF's DiskIoDxe without the UEFI analysis (ASSERT checks left out):
EFI_STATUS __fastcall DiskIoDxe(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
...
qword_100061B0 = (__int64)SystemTable;
qword_100061C8 = (__int64)SystemTable->BootServices;
qword_100061A0 = (__int64)SystemTable->RuntimeServices;
v5 = (*(__int64 (__fastcall **)(void *, _QWORD, __int64 *))(qword_100061C8 + 320))(
&unk_10006000, 0, &qword_100061A8);
...
qword_10006080 = (__int64)ImageHandle;
qword_10006088 = (__int64)ImageHandle;
v6 = (*(__int64 (__fastcall **)(__int64 *, void *, __int64 (__fastcall **)(), void *, __int64 (__fastcall **)(), void *, __int64 (__fastcall **)(), _QWORD))(qword_100061C8 + 328))(
&qword_10006088,
&unk_10006030,
off_10006060,
&unk_10006010,
off_10006180,
&unk_10006020,
off_10006040,
0);
...
}
And the same function in IDA 9.5:
EFI_STATUS __fastcall DiskIoDxe(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
...
DiskIoDxe_gST = SystemTable;
DiskIoDxe_gBS = SystemTable->BootServices;
DiskIoDxe_gRT = SystemTable->RuntimeServices;
v7 = DiskIoDxe_gBS->LocateProtocol(
&DiskIoDxe_gEfiDevicePathUtilitiesProtocolGuid,
nullptr,
(void **)&DiskIoDxe_gEfiDevicePathUtilitiesProtocol);
...
DiskIoDxe_mEfiDriverBindingProtocol.ImageHandle = ImageHandle;
DiskIoDxe_mEfiDriverBindingProtocol.DriverBindingHandle = ImageHandle;
v11 = DiskIoDxe_gBS->InstallMultipleProtocolInterfaces(
&DiskIoDxe_mEfiDriverBindingProtocol.DriverBindingHandle,
&DiskIoDxe_gEfiDriverBindingProtocolGuid,
&DiskIoDxe_mEfiDriverBindingProtocol,
&DiskIoDxe_gEfiComponentNameProtocolGuid,
&DiskIoDxe_mEfiComponentNameProtocol,
&DiskIoDxe_gEfiComponentName2ProtocolGuid,
&DiskIoDxe_mEfiComponentName2Protocol,
0);
...
}
The offsets + 320 and + 328 are now LocateProtocol and InstallMultipleProtocolInterfaces, and the anonymous globals carry their real names.
Every module keeps its own names. In a firmware image, each module has its own copy of these globals, so IDA prefixes them with the module name: DiskIoDxe_gBS, PartitionDxe_gBS. The ASSERT helpers are recognized as well and show up as DebugAssert with typed arguments.
Tables found by usage. Not every module gets its tables from the entry point. The DXE core builds them itself, and SMM drivers receive gSmst through a protocol. For these cases, IDA infers the type of an untyped global from the calls made through it: if every call lands on a function-pointer member of EFI_BOOT_SERVICES, the global is gBS. The same check identifies the SMM system table. This approach is similar to the one taken by the efiXplorer plugin.
UEFI modules talk to each other through protocols: a GUID paired with a table of function pointers or other data. Once IDA knows gBS, it looks for calls to LocateProtocol, HandleProtocol, OpenProtocol and the Install*ProtocolInterface family, and applies four things to each of them.
EFI_GUID in the module is typed and named, for example gEfiPcdProtocolGuid. This also works for GUIDs that the code builds on the stack.LocateProtocol writes back becomes a typed pointer to the protocol struct. If it lands in a global, the global is named after the protocol, for example gPcdProtocol. Calls through it then read gPcdProtocol->Get32(...) instead of an offset..data and names the functions in it after the members they implement.The same applies to SMM: gSmst services and the SMM protocols located through it are typed the same way.
IDA resolved the GUID and types the stack variable to the correct protocol based on the OpenProtocol call
A protocol call is an indirect call into another module, and static analysis usually stops following the code there. IDA 9.5 records every installed interface and every call made through a protocol member. After all modules are analyzed, it links the two.
DiskIo->ReadDisk in a consumer's pseudocode to land in the ReadDisk function of DiskIoDxe. When several drivers install the same protocol, IDA lets you choose.ReadDisk to list the call sites across all modules. From pseudocode, the context menu lists the call sites of the member under the cursor.Preview of the "UEFI protocols" window, showing protocol installations and usages
The Pre-EFI Initialization (PEI) phase runs early in boot, often in 32-bit mode, and it works differently from DXE. Instead of a global gBS, a PEIM receives an EFI_PEI_SERVICES ** and calls through it: (*PeiServices)->LocatePpi(...). Instead of protocols, it uses PPIs.
IDA handles PEI with the same machinery as DXE:
GetPeiServicesTablePointer getters that fetch it from where the PEI core keeps it: the slot below the IDT base on x86, and the TPIDR_EL0 register on ARM. Getters that vendors inline are recognized too.LocatePpi are typed, just like protocols.EFI_PEI_PPI_DESCRIPTOR and notify descriptor arrays passed to InstallPpi and NotifyPpi get their types and named GUIDs. Each notify callback gets the EFI_PEIM_NOTIFY_ENTRY_POINT prototype, with its Ppi parameter typed as the PPI it waits for, and is then analyzed in turn.PeiServicesLocatePpi and similar helpers count the same as direct service calls.PPI events show up in the same UEFI protocols window, next to the DXE protocols.
Preview of the PEIM entry point with typed LocatePpi and a notify list
Everything IDA finds is available to your plugins, scripts, and AI agents. The C++ API lives in uefi.h in the SDK, and the Python bindings are in the ida_uefi module.
This script lists every protocol installation in the image, then the implementations and callers of a specific protocol member:
import ida_uefi, ida_name
svc = ida_uefi.get_uefi_svc()
mods = svc.get_modules()
for p in svc.get_protocols():
if p.kind == ida_uefi.UEFI_PK_INSTALL:
mod = mods[p.module].name if p.module >= 0 else "?"
print(f"{p.call_ea:x} [{mod}] {p.name or p.guid}")
off = svc.get_member_offset("EFI_DISK_IO_PROTOCOL", "ReadDisk")
for impl in svc.get_member_impls("EFI_DISK_IO_PROTOCOL", off):
print("implemented by", ida_name.get_name(impl.func))
for ea in svc.get_member_calls("EFI_DISK_IO_PROTOCOL", off):
print("called at", hex(ea))
The service also gives you the module table, the installed interfaces, the struct bound to each GUID (which you can change), and lookups in the GUID database in both directions. The full sample ships with IDA as examples/disassembler/uefi_query.py, and help(svc) lists every method.
A few things to know before you start:
gSmst found by usage can rest on a single call, and synthesized structs have guessed member types. Both are marked as such, and your own types always take precedence.Each part of the analysis can be switched off in cfg/uefi.cfg:
| Option | Controls |
|---|---|
| UEFI_RENAME | EDK2 names for tables, GUIDs, protocols and their implementations (types apply regardless) |
| UEFI_INFER_TABLES | Table types inferred from usage |
| UEFI_TYPE_PROTOCOLS | GUID naming, protocol and PPI typing |
| UEFI_CONST_STRINGS | Inline string literals from writable .data |
| UEFI_FUNC_FOLDERS | Per-module folders in the Functions window |
| UEFI_MAX_DEPTH, UEFI_MAX_FUNCS | How far the analysis follows calls, and how many functions it analyzes per module (default 4 and 1,000) |
In next version of IDA we plan to expand the built-in UEFI functionality:
UEFI support ships in IDA 9.5, with nothing extra to install. Open a firmware dump of your own and let IDA do the groundwork.
If it misses a protocol or names something wrong, send to support@hex-rays.com the module. Firmware varies a lot between vendors, and real samples are what improve the analysis.
A word of thanks to the open-source projects this work builds on. The firmware parser is based on UEFITool by Nikolaj Schlej and LongSoft, which in turn includes the EFI/Tiano decompression library (Intel, Apple and LongSoft), Intel's LZMA decompression wrapper, Igor Pavlov's LZMA SDK, the SM3 digest from Huawei Technologies, Paul Hsieh's bstrlib, the Brotli decoder and the Kaitai Struct C++ runtime. The GUID database builds on REhints' guiddb.
And many thanks to efiXplorer for trailblazing UEFI support in IDA.
Last but not least, a special thank you to our teammate Paweł Pawłowski for spearheading the development of UEFI support in IDA 9.5.
One firmware image, one database, and protocols you can follow from caller to implementation. We hope you enjoy it!