Python Lighthouse - Code Coverage Explorer for IDA Pro by gaasedelen

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker
Lighthouse - Code Coverage Explorer for IDA Pro


Overview

Lighthouse is a Code Coverage Plugin for IDA Pro. The plugin leverages IDA as a platform to map, explore, and visualize externally collected code coverage data when symbols or source may not be available for a given binary.
There are no bells or whistles. This plugin is labeled only as a prototype and code example for the community.
Special thanks to @0vercl0k for the inspiration.
Releases

  • v0.1 -- Initial release
Installation

Install Lighthouse into the IDA plugins folder.
  • Copy the contents of the plugin folder to the IDA plugins folder
    • On Windows, the folder is at C:\Program Files (x86)\IDA 6.8\plugins
    • On MacOS, the folder is at /Applications/IDA\ Pro\ 6.8/idaq.app/Contents/MacOS/plugins
    • On Linux, the folder may be at /opt/IDA/plugins/
The plugin has only been tested on IDA Pro 6.8, 6.95 for Windows.
Usage

Lighthouse loads automatically when an IDB is opened, installing the following menu entries into the IDA interface:
- File --> Load file --> Code Coverage File(s)...
- View --> Open subviews --> Coverage Overview

These are the entry points for a user to load and view coverage data.
Coverage Overview

The Coverage Overview is a dockable widget that provides a function level view of the active coverage data for the database.

This table can be sorted by column, and entries can be double clicked to jump to their corresponding disassembly.
Coverage Painting

Lighthouse 'paints' the active coverage data across the three major IDA views as applicable. Specifically, the Disassembly, Graph, and Pseudocode views.

Collecting Coverage

At this time, Lighthouse only consumes binary coverage data as produced by DynamoRIO's drcov code coverage module.
Collecting blackbox coverage data with drcov is relatively straightforward. The following example demonstrates how coverage was produced for the boombox.exe testcase provided in this repository.
..\DynamoRIO-Windows-7.0.0-RC1\bin64\drrun.exe -t drcov -- boombox.exe

This command will produce a .log file consisting of the coverage data upon termination of the target application.
Other Coverage Sources

drcov was selected as the initial coverage data source due to its availability, adoption, multi-platform (Win/Mac/Linux), and multi-architecture (x86/AMD64/ARM) support.
Intel's PIN for example does not come with a default code coverage pintool. It appears that most implement their own solution and there is no clear format for Lighthouse to standardize on. In the future, Lighthouse may ship with its own pintool.
While Lighthouse is considered a prototype, internally it is largely agnostic of its data source. Future work will allow one to drop a loader into the parsers folder without any need for code changes to Lighthouse. Right now, this is not the case.
Future Work

Time and motivation permitting, future work may include:
  • Multi file/coverage support
  • Profiling based heatmaps/painting
  • Automatic parser pickup
  • Parsers for additional coverage sources, eg PIN
  • Improved Pseudocode painting
Authors

source github
https://github.com/gaasedelen/lighthouse
 

Attachments

  • lighthouse-master.zip
    229.5 KB · Views: 6

m4n0w4r

New member
Does anyone try it successful on IDA 6.8?

I've installed ok:
[Lighthouse]
[Lighthouse] ---------------------------------------------------------------------------
[Lighthouse] ---[ Lighthouse v0.1.0 - (c) Markus Gaasedelen - 2017
[Lighthouse] ---------------------------------------------------------------------------
[Lighthouse]

I tried the boombox.exe test case (https://github.com/gaasedelen/lighthouse/tree/master/testcase), when select File --> Load file --> Code Coverage File(s)... , then load the drcov.boombox.exe.04936.0000.proc.log, i receive an error like this :

Traceback (most recent call last):
File "F:/IDA Tools/IDA 6.8/plugins\lighthouse\ui\__init__.py", line 22, in activate
self.action_function()
File "F:/IDA Tools/IDA 6.8/plugins/lighthouse_plugin.py", line 330, in load_code_coverage
coverage_files = self._select_code_coverage_files()
File "F:/IDA Tools/IDA 6.8/plugins/lighthouse_plugin.py", line 386, in _select_code_coverage_files
filenames, _ = file_dialog.getOpenFileNames()
ValueError: need more than 1 value to unpack

Regards,
 
Last edited:

computerline

New member
Ida Pro Expert

m4n0w4r

New member
@computerline:

Still got error bro:

File "F:/IDA_Tools/IDA6.8/plugins\lighthouse\ui\__init__.py", line 22, in activate
self.action_function()
File "F:/IDA_Tools/IDA6.8/plugins/lighthouse_plugin.py", line 330, in load_code_coverage
coverage_files = self._select_code_coverage_files()
File "F:/IDA_Tools/IDA6.8/plugins/lighthouse_plugin.py", line 386, in _select_code_coverage_files
filenames, _ = file_dialog.getOpenFileNames()
ValueError: need more than 1 value to unpack
 

computerline

New member
Ida Pro Expert
I can't reproduce the error :(, this errror may case by bug in getOpenFileNames function, need to check in PySide. I modify the plugin to use single file open function, maybe it will be ok.
 

Attachments

  • lighthouse_plugin.7z
    3.7 KB · Views: 5

m4n0w4r

New member
I can't reproduce the error :(, this errror may case by bug in getOpenFileNames function, need to check in PySide. I modify the plugin to use single file open function, maybe it will be ok.
Tks so much my bro, i try your modified version but ...

Traceback (most recent call last):
File "F:/IDA_Tools/IDA6.8/plugins\lighthouse\ui\__init__.py", line 22, in activate
self.action_function()
File "F:/IDA_Tools/IDA6.8/plugins/lighthouse_plugin.py", line 330, in load_code_coverage
coverage_files = self._select_code_coverage_files()
File "F:/IDA_Tools/IDA6.8/plugins/lighthouse_plugin.py", line 385, in _select_code_coverage_files
filenames, _ = file_dialog.getOpenFileName()
ValueError: too many values to unpack

I dont know what happened with my IDA :(. Can you pack and share with me your latest IDA folder?

Regards,
 

Storm Shadow

Administrator
Staff member
Developer
Ida Pro Expert
Elite Cracker

m4n0w4r

New member
Top