Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
ubfx committed Mar 9, 2020
0 parents commit baa15cb
Show file tree
Hide file tree
Showing 14 changed files with 26,676 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
bin/
build/
dist/
lib/*
.externalToolBuilders/
src/main/com/
.project
.classpath
.settings
Empty file added Module.manifest
Empty file.
64 changes: 64 additions & 0 deletions build.gradle
@@ -0,0 +1,64 @@
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
apply plugin: 'eclipse'

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
}
}

dependencies {
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.11.4'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.30.1'
}

protobuf {
// Configure the protoc executable.
protoc {
artifact = 'com.google.protobuf:protoc:3.11.4'
}

generateProtoTasks.generatedFilesBaseDir = 'src/'

generateProtoTasks {
all().each {
it.group = 'generate proto'
}
}
}

task copyLib(type: Copy) {
from (configurations.compile) {
include '*sqlite*'
}
into 'lib/'
}

// Extend jar task to collect extra dependencies.
jar {
dependsOn copyLib
}

// Standard Ghidra extension Gradle code follows.
//----------------------START "DO NOT MODIFY" SECTION------------------------------
def ghidraInstallDir

if (System.env.GHIDRA_INSTALL_DIR) {
ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR
}
else if (project.hasProperty("GHIDRA_INSTALL_DIR")) {
ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR")
}

if (ghidraInstallDir) {
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
}
else {
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
}
//----------------------END "DO NOT MODIFY" SECTION-------------------------------
5 changes: 5 additions & 0 deletions extension.properties
@@ -0,0 +1,5 @@
name=BinDiffHelper
description=The extension description can be customized by editing the extension.properties file.
author=
createdOn=
version=9.2
74 changes: 74 additions & 0 deletions src/main/java/bindiffhelper/BinDiffHelperPlugin.java
@@ -0,0 +1,74 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package bindiffhelper;

import ghidra.app.ExamplesPluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.plugin.ProgramPlugin;
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
import ghidra.app.services.CodeViewerService;
import ghidra.framework.plugintool.PluginInfo;
import ghidra.framework.plugintool.PluginTool;
import ghidra.framework.plugintool.util.PluginStatus;
import ghidra.program.model.listing.Program;

/**
* TODO: Provide class-level documentation that describes what this plugin does.
*/
//@formatter:off
@PluginInfo(
status = PluginStatus.STABLE,
packageName = ExamplesPluginPackage.NAME,
category = PluginCategoryNames.ANALYSIS,
shortDescription = "Plugin short description goes here.",
description = "Plugin long description goes here.",
servicesRequired = { CodeViewerService.class }
)
//@formatter:on
public class BinDiffHelperPlugin extends ProgramPlugin {

BinDiffHelperProvider provider;

/**
* Plugin constructor.
*
* @param tool The plugin tool that this plugin is added to.
*/
public BinDiffHelperPlugin(PluginTool tool) {
super(tool, true, true);

provider = new BinDiffHelperProvider(this, this.getCurrentProgram());
provider.setTitle("BinDiffHelper");
provider.addToTool();


}

@Override
public void init() {
super.init();

// TODO: Acquire services if necessary
}

@Override
protected void programActivated(Program p)
{
provider.setProgram(p);
}


}

0 comments on commit baa15cb

Please sign in to comment.