rolfrolles / ghidrapal Goto Github PK
View Code? Open in Web Editor NEWGhidra Program Analysis Library
Ghidra Program Analysis Library
Given that this is probably the best public implementation for any kind of advanced program analysis on Ghidra, I would like to use the code as a reference, or even downright adapt it for something I might build myself.
But without a license I technically have the assume that this is still copy righted, according to e.g. the GitHub docs
However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work.
Would you consider adding a license so others can build on your work with a clear knowledge of your expectations about derivative works?
(For context for my interest specifically: This is not me being extra careful because of legal reasons, I just want to play around with this as a private side project. I just care about FOSS licensing and it feels rude to just treat this is like any other FOSS software when it technically isn't)
When I had attempted to install the GhiraPAL, I had recieved following errors:
/mnt/hdd/app/ghidra/Ghidra/Features/GhidraPAL/ghidra_scripts hasn't changed, with 5 files failing in previous build(s):
Example3VM.java:19: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Printer;
^
Example3VM.java:20: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Colorizer;
^
Example3VM.java:21: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraState;
^
Example3VM.java:22: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraStateFactory;
^
Example3VM.java:23: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLHighLevelInterface;
^
Example3VM.java:24: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAnalysisOutputOptions;
^
Example3VM.java:45: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 4, randVars, null);
^
symbol: class TVLAbstractGhidraState
location: class Example3VM
Example3VM.java:45: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 4, randVars, null);
^
symbol: variable TVLAbstractGhidraStateFactory
location: class Example3VM
Example3VM.java:53: error: cannot find symbol
TVLHighLevelInterface.AnalyzeCFGRegion(currentProgram, startEa, endEa, true, states, TVLAnalysisOutputOptions.CFGColorizeUnvisited);
^
symbol: variable TVLAnalysisOutputOptions
location: class Example3VM
Example3VM.java:53: error: cannot find symbol
TVLHighLevelInterface.AnalyzeCFGRegion(currentProgram, startEa, endEa, true, states, TVLAnalysisOutputOptions.CFGColorizeUnvisited);
^
symbol: variable TVLHighLevelInterface
location: class Example3VM
Example3VM.java:58: error: cannot find symbol
Printer.Set(tool.getService(ConsoleService.class));
^
symbol: variable Printer
location: class Example3VM
Example3VM.java:59: error: cannot find symbol
Printer.SetFileOutputPath("c:\\temp\\ghidra-debug.txt");
^
symbol: variable Printer
location: class Example3VM
Example3VM.java:60: error: cannot find symbol
Colorizer.Set(tool.getService(ColorizingService.class));
^
symbol: variable Colorizer
location: class Example3VM
HackLu2009.java:35: error: duplicate class: MyMemFaultHandler
class MyMemFaultHandler implements MemoryFaultHandler {
^
HackLu2009.java:50: error: duplicate class: AccruingMemFaultHandler
class AccruingMemFaultHandler implements MemoryFaultHandler {
^
HackLu2009.java:85: error: duplicate class: LoggingMemorizingMemoryBank
class LoggingMemorizingMemoryBank extends MemoryPageBank {
^
HackLu2009.java:116: error: duplicate class: EmulatorTraceGenerator
class EmulatorTraceGenerator {
^
HackLu2009.java:29: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Pair;
^
HackLu2009.java:30: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Printer;
^
HackLu2009.java:31: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.TraceAggregator;
^
HackLu2009.java:32: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.CryptoBitVector;
^
HackLu2009.java:33: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.PowerAnalysisFactory;
^
HackLu2009.java:205: error: cannot find symbol
Pair<List<ArrayList<Byte>>, List<Byte[]>> getSamples(int numSamples) {
^
symbol: class Pair
location: class HackLu2009
HackLu2009.java:206: error: cannot find symbol
Printer.printf("Collecting %d samples\n", numSamples);
^
symbol: variable Printer
location: class HackLu2009
HackLu2009.java:212: error: cannot find symbol
Printer.printf("Collecting sample %d\n", i);
^
symbol: variable Printer
location: class HackLu2009
HackLu2009.java:218: error: incompatible types: byte[] cannot be converted to long
ArrayList<Byte> sample = et.execute(aesDecInput);
^
HackLu2009.java:219: error: cannot find symbol
Printer.printf("Sample %d size is %d\n", i, sample.size());
^
symbol: variable Printer
location: class HackLu2009
HackLu2009.java:223: error: cannot find symbol
return new Pair<List<ArrayList<Byte>>, List<Byte[]>>(samples, pts);
^
symbol: class Pair
location: class HackLu2009
HackLu2009.java:226: error: cannot find symbol
Pair<List<ArrayList<Byte>>, List<Byte[]>> samples = getSamples(nSamples);
^
symbol: class Pair
location: class HackLu2009
HackLu2009.java:229: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(samples.x);
^
symbol: class CryptoBitVector
location: class HackLu2009
HackLu2009.java:229: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(samples.x);
^
symbol: variable TraceAggregator
location: class HackLu2009
HackLu2009.java:230: error: cannot find symbol
PowerAnalysisFactory.aesCPA(1,true).analyzeTrace(points,samples.y);
^
symbol: variable PowerAnalysisFactory
location: class HackLu2009
HackLu2009.java:236: error: cannot find symbol
Printer.Set(tool.getService(ConsoleService.class));
^
symbol: variable Printer
location: class HackLu2009
HackLu2009.java:237: error: cannot find symbol
Printer.SetFileOutputPath("c:\\temp\\ghidra-debug2.txt");
^
symbol: variable Printer
location: class HackLu2009
WyseurWBDES.java:29: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Pair;
^
WyseurWBDES.java:30: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Printer;
^
WyseurWBDES.java:31: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.TraceAggregator;
^
WyseurWBDES.java:32: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.CryptoBitVector;
^
WyseurWBDES.java:33: error: package ghidra.pal.wbc does not exist
import ghidra.pal.wbc.PowerAnalysisFactory;
^
WyseurWBDES.java:212: error: cannot find symbol
Pair<List<ArrayList<Byte>>, List<Long>> getSamples(int numSamples) {
^
symbol: class Pair
location: class WyseurWBDES
WyseurWBDES.java:40: error: cannot find symbol
Printer.printf("%s: uninitializedRead(%s,%d,_,%x)\n", variety, address.toString(), size, bufOffset);
^
symbol: variable Printer
location: class MyMemFaultHandler
WyseurWBDES.java:45: error: cannot find symbol
Printer.printf("%s: unknownAddress(%s,%b)\n", variety, address.toString(), write);
^
symbol: variable Printer
location: class MyMemFaultHandler
WyseurWBDES.java:80: error: cannot find symbol
Printer.printf("%s: unknownAddress(%s,%b)\n", variety, address.toString(), write);
^
symbol: variable Printer
location: class AccruingMemFaultHandler
WyseurWBDES.java:163: error: method executeInstruction in class ghidra.pcode.emulate.Emulate cannot be applied to given types;
Emulator.executeInstruction(true);
^
required: boolean,ghidra.util.task.TaskMonitor
found: boolean
reason: actual and formal argument lists differ in length
WyseurWBDES.java:187: error: ghidra.pcode.memstate.MemoryState is abstract; cannot be instantiated
ms = new MemoryState(l);
^
WyseurWBDES.java:218: error: cannot find symbol
Printer.printf("Collecting sample %d\n", i);
^
symbol: variable Printer
location: class WyseurWBDES
WyseurWBDES.java:225: error: cannot find symbol
return new Pair<List<ArrayList<Byte>>, List<Long>>(samples, pts);
^
symbol: class Pair
location: class WyseurWBDES
WyseurWBDES.java:229: error: cannot find symbol
Pair<List<ArrayList<Byte>>, List<Long>> samples = getSamples(nSamples);
^
symbol: class Pair
location: class WyseurWBDES
WyseurWBDES.java:232: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(samples.x);
^
symbol: class CryptoBitVector
location: class WyseurWBDES
WyseurWBDES.java:232: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(samples.x);
^
symbol: variable TraceAggregator
location: class WyseurWBDES
WyseurWBDES.java:233: error: cannot find symbol
PowerAnalysisFactory.desCPA().analyzeTrace(points,samples.y);
^
symbol: variable PowerAnalysisFactory
location: class WyseurWBDES
WyseurWBDES.java:240: error: cannot find symbol
Printer.printf("DPA(%d): collecting %d more samples\n", i, nSamplesPer);
^
symbol: variable Printer
location: class WyseurWBDES
WyseurWBDES.java:241: error: cannot find symbol
Pair<List<ArrayList<Byte>>, List<Long>> samples = getSamples(nSamplesPer);
^
symbol: class Pair
location: class WyseurWBDES
WyseurWBDES.java:246: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(allSamples);
^
symbol: class CryptoBitVector
location: class WyseurWBDES
WyseurWBDES.java:246: error: cannot find symbol
List<CryptoBitVector> points = TraceAggregator.aggregate(allSamples);
^
symbol: variable TraceAggregator
location: class WyseurWBDES
WyseurWBDES.java:247: error: cannot find symbol
PowerAnalysisFactory.desDPA().analyzeTrace(points,allPlaintexts);
^
symbol: variable PowerAnalysisFactory
location: class WyseurWBDES
WyseurWBDES.java:259: error: cannot find symbol
Printer.Set(tool.getService(ConsoleService.class));
^
symbol: variable Printer
location: class WyseurWBDES
WyseurWBDES.java:260: error: cannot find symbol
Printer.SetFileOutputPath("c:\\temp\\ghidra-debug2.txt");
^
symbol: variable Printer
location: class WyseurWBDES
Example2ARM.java:19: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Printer;
^
Example2ARM.java:20: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Colorizer;
^
Example2ARM.java:21: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraState;
^
Example2ARM.java:22: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraStateFactory;
^
Example2ARM.java:23: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLHighLevelInterface;
^
Example2ARM.java:24: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAnalysisOutputOptions;
^
Example2ARM.java:27: error: cannot find symbol
public void runWithAnalysisOptions(TVLAnalysisOutputOptions opts) throws Exception {
^
symbol: class TVLAnalysisOutputOptions
location: class Example2ARM
Example2ARM.java:31: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 6, randVars, null);
^
symbol: class TVLAbstractGhidraState
location: class Example2ARM
Example2ARM.java:31: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 6, randVars, null);
^
symbol: variable TVLAbstractGhidraStateFactory
location: class Example2ARM
Example2ARM.java:39: error: cannot find symbol
TVLHighLevelInterface.AnalyzeRange(currentProgram, startEa, endEa, true, states, opts);
^
symbol: variable TVLHighLevelInterface
location: class Example2ARM
Example2ARM.java:45: error: cannot find symbol
Printer.Set(tool.getService(ConsoleService.class));
^
symbol: variable Printer
location: class Example2ARM
Example2ARM.java:46: error: cannot find symbol
Printer.SetFileOutputPath("c:\\temp\\ghidra-debug.txt");
^
symbol: variable Printer
location: class Example2ARM
Example2ARM.java:47: error: cannot find symbol
Colorizer.Set(tool.getService(ColorizingService.class));
^
symbol: variable Colorizer
location: class Example2ARM
Example2ARM.java:50: error: cannot find symbol
runWithAnalysisOptions(TVLAnalysisOutputOptions.ResolvedBranchComments);
^
symbol: variable TVLAnalysisOutputOptions
location: class Example2ARM
Example1TF.java:19: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Pair;
^
Example1TF.java:20: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Printer;
^
Example1TF.java:21: error: package ghidra.pal.util does not exist
import ghidra.pal.util.Colorizer;
^
Example1TF.java:22: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraState;
^
Example1TF.java:23: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAbstractGhidraStateFactory;
^
Example1TF.java:24: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLHighLevelInterface;
^
Example1TF.java:25: error: package ghidra.pal.absint.tvl does not exist
import ghidra.pal.absint.tvl.TVLAnalysisOutputOptions;
^
Example1TF.java:34: error: cannot find symbol
List<Pair<String,Long>> fixedVars = null;
^
symbol: class Pair
location: class Example1TF
Example1TF.java:39: error: cannot find symbol
fixedVars = new ArrayList<Pair<String,Long>>(Arrays.asList(new Pair<String,Long>("TF", lTFVal)));
^
symbol: class Pair
location: class Example1TF
Example1TF.java:39: error: cannot find symbol
fixedVars = new ArrayList<Pair<String,Long>>(Arrays.asList(new Pair<String,Long>("TF", lTFVal)));
^
symbol: class Pair
location: class Example1TF
Example1TF.java:48: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 4, randVars, fixedVars);
^
symbol: class TVLAbstractGhidraState
location: class Example1TF
Example1TF.java:48: error: cannot find symbol
List<TVLAbstractGhidraState> states = TVLAbstractGhidraStateFactory.MakeInputStatesRandInit(currentProgram, 4, randVars, fixedVars);
^
symbol: variable TVLAbstractGhidraStateFactory
location: class Example1TF
Example1TF.java:60: error: cannot find symbol
TVLHighLevelInterface.AnalyzeRange(currentProgram, startEa, endEa, true, states, TVLAnalysisOutputOptions.ResolvedBranchPrints);
^
symbol: variable TVLAnalysisOutputOptions
location: class Example1TF
Example1TF.java:60: error: cannot find symbol
TVLHighLevelInterface.AnalyzeRange(currentProgram, startEa, endEa, true, states, TVLAnalysisOutputOptions.ResolvedBranchPrints);
^
symbol: variable TVLHighLevelInterface
location: class Example1TF
Example1TF.java:71: error: cannot find symbol
Printer.Set(tool.getService(ConsoleService.class));
^
symbol: variable Printer
location: class Example1TF
Example1TF.java:72: error: cannot find symbol
Printer.SetFileOutputPath("c:\\temp\\ghidra-debug.txt");
^
symbol: variable Printer
location: class Example1TF
Example1TF.java:73: error: cannot find symbol
Colorizer.Set(tool.getService(ColorizingService.class));
^
symbol: variable Colorizer
location: class Example1TF
Thanks in advance!
Was using the cfg part and had a crash. I was just printing the cfg for each function in a binary and it worked on some functions but on a couple it would crash. Traced it to Line 115 of src/main/java/ghidra/pal/cfg/PcodeOpProvider.java. I believe it should be >= instead of >, as if addr.y is 0 and length is 0 there will be a crash on line 119 of the same file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.