snare/ida-efiutils
Acerca de
Some scripts for IDA Pro to assist with reverse engineering EFI binaries
Seguridad y privacidadCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalEFI scripts for IDA Pro
Some IDA scripts to assist with reverse engineering EFI executables.
This package contains the following files:
efiutils.py- IDAPython module with some helper functionsefiguids.py- A collection of known GUIDs for EFI protocolsefiguids_ami.py- A collection of known GUIDs for protocols used in the AMI BIOSbehemoth.h- A giant header containing a collection of type and structure definitions for EFIstructs.idc- An IDC script containing some struct definitions (superseded bybehemoth.h)te_image.bt- An 010 Editor template for TE binary imageste_loader.py- An IDA Pro loader script for TE binary images
This is my first attempt at IDA scripting, so please forgive me and let me know if I've reinvented wheels/done anything silly.
Functions
The main useful functions are described below. See code and docstrings for more information on other functions.
rename_tables()
Finds the first entry point for the binary, tries to track the parameters that were passed to the entry point function and rename global variables in which the key EFI tables are stored. The following renaming operations are performed:
Global where
ImageHandleends up is renamed togImageHandle.Global where
SystemTableends up is renamed togSystemTable.Global where
SystemTable->BootServicesends up is renamed togBootServices.Global where
SystemTable->RuntimeServicesends up is renamed togRuntimeServices.
Call instructions will only be followed one level deep, as most executables copy the table references in the entry point or a function called from the entry point. Change MAX_STACK_DEPTH if necessary.
update_structs()
Finds cross-references to tables renamed above, and updates their names to be struct offsets from the appropriate structs. If rename_tables() failed you'll need to rename things manually as above for this to work properly.
For example:
mov rax, cs:qword_whatever
call qword ptr [rax+150h]
Becomes:
mov rax, cs:gBootServices
call [rax+EFI_BOOT_SERVICES.UninstallMultipleProtocolInterfaces]
rename_guids()
Finds GUIDs in data segments and renames them. 470 protocol GUIDs were pulled out of the TianoCore source, and proprietary Apple (and other vendor) GUIDs will be added as they are encountered.
go()
Convenience method that does all of the above.
Usage
Load up your EFI binary in IDA Pro
Import
behemoth.hto define the necessary data structuresAdd the structures from local types to your IDB
Run
efiutils.pyto add it to python's path (or do this by some other method)Have a look at the code/docstrings, but probably:
import efiutils; efiutils.go()
To use the te_loader.py TE image loader, install it as you would any other loader. On OS X this is done by copying or symlinking it inside the loaders folder at idaq.app/Contents/MacOS/loaders/.
Explorar proyectos relacionados
Cargando…