Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit 05858c0

Browse files
committed
Update error handling for IL getters API change
Newer version Binja return None on Function.mlil if the IL fails to load, while older versions raise ILException. This change ensures we support both
1 parent fce6fd6 commit 05858c0

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2023-2024 Vector 35 Inc.
1+
Copyright 2023-2025 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EFI Resolver (v1.2.0)
1+
# EFI Resolver (v1.3.0)
22
Author: **Vector 35 Inc**
33

44
_A Binary Ninja plugin that automatically resolves type information for EFI protocol usage._

plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"longdescription": "EFI Resolver is a Binary Ninja plugin that automates the task of resolving EFI protocol type information, which supports both DXE drivers and PEI modules. It propagates EFI related pointers from entry point to where they are stored, (e.g. system table, MM system table, boot services, and runtime services). For PEI files, it also support identifies processor-specific PEI service pointers. The plugin also identifies references to the boot services, PEI services and MM protocol functions and applies type information according to the GUID passed to these functions. The plugin supports the core UEFI specification by default, and allows users to provide custom GUIDs and protocols.",
1212
"license": {
1313
"name": "Apache-2.0",
14-
"text": "Copyright 2023-2024 Vector 35 Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."
14+
"text": "Copyright 2023-2025 Vector 35 Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."
1515
},
1616
"platforms": [
1717
"Darwin",
@@ -24,7 +24,7 @@
2424
"Windows": "no special instructions, package manager is recommended"
2525
},
2626
"dependencies": {},
27-
"version": "1.2.0",
27+
"version": "1.3.0",
2828
"author": "Vector 35 Inc",
2929
"minimumbinaryninjaversion": 4333
3030
}

ppi.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ def define_pei_idt(bv: BinaryView, task: BackgroundTask) -> bool:
123123
# TODO there is a type propagation issue (vector35/binaryninja#759) related to indirect struct access in core,
124124
# manually fix it now, the following should be removed after the bug is fixed.
125125
for ref in bv.get_code_refs_for_type("EFI_PEI_SERVICES"):
126+
# This pattern accounts for an API change in ref.mlil and ensures the plugin works with all versions of Binja
127+
# See https://github.com/Vector35/binaryninja-api/issues/6020 for more details
126128
try:
127129
instr = ref.mlil
130+
if instr is None: raise ILException()
128131
except ILException:
129132
log_warn(f"mlil not available at {hex(ref.address)}")
130133
continue
@@ -205,8 +208,10 @@ def define_pei_descriptor(bv: BinaryView, task: BackgroundTask) -> bool:
205208
for ref in refs:
206209
if task.cancelled:
207210
return False
211+
208212
try:
209213
instr = ref.mlil
214+
if instr is None: raise ILException()
210215
except ILException:
211216
log_warn(f"mlil unavailable for ref: {hex(ref.address)}")
212217
continue

0 commit comments

Comments
 (0)