forked from cmu-sei/kaiju
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2563fec
commit 6feaa30
Showing
23 changed files
with
148 additions
and
752 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,15 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
ghidra_version: [10.3, 10.3.1, 10.3.2, 10.3.3] | ||
ghidra_version: [10.3, 10.3.1, 10.3.2, 10.3.3, 10.4] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up ccache | ||
uses: hendrikmuhs/[email protected] | ||
- name: Set up ccache PATH | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
|
@@ -44,7 +49,7 @@ jobs: | |
GHIDRA_INSTALL_DIR: '${{ github.workspace }}/ghidra_${{ matrix.ghidra_version }}_PUBLIC/' | ||
KAIJU_AUTOCATS_DIR: '${{ github.workspace }}/autocats/' | ||
run: | | ||
gradle --build-cache install | ||
env CC="cache gcc" CXX="ccache g++" gradle --build-cache install | ||
- name: Checkout AUTOCATS repo for testing | ||
uses: actions/checkout@v3 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/*** | ||
* CERT Kaiju Copyright 2021 Carnegie Mellon University. | ||
* | ||
* NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS | ||
* FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER | ||
* EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR | ||
* PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE | ||
* MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, | ||
* TRADEMARK, OR COPYRIGHT INFRINGEMENT. | ||
* | ||
* Released under a BSD (SEI)-style license, please see LICENSE.md or contact [email protected] | ||
* for full terms. | ||
* | ||
* [DISTRIBUTION STATEMENT A] This material has been approved for public release and unlimited | ||
* distribution. Please see Copyright notice for non-US Government use and distribution. | ||
* | ||
* Carnegie Mellon (R) and CERT (R) are registered in the U.S. Patent and Trademark Office by | ||
* Carnegie Mellon University. | ||
* | ||
* This Software includes and/or makes use of the following Third-Party Software subject to its own | ||
* license: 1. OpenJDK (http://openjdk.java.net/legal/gplv2+ce.html) Copyright 2021 Oracle. 2. | ||
* Ghidra (https://github.com/NationalSecurityAgency/ghidra/blob/master/LICENSE) Copyright 2021 | ||
* National Security Administration. 3. GSON (https://github.com/google/gson/blob/master/LICENSE) | ||
* Copyright 2020 Google. 4. JUnit (https://github.com/junit-team/junit5/blob/main/LICENSE.md) | ||
* Copyright 2020 JUnit Team. 5. Gradle (https://github.com/gradle/gradle/blob/master/LICENSE) | ||
* Copyright 2021 Gradle Inc. 6. markdown-gradle-plugin | ||
* (https://github.com/kordamp/markdown-gradle-plugin/blob/master/LICENSE.txt) Copyright 2020 Andres | ||
* Almiray. 7. Z3 (https://github.com/Z3Prover/z3/blob/master/LICENSE.txt) Copyright 2021 Microsoft | ||
* Corporation. 8. jopt-simple (https://github.com/jopt-simple/jopt-simple/blob/master/LICENSE.txt) | ||
* Copyright 2021 Paul R. Holser, Jr. | ||
* | ||
* DM21-0792 | ||
*/ | ||
package kaiju.common; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
import ghidra.framework.options.ToolOptions; | ||
import ghidra.framework.plugintool.ServiceProvider; | ||
|
||
public class KaijuGhidraCompat { | ||
|
||
/** | ||
* This is a helper function to return the ToolOptions for a specific service. | ||
* @param sp The service provider | ||
* @param serviceNAme The specific service | ||
* @return The ToolOptions for service | ||
* @throws SecurityException | ||
* @throws InvocationTargetException | ||
* @throws IllegalArgumentException | ||
**/ | ||
public static ToolOptions getToolOptions(ServiceProvider sp, String serviceName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException { | ||
Class<?> OptionsServiceClass; | ||
|
||
try { | ||
OptionsServiceClass = Class.forName("ghidra.framework.plugin.util.OptionsService"); | ||
} | ||
catch (ClassNotFoundException e) { | ||
OptionsServiceClass = Class.forName("docking.options.OptionsService"); | ||
} | ||
|
||
var optionService = sp.getService(OptionsServiceClass); | ||
|
||
if (optionService != null) { | ||
ToolOptions opt = (ToolOptions) OptionsServiceClass.getMethod("getOptions", String.class).invoke(optionService, serviceName); | ||
return opt; | ||
} else { | ||
throw new RuntimeException("Could not get options for service " + serviceName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.