Skip to content

Commit 8e09989

Browse files
committed
Merge branch 'develop'
2 parents d8db54d + d81e33f commit 8e09989

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7026
-4220
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Markus Gaasedelen
3+
Copyright (c) 2017-2018 Markus Gaasedelen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
# Lighthouse - Code Coverage Explorer for IDA Pro
1+
# Lighthouse - A Code Coverage Explorer for Reverse Engineers
22
<p align="center">
3-
<img alt="Lighthouse Plugin" src="screenshots/overview.png"/>
3+
<img alt="Lighthouse Plugin" src="screenshots/overview.gif"/>
44
</p>
55

66
## Overview
77

8-
Lighthouse is a code coverage plugin for [IDA Pro](https://www.hex-rays.com/products/ida/). 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.
8+
Lighthouse is a code coverage plugin for [IDA Pro](https://www.hex-rays.com/products/ida/), and [Binary Ninja](https://binary.ninja/). The plugin makes use of interactive disassemblers to map, explore, and visualize externally collected code coverage data when symbols or source may not be available for a given binary.
99

10-
This plugin is labeled only as a prototype and IDA / Qt code example for the community.
10+
This plugin is labeled only as a prototype & code resource for the community.
1111

1212
Special thanks to [@0vercl0k](https://twitter.com/0vercl0k) for the inspiration.
1313

1414
## Releases
1515

16+
* v0.8 -- Binary Ninja support, HTML coverage reports, consistent styling, many tweaks, bugfixes.
1617
* v0.7 -- Frida, C++ demangling, context menu, function prefixing, tweaks, bugfixes.
1718
* v0.6 -- Intel pintool, cyclomatic complexity, batch load, bugfixes.
1819
* v0.5 -- Search, IDA 7 support, many improvements, stability.
@@ -21,34 +22,56 @@ Special thanks to [@0vercl0k](https://twitter.com/0vercl0k) for the inspiration.
2122
* v0.2 -- Multifile support, performance improvements, bugfixes.
2223
* v0.1 -- Initial release
2324

24-
## Installation
25+
# IDA Pro Installation
2526

26-
Install Lighthouse into the IDA plugins folder.
27+
Lighthouse is a cross-platform (Windows, macOS, Linux) python plugin, supporting IDA Pro 6.8 and newer.
2728

2829
- Copy the contents of the `plugin` folder to the IDA plugins folder
2930
- On Windows, the folder is at `C:\Program Files (x86)\IDA 6.8\plugins`
30-
- On MacOS, the folder is at `/Applications/IDA\ Pro\ 6.8/idaq.app/Contents/MacOS/plugins`
31+
- On macOS, the folder is at `/Applications/IDA\ Pro\ 6.8/idaq.app/Contents/MacOS/plugins`
3132
- On Linux, the folder may be at `/opt/IDA/plugins/`
3233

33-
The plugin is compatible with IDA Pro 6.8 --> 7.0 on Windows, MacOS, and Linux.
34+
It has been primarily developed and tested on Windows, so that is where we expect the best experience.
3435

35-
## Usage
36+
# Binary Ninja Installation (Experimental)
3637

37-
Lighthouse loads automatically when an IDB is opened, installing a handful of menu entries into the IDA interface.
38+
At this time, support for Binary Ninja is considered experimental. Please feel free to report any bugs that you encounter.
3839

39-
<p align="center">
40-
<img alt="Lighthouse Menu Entries" src="screenshots/open.gif"/>
41-
</p>
40+
You can install Lighthouse & PyQt5 for Binary Ninja by following the instructions below.
4241

43-
These are the entry points for a user to load and view coverage data.
42+
## Windows Installation
43+
44+
1. Install PyQt5 from a Windows command prompt with the following command:
45+
46+
```
47+
pip install --target="%appdata%\Binary Ninja\plugins\Lib\site-packages" python-qt5
48+
```
49+
50+
2. Copy the contents of the `/plugin/` folder in this repo to your Binary Ninja [plugins folder](https://docs.binary.ninja/guide/plugins/index.html#using-plugins).
51+
52+
## Linux Installation
53+
54+
1. Install PyQt5 from a Linux shell with the following command:
4455

4556
```
46-
- File --> Load file --> Code coverage file...
47-
- File --> Load file --> Code coverage batch...
48-
- View --> Open subviews --> Coverage Overview
57+
sudo apt install python-pyqt5
4958
```
5059

51-
Batch load can quickly aggregate hundreds (thousands?) of collected coverage files into a single composite at load time.
60+
2. Copy the contents of the `/plugin/` folder in this repo to your Binary Ninja [plugins folder](https://docs.binary.ninja/guide/plugins/index.html#using-plugins).
61+
62+
## macOS Installation
63+
64+
¯\\\_(ツ)\_
65+
66+
# Usage
67+
68+
Lighthouse loads automatically when a database is opened, installing a handful of menu entries into the disassembler.
69+
70+
<p align="center">
71+
<img alt="Lighthouse Menu Entries" src="screenshots/open.gif"/>
72+
</p>
73+
74+
These are the entry points for a user to load and view coverage data.
5275

5376
## Coverage Painting
5477

@@ -58,6 +81,8 @@ Lighthouse 'paints' the active coverage data across the three major IDA views as
5881
<img alt="Lighthouse Coverage Painting" src="screenshots/painting.png"/>
5982
</p>
6083

84+
In Binary Ninja, only the Disassembly and Graph views are supported.
85+
6186
## Coverage Overview
6287

6388
The Coverage Overview is a dockable widget that provides a function level view of the active coverage data for the database.
@@ -141,6 +166,15 @@ Loaded coverage data and user constructed compositions can be selected or delete
141166
<img alt="Lighthouse Coverage ComboBox" src="screenshots/combobox.gif"/>
142167
</p>
143168

169+
## HTML Coverage Report
170+
171+
Lighthouse can generate a rudimentary HTML coverage report of the active coverage.
172+
A sample report can be seen [here](https://rawgit.com/gaasedelen/lighthouse/master/testcase/report.html).
173+
174+
<p align="center">
175+
<img alt="Lighthouse HTML Report" src="screenshots/html_report.gif"/>
176+
</p>
177+
144178
# Collecting Coverage
145179

146180
Before using Lighthouse, one will need to collect code coverage data for their target binary / application.
@@ -157,7 +191,7 @@ Example usage:
157191
..\DynamoRIO-Windows-7.0.0-RC1\bin64\drrun.exe -t drcov -- boombox.exe
158192
```
159193

160-
## Intel Pin (Experimental)
194+
## Intel Pin
161195

162196
Using a [custom pintool](coverage/pin) contributed by [Agustin Gianni](https://twitter.com/agustingianni), the Intel Pin DBI can also be used to collect coverage data.
163197

@@ -167,7 +201,7 @@ Example usage:
167201
pin.exe -t CodeCoverage64.dll -- boombox.exe
168202
```
169203

170-
For convenience, binaries for the Windows pintool can be found on the [releases](https://github.com/gaasedelen/lighthouse/releases/tag/v0.7.0) page. MacOS and Linux users need to compile the pintool themselves following the [instructions](coverage/pin#compilation) included with the pintool for their respective platforms.
204+
For convenience, binaries for the Windows pintool can be found on the [releases](https://github.com/gaasedelen/lighthouse/releases/tag/v0.8.0) page. macOS and Linux users need to compile the pintool themselves following the [instructions](coverage/pin#compilation) included with the pintool for their respective platforms.
171205

172206
## Frida (Experimental)
173207

@@ -186,9 +220,12 @@ Time and motivation permitting, future work may include:
186220
* ~~Asynchronous composition, painting, metadata collection~~
187221
* ~~Multifile/coverage support~~
188222
* Profiling based heatmaps/painting
189-
* Coverage & Profiling Treemaps
223+
* Coverage & profiling treemaps
190224
* ~~Additional coverage sources, trace formats, etc~~
191-
* Improved Pseudocode painting
225+
* Improved pseudocode painting
226+
* Lighthouse console access, headless usage
227+
* Custom themes
228+
* Python 3 support
192229

193230
I welcome external contributions, issues, and feature requests.
194231

dev_scripts/close_BINJA.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
REM - Clean up an existing or past 'test session'
2+
taskkill /F /IM "binaryninja.exe"
3+
timeout 1
4+
REM del "..\..\testcase\*.id0"
5+
REM del "..\..\testcase\*.id1"
6+
REM del "..\..\testcase\*.id2"
7+
REM del "..\..\testcase\*.nam"
8+
REM del "..\..\testcase\*.til"
9+
REM del "..\..\testcase\*.$$$"

dev_scripts/reload_BINJA.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set LIGHTHOUSE_LOGGING=1
2+
REM - Close any running instances of IDA
3+
call close_BINJA.bat
4+
5+
REM - Purge old lighthouse log files
6+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\lighthouse_logs\*"
7+
8+
REM - Delete the old plugin bits
9+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\*lighthouse_plugin.py"
10+
rmdir "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\lighthouse" /s /q
11+
12+
REM - Copy over the new plugin bits
13+
xcopy /s/y "..\plugin\*" "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\"
14+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\.#lighthouse_plugin.py"
15+
16+
REM - Launch a new IDA session
17+
start "" "C:\tools\disassemblers\BinaryNinja\binaryninja.exe" "..\..\testcase\boombox.bndb"
18+

dev_scripts/reload_BINJA_IDA.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set LIGHTHOUSE_LOGGING=1
2+
REM - Close any running instances of IDA
3+
call close_BINJA.bat
4+
5+
REM - Purge old lighthouse log files
6+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\lighthouse_logs\*"
7+
8+
REM - Delete the old plugin bits
9+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\*lighthouse_plugin.py"
10+
rmdir "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\lighthouse" /s /q
11+
12+
REM - Copy over the new plugin bits
13+
xcopy /s/y "..\plugin\*" "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\"
14+
del /F /Q "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\.#lighthouse_plugin.py"
15+
16+
REM - Launch a new IDA session
17+
start "" "C:\tools\disassemblers\BinaryNinja\binaryninja.exe" "..\..\testcase\idaq.bndb"
18+

dev_scripts/reload_IDA_7.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set LIGHTHOUSE_LOGGING=1
12
REM - Close any running instances of IDA
23
call close_IDA.bat
34

dev_scripts/reload_IDA_71_ida.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set LIGHTHOUSE_LOGGING=1
2+
REM - Close any running instances of IDA
3+
call close_IDA.bat
4+
5+
REM - Purge old lighthouse log files
6+
del /F /Q "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\lighthouse_logs\*"
7+
8+
REM - Delete the old plugin bits
9+
del /F /Q "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\plugins\*lighthouse_plugin.py"
10+
rmdir "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\plugins\lighthouse" /s /q
11+
12+
REM - Copy over the new plugin bits
13+
xcopy /s/y "..\plugin\*" "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\plugins\"
14+
del /F /Q "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\plugins\.#lighthouse_plugin.py"
15+
16+
REM - Launch a new IDA session
17+
start "" "C:\tools\disassemblers\IDA 7.1\ida.exe" "..\..\testcase\idaq71.idb"
18+

dev_scripts/reload_IDA_7_ida.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set LIGHTHOUSE_LOGGING=1
12
REM - Close any running instances of IDA
23
call close_IDA.bat
34

dev_scripts/reload_IDA_8.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set LIGHTHOUSE_LOGGING=1
12
REM - Close any running instances of IDA
23
call close_IDA.bat
34

dev_scripts/reload_IDA_8_big.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set LIGHTHOUSE_LOGGING=1
2+
REM - Close any running instances of IDA
3+
call close_IDA.bat
4+
5+
REM - Purge old lighthouse log files
6+
del /F /Q "C:\Users\user\AppData\Roaming\Hex-Rays\IDA Pro\lighthouse_logs\*"
7+
8+
REM - Delete the old plugin bits
9+
del /F /Q "C:\tools\disassemblers\IDA 6.8\plugins\*lighthouse_plugin.py"
10+
rmdir "C:\tools\disassemblers\IDA 6.8\plugins\lighthouse" /s /q
11+
12+
REM - Copy over the new plugin bits
13+
xcopy /s/y "..\plugin\*" "C:\tools\disassemblers\IDA 6.8\plugins\"
14+
del /F /Q "C:\tools\disassemblers\IDA 6.8\plugins\.#lighthouse_plugin.py"
15+
16+
REM - Relaunch two IDA sessions
17+
start "" "C:\tools\disassemblers\IDA 6.8\idaq.exe" "..\..\testcase\harness_ufs_pdf.instr.idb"
18+

0 commit comments

Comments
 (0)