Skip to content

Commit

Permalink
Un-breaking a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
RolfRolles committed Apr 18, 2019
1 parent 8439164 commit ed8bc9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extension.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name=@extname@
description=Ghidra Program Analysis Library
author=Rolf Rolles
createdOn=April 17th, 2019
version=0.0
version=@extversion@
4 changes: 2 additions & 2 deletions ghidra_scripts/Example2ARM.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public void run() throws Exception {
Colorizer.Set(tool.getService(ColorizingService.class));

// This option adds comments for any branches that it resolves.
// runWithAnalysisOptions(TVLAnalysisOutputOptions.ResolvedBranchComments);
runWithAnalysisOptions(TVLAnalysisOutputOptions.ResolvedBranchComments);

// This will add comments with the symbolic values of variables modified on a
// given line (e.g. "101?0??0" for an 8-bit quantity that is written).
runWithAnalysisOptions(TVLAnalysisOutputOptions.ValueComments);
// runWithAnalysisOptions(TVLAnalysisOutputOptions.ValueComments);

// This will add comments when the PcodeOp objects have changed.
// runWithAnalysisOptions(TVLAnalysisOutputOptions.PcodeComments);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/ghidra/pal/absint/tvl/TVLPcodeTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ protected Varnode replaceInputWithConstant(Varnode input) {
// a COPY PcodeOp -- an assignment of the constant to the output.
protected PcodeOp replaceOutputWithConstant(Pair<Pair<Address,Integer>,PcodeOp> p) {
TVLBitVector out0Bv = thisInterp.AbstractState.Lookup(p.y.getOutput());
recordOutputValue(out0Bv);
Pair<Integer,Long> out0Const = out0Bv.GetConstantValue();
if(out0Const != null)
return MakeCopy(p, MakeConstant(out0Const));
Expand All @@ -116,8 +117,10 @@ protected PcodeOp transformUnary(Pair<Pair<Address,Integer>,PcodeOp> p) {

// If it was a COPY with constant input, ignore it.
if(p.y.getOpcode() == PcodeOp.COPY) {
if(input.isConstant())
if(input.isConstant()) {
recordOutputValue(thisInterp.AbstractState.Lookup(p.y.getOutput()));
return null;
}
}

// Resolve output as a three-valued bitvector.
Expand Down

0 comments on commit ed8bc9a

Please # to comment.