Skip to content

Commit 7245a2d

Browse files
committed
Merge branch 'develop'
2 parents 91e427e + 701952d commit 7245a2d

File tree

25 files changed

+373
-65
lines changed

25 files changed

+373
-65
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-2020 Markus Gaasedelen
3+
Copyright (c) 2017-2021 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: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# Lighthouse - A Code Coverage Explorer for Reverse Engineers
1+
# Lighthouse - A Coverage Explorer for Reverse Engineers
2+
23
<p align="center">
34
<img alt="Lighthouse Plugin" src="screenshots/overview.gif"/>
45
</p>
56

67
## Overview
78

8-
Lighthouse is a powerful code coverage plugin for [IDA Pro](https://www.hex-rays.com/products/ida/) and [Binary Ninja](https://binary.ninja/). As an extension of the leading disassemblers, this plugin enables one to interactively explore code coverage data in new and innovative ways when symbols or source may not be available for a given binary.
9+
Lighthouse is a powerful code coverage explorer for [IDA Pro](https://www.hex-rays.com/products/ida/) and [Binary Ninja](https://binary.ninja/), providing software researchers with uniquely interactive controls to study execution maps for native applications without requiring symbols or source.
910

10-
This plugin is labeled only as a prototype & code resource for the community.
11+
This project placed 2nd in IDA's [2017 Plug-In Contest](https://hex-rays.com/contests_details/contest2017/) and was later [nominated](https://pwnies.com/lighthouse/) in the 2021 Pwnie Awards for its contributions to the security research industry.
1112

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

@@ -27,11 +28,31 @@ Special thanks to [@0vercl0k](https://twitter.com/0vercl0k) for the inspiration.
2728

2829
Lighthouse is a cross-platform (Windows, macOS, Linux) Python 2/3 plugin. It takes zero third party dependencies, making the code both portable and easy to install.
2930

30-
1. From your disassembler's python console, run the following command to find its plugin directory:
31-
- **IDA Pro**: `os.path.join(idaapi.get_user_idadir(), "plugins")`
32-
- **Binary Ninja**: `binaryninja.user_plugin_path()`
31+
Use the instructions below for your respective disassembler.
32+
33+
## IDA Installation
34+
35+
1. From IDA's Python console, run the following command to find its plugin directory:
36+
- `import idaapi, os; print(os.path.join(idaapi.get_user_idadir(), "plugins"))`
37+
2. Copy the contents of this repository's `/plugins/` folder to the listed directory.
38+
3. Restart your disassembler.
39+
40+
## Binary Ninja Installation
41+
42+
Lighthouse can be installed through the plugin manager on newer versions of Binary Ninja (>2.4.2918). The plugin will have to be installed manually on older versions.
43+
44+
### Auto Install
45+
46+
1. Open Binary Ninja's plugin manager by navigating the following submenus:
47+
- `Edit` -> `Preferences` -> `Manage Plugins`
48+
2. Search for Lighthouse in the plugin manager, and click the `Enable` button in the bottom right.
49+
3. Restart your disassembler.
50+
51+
### Manual Install
3352

34-
2. Copy the contents of this repository's `/plugin/` folder to the listed directory.
53+
1. Open Binary Ninja's plugin folder by navigating the following submenus:
54+
- `Tools` -> `Open Plugins Folder...`
55+
2. Copy the contents of this repository's `/plugins/` folder to the listed directory.
3556
3. Restart your disassembler.
3657

3758
# Usage
@@ -76,16 +97,15 @@ If there are any other actions that you think might be useful to add to this con
7697

7798
## Coverage ComboBox
7899

79-
Loaded coverage data and user constructed compositions can be selected or deleted through the coverage combobox.
100+
Loaded coverage and user constructed compositions can be selected or deleted through the coverage combobox.
80101

81102
<p align="center">
82103
<img alt="Lighthouse Coverage ComboBox" src="screenshots/combobox.gif"/>
83104
</p>
84105

85106
## HTML Coverage Report
86107

87-
Lighthouse can generate a rudimentary HTML coverage report of the active coverage.
88-
A sample report can be seen [here](https://rawgit.com/gaasedelen/lighthouse/master/testcase/report.html).
108+
Lighthouse can generate rudimentary HTML coverage reports. A sample report can be seen [here](https://rawgit.com/gaasedelen/lighthouse/master/testcase/report.html).
89109

90110
<p align="center">
91111
<img alt="Lighthouse HTML Report" src="screenshots/html_report.gif"/>

binjastub/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Lighthouse - A Coverage Explorer for Reverse Engineers
2+
3+
<p align="center">
4+
<img alt="Lighthouse Plugin" src="https://raw.githubusercontent.com/gaasedelen/lighthouse/master/screenshots/overview.gif"/>
5+
</p>
6+
7+
## Overview
8+
9+
Lighthouse is a powerful code coverage explorer for [IDA Pro](https://www.hex-rays.com/products/ida/) and [Binary Ninja](https://binary.ninja/), providing software researchers with uniquely interactive controls to study execution maps for native applications without requiring symbols or source.
10+
11+
For additional usage information, please check out the full [README](https://github.com/gaasedelen/lighthouse) on GitHub.

binjastub/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import sys
3+
4+
#------------------------------------------------------------------------------
5+
# Binary Ninja 'Plugin Manager' Stub
6+
#------------------------------------------------------------------------------
7+
#
8+
# This file is an alternative loading stub created specifically to
9+
# support the ability to 'easy' install Lighthouse into Binary Ninja
10+
# via its 'Plugin Manager' functionality.
11+
#
12+
# Please disregard this code / subdirectory if performing **manual**
13+
# installations of Lighthouse in IDA or Binary Ninja.
14+
#
15+
16+
lh_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "plugins")
17+
sys.path.append(lh_path)
18+
19+
from lighthouse.util.log import logging_started, start_logging
20+
from lighthouse.util.disassembler import disassembler
21+
22+
if not logging_started():
23+
logger = start_logging()
24+
25+
logger.info("Selecting Binary Ninja loader...")
26+
from lighthouse.integration.binja_loader import *

binjastub/plugin.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"api": [
3+
"python3"
4+
],
5+
"author": "Markus Gaasedelen",
6+
"description": "A Coverage Explorer for Reverse Engineers",
7+
"license": {
8+
"name": "MIT",
9+
"text": "Copyright (c) 2021> Markus Gaasedelen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
10+
},
11+
"longdescription": "",
12+
"minimumbinaryninjaversion": 2918,
13+
"name": "Lighthouse",
14+
"platforms": [
15+
"Darwin",
16+
"Linux",
17+
"Windows"
18+
],
19+
"pluginmetadataversion": 2,
20+
"type": [
21+
"helper"
22+
],
23+
"version": "0.9.2"
24+
}

coverage/pin/CodeCoverage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using namespace std;
21
#include <iostream>
32
#include <set>
43
#include <string>

coverage/pin/ImageManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using namespace std;
21
#include "ImageManager.h"
32
#include "pin.H"
43

coverage/pin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config
22
include $(CONFIG_ROOT)/makefile.config
33

4-
TOOL_CXXFLAGS += -std=c++11 -Wno-format -Wno-aligned-new
4+
TOOL_CXXFLAGS += -std=c++11 -Wno-format
55
TOOL_ROOTS := CodeCoverage
66

77
$(OBJDIR)CodeCoverage$(PINTOOL_SUFFIX): $(OBJDIR)CodeCoverage$(OBJ_SUFFIX) $(OBJDIR)ImageManager$(OBJ_SUFFIX)

coverage/pin/build-x64.bat

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
cls
33

44
cl ^
5-
/c ^
5+
/c /Fo /nologo /EHa- /EHs- /GR- /GS- /Gd /Gm- /Gy /MD /O2 /Oi- /Oy- /TP /W3 /WX- /Zc:forScope /Zc:inline /Zc:wchar_t /wd4316 /wd4530 /fp:strict ^
6+
/DTARGET_IA32E /DHOST_IA32E /DTARGET_WINDOWS /DWIN32 /D__PIN__=1 /DPIN_CRT=1 /D_STLP_IMPORT_IOSTREAMS /D__LP64__ ^
7+
/I"%PIN_ROOT%\extras\xed-intel64\include\xed" ^
68
/I%PIN_ROOT%\source\include\pin ^
79
/I%PIN_ROOT%\source\include\pin\gen ^
810
/I%PIN_ROOT%\source\tools\InstLib ^
9-
/I"%PIN_ROOT%\extras\xed-intel64\include\xed" ^
1011
/I%PIN_ROOT%\extras\components\include ^
1112
/I%PIN_ROOT%\extras\stlport\include ^
1213
/I%PIN_ROOT%\extras ^
@@ -16,9 +17,6 @@ cl ^
1617
/I"%PIN_ROOT%\extras\crt\include\arch-x86_64" ^
1718
/I%PIN_ROOT%\extras\crt\include\kernel\uapi ^
1819
/I"%PIN_ROOT%\extras\crt\include\kernel\uapi\asm-x86" ^
19-
/nologo /W3 /WX- /O2 ^
20-
/D TARGET_IA32E /D HOST_IA32E /D TARGET_WINDOWS /D WIN32 /D __PIN__=1 /D PIN_CRT=1 /D __LP64__ ^
21-
/Gm- /MT /GS- /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Gd /TP /wd4530 /GR- /GS- /EHs- /EHa- /FP:strict /Oi- ^
2220
/FIinclude/msvc_compat.h CodeCoverage.cpp ImageManager.cpp ImageManager.h TraceFile.h
2321

2422
link ^
@@ -29,7 +27,7 @@ link ^
2927
/LIBPATH:%PIN_ROOT%\intel64\lib ^
3028
/LIBPATH:"%PIN_ROOT%\intel64\lib-ext" ^
3129
/LIBPATH:"%PIN_ROOT%\extras\xed-intel64\lib" ^
32-
/LIBPATH:%PIN_ROOT%\intel64\runtime\pincrt pin.lib xed.lib pinvm.lib kernel32.lib "stlport-static.lib" "m-static.lib" "c-static.lib" "os-apis.lib" "ntdll-64.lib" crtbeginS.obj ^
30+
/LIBPATH:%PIN_ROOT%\intel64\runtime\pincrt pin.lib xed.lib pinvm.lib pincrt.lib ntdll-64.lib kernel32.lib crtbeginS.obj ^
3331
/NODEFAULTLIB ^
3432
/MANIFEST:NO ^
3533
/OPT:NOREF ^

coverage/pin/build-x86.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
cls
33

44
cl ^
5-
/c /EHa- /EHs- /GR- /GS- /Gd /Gm- /Gy /MT /O2 /Oi- /Oy- /TP /W3 /WX- /Zc:forScope /Zc:inline /Zc:wchar_t /fp:precise /nologo /wd4316 ^
6-
/DTARGET_IA32 /DHOST_IA32 /DTARGET_WINDOWS /DBIGARRAY_MULTIPLIER=1 /DWIN32 /D__PIN__=1 /DPIN_CRT=1 /D__i386__ ^
5+
/c /Fo /nologo /EHa- /EHs- /GR- /GS- /Gd /Gm- /Gy /MD /O2 /Oi- /Oy- /TP /W3 /WX- /Zc:forScope /Zc:inline /Zc:wchar_t /wd4316 /wd4530 /fp:precise ^
6+
/DTARGET_IA32 /DHOST_IA32 /DTARGET_WINDOWS /DWIN32 /D__PIN__=1 /DPIN_CRT=1 /D_STLP_IMPORT_IOSTREAMS /D__i386__ ^
77
/I"%PIN_ROOT%\extras\xed-ia32\include\xed" ^
88
/I%PIN_ROOT%\source\include\pin ^
99
/I%PIN_ROOT%\source\include\pin\gen ^
@@ -28,7 +28,7 @@ link ^
2828
/LIBPATH:%PIN_ROOT%\ia32\lib ^
2929
/LIBPATH:"%PIN_ROOT%\ia32\lib-ext" ^
3030
/LIBPATH:"%PIN_ROOT%\extras\xed-ia32\lib" ^
31-
/LIBPATH:%PIN_ROOT%\ia32\runtime\pincrt pin.lib xed.lib pinvm.lib kernel32.lib "stlport-static.lib" "m-static.lib" "c-static.lib" "os-apis.lib" "ntdll-32.lib" crtbeginS.obj ^
31+
/LIBPATH:%PIN_ROOT%\ia32\runtime\pincrt pin.lib xed.lib pinvm.lib pincrt.lib ntdll-32.lib kernel32.lib crtbeginS.obj ^
3232
/NODEFAULTLIB ^
3333
/MANIFEST:NO ^
3434
/OPT:NOREF ^

0 commit comments

Comments
 (0)