Skip to content

Commit 19c09a4

Browse files
author
Your Name
committed
Lightkeeper v1.0.0
0 parents  commit 19c09a4

File tree

116 files changed

+6071
-0
lines changed

Some content is hidden

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

116 files changed

+6071
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Ghidra Extension Build
2+
3+
env:
4+
ghidra-url: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.1.5_build/ghidra_10.1.5_PUBLIC_20220726.zip
5+
ghidra-zip-filename: ghidra_10.1.5_PUBLIC_20220726.zip
6+
ghidra-directory: ghidra_10.1.5_PUBLIC
7+
8+
on:
9+
push:
10+
tags:
11+
- '*'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-20.04
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Get the version
21+
id: get_version
22+
run: |
23+
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
24+
echo ::set-output name=CHANGE_LOG::$(git log --pretty=format:"* %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD)
25+
26+
- name: Download Ghidra release
27+
uses: carlosperate/[email protected]
28+
id: download-ghidra
29+
with:
30+
file-url: ${{ env.ghidra-url }}
31+
file-name: ${{ env.ghidra-zip-filename }}
32+
33+
- name: Build
34+
shell: bash
35+
run: |
36+
pwd
37+
unzip -qq ${{ steps.download-ghidra.outputs.file-path }} -d /opt
38+
rm -v ${{ env.ghidra-zip-filename }}
39+
cd lightkeeper
40+
gradle -PGHIDRA_INSTALL_DIR=/opt/${{ env.ghidra-directory }}
41+
mv -v dist/*.zip ${{ github.workspace }}/lightkeeper-${{ steps.get_version.outputs.VERSION }}.zip
42+
43+
- name: Create Release
44+
id: create_release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.ref }}
50+
release_name: Release ${{ github.ref }}
51+
body: |
52+
Change log:
53+
${{ steps.get_version.outputs.CHANGE_LOG }}
54+
draft: false
55+
prerelease: false
56+
57+
- name: Upload Release Asset
58+
id: upload-release-asset
59+
uses: actions/upload-release-asset@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
upload_url: ${{ steps.create_release.outputs.upload_url }}
64+
asset_path: ${{ github.workspace }}/lightkeeper-${{ steps.get_version.outputs.VERSION }}.zip
65+
asset_name: lightkeeper-${{ steps.get_version.outputs.VERSION }}.zip
66+
asset_content_type: application/zip

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
lightkeeper/.gradle/
2+
# lightkeeper/.classpath
3+
# lightkeeper/.project
4+
# lightkeeper/.settings/
5+
lightkeeper/bin/
6+
lightkeeper/build/
7+
lightkeeper/dist/
8+
lightkeeper/dragondance.log

HACKING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Layout
2+
3+
* The Ghidra Module, Eclipse project and the `build.gradle` files are in the directory `lightkeeper` to prevent other files ending up in the release assets.
4+
* The `test_data` directory contains coverage files in various formats
5+
6+
## Build from the command line
7+
8+
* See the [lightkeeper/build.gradle](lightkeeper/build.gradle) script
9+
* Or the [GitHub build script](https://github.com/WorksButNotTested/lightkeeper/blob/9fdab0b90edc0dcc4df1194f0470be466b9da559/.github/workflows/build_on_tag_push.yml#L37-L40)
10+
11+
## Eclipse
12+
Assuming you've read `$GHIDRA_HOME/Extensions/Eclipse/GhidraDev/GhidraDev_README.html` and are familiar with Eclipse.
13+
14+
* Change the Ghidra Paths in the following files:
15+
* [lightkeeper/.classpath](lightkeeper/.classpath)
16+
* [lightkeeper/.project](lightkeeper/.project)

INSTALL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Installing the extension
2+
3+
* Save & close any open code browsers
4+
* Either download the pre-built extension from [github](https://github.com/WorksButNotTested/lightkeeper/releases/latest).
5+
* Or [build it yourself](HACKING.md): e.g. [gradle -PGHIDRA_INSTALL_DIR=$GHIDRA_HOME](https://github.com/WorksButNotTested/lightkeeper/blob/9fdab0b90edc0dcc4df1194f0470be466b9da559/.github/workflows/build_on_tag_push.yml#L37-L40)
6+
* ![File -> Install Extension](res/install-1.png)
7+
* ![Add extension](res/install-2.png)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# lightkeeper
2+
3+
A port of the [Lighthouse plugin](https://github.com/gaasedelen/lighthouse) to GHIDRA.
4+
5+
![Screenshot](https://github.com/WorksButNotTested/lightkeeper/raw/master/res/lightkeeper.png)
6+
7+
<div>Icons made by <a href="https://www.flaticon.com/authors/pixel-perfect" title="Pixel perfect">Pixel perfect</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

lightkeeper/.classpath

Lines changed: 587 additions & 0 deletions
Large diffs are not rendered by default.

lightkeeper/.project

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>LightKeeper</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
<linkedResources>
18+
<link>
19+
<name>Ghidra</name>
20+
<type>2</type>
21+
<location>/opt/ghidra_10.1.5_PUBLIC</location>
22+
</link>
23+
</linkedResources>
24+
</projectDescription>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
3+
org.eclipse.jdt.core.compiler.compliance=11
4+
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
5+
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
6+
org.eclipse.jdt.core.compiler.problem.deprecation=warning
7+
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
8+
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
9+
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
10+
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
11+
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
12+
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
13+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
14+
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
15+
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
16+
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
17+
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
18+
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
19+
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
20+
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
21+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
22+
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
23+
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
24+
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
25+
org.eclipse.jdt.core.compiler.problem.nullReference=warning
26+
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
27+
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
28+
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
29+
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
30+
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
31+
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
32+
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
33+
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
34+
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
35+
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
36+
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
37+
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
38+
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
39+
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
40+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
41+
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
42+
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
43+
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
44+
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
45+
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
46+
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
47+
org.eclipse.jdt.core.compiler.source=11

lightkeeper/Module.manifest

Whitespace-only changes.

lightkeeper/build.gradle

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Builds a Ghidra Extension for a given Ghidra installation.
2+
//
3+
// An absolute path to the Ghidra installation directory must be supplied either by setting the
4+
// GHIDRA_INSTALL_DIR environment variable or Gradle project property:
5+
//
6+
// > export GHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
7+
// > gradle
8+
//
9+
// or
10+
//
11+
// > gradle -PGHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
12+
//
13+
// Gradle should be invoked from the directory of the project to build. Please see the
14+
// application.gradle.version property in <GHIDRA_INSTALL_DIR>/Ghidra/application.properties
15+
// for the correction version of Gradle to use for the Ghidra installation you specify.
16+
17+
18+
plugins {
19+
id 'java'
20+
21+
// Where this plugin (or it's many dependencies) are not available then use git-info.gradle
22+
id 'net.nemerosa.versioning' version '2.13.2'
23+
}
24+
25+
versioning {
26+
gitRepoRootDir = '../'
27+
}
28+
29+
def builtBy = ""
30+
if (System.env.GITHUB_ACTION) {
31+
builtBy = "GitHub Action"
32+
}
33+
34+
jar {
35+
manifest {
36+
attributes(
37+
'Built-By' : "$builtBy",
38+
'Implementation-Version' : "$versioning.info.lastTag-$versioning.info.build",
39+
'Git-Branch' : "$versioning.info.branch",
40+
'Git-Tag' : "$versioning.info.tag",
41+
'Git-Last-Tag' : "$versioning.info.lastTag",
42+
'Git-Dirty' : "$versioning.info.dirty",
43+
'Git-Tag-Major' : "$versioning.info.versionNumber.major",
44+
'Git-Tag-Minor' : "$versioning.info.versionNumber.minor",
45+
'Git-Tag-Patch' : "$versioning.info.versionNumber.patch",
46+
'Git-Commit-Hash' : "$versioning.info.commit",
47+
'Git-Commit-Hash-Short' : "$versioning.info.build",
48+
)
49+
}
50+
}
51+
52+
//----------------------START "DO NOT MODIFY" SECTION------------------------------
53+
def ghidraInstallDir
54+
55+
if (System.env.GHIDRA_INSTALL_DIR) {
56+
ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR
57+
}
58+
else if (project.hasProperty("GHIDRA_INSTALL_DIR")) {
59+
ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR")
60+
}
61+
62+
if (ghidraInstallDir) {
63+
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
64+
}
65+
else {
66+
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
67+
}
68+
//----------------------END "DO NOT MODIFY" SECTION-------------------------------

0 commit comments

Comments
 (0)