Commit e50b64e2 authored by Julian Kranz's avatar Julian Kranz
Browse files

Jgdrr

parent 85b2a14d
......@@ -9,6 +9,7 @@ import rreil.id.IId;
import rreil.linear.ILinearExpression;
import rreil.operation.ICompareOperation;
import rreil.operation.IOperation;
import rreil.sexpression.ISimpleExpression;
import rreil.statement.IStatement;
public class NativeInterface {
......@@ -326,6 +327,17 @@ public class NativeInterface {
return builder.sem_lin_scale((Long) imm, (ILinearExpression) opnd);
}
/*
* sem_sexpr
*/
private Object sem_sexpr_lin(Object _this) {
return builder.sem_sexpr_lin((ILinearExpression)_this);
}
private Object sem_sexpr_cmp(Object _this) {
return builder.sem_sexpr_lin((ILinearExpression)_this);
}
/*
* sem_op_cmp
*/
......@@ -470,18 +482,18 @@ public class NativeInterface {
}
private Object sem_ite(Object cond, Object then_branch, Object else_branch) {
return builder.sem_ite((ILinearExpression) cond,
return builder.sem_ite((ISimpleExpression) cond,
(IRReilCollection) then_branch, (IRReilCollection) else_branch);
}
private Object sem_while(Object cond, Object body) {
return builder.sem_while((ILinearExpression) cond,
return builder.sem_while((ISimpleExpression) cond,
(IRReilCollection) body);
}
private Object sem_cbranch(Object cond, Object target_true,
Object target_false) {
return builder.sem_cbranch((ILinearExpression) cond,
return builder.sem_cbranch((ISimpleExpression) cond,
(IAddress) target_true, (IAddress) target_false);
}
......
......@@ -42,6 +42,10 @@ import rreil.operation.SignExtendOperation;
import rreil.operation.SignedDivisionOperation;
import rreil.operation.XorOperation;
import rreil.operation.ZeroExtendOperation;
import rreil.sexpression.ISimpleExpression;
import rreil.sexpression.SimpleCompareExpression;
import rreil.sexpression.SimpleExpression;
import rreil.sexpression.SimpleLinearExpression;
import rreil.statement.AssignStatement;
import rreil.statement.BranchStatement;
import rreil.statement.ConditionalBranchStatement;
......@@ -429,6 +433,19 @@ public class DefaultRReilBuilder implements IRReilBuilder {
return new LinearScaleExpression(imm, (LinearExpression) opnd);
}
/*
* sem_sexpr
*/
@Override
public SimpleLinearExpression sem_sexpr_lin(ILinearExpression _this) {
return new SimpleLinearExpression((LinearExpression)_this);
}
@Override
public SimpleCompareExpression sem_sexpr_cmp(ICompareOperation _this) {
return new SimpleCompareExpression((CompareOperation)_this);
}
/*
* sem_op_cmp
*/
......@@ -613,23 +630,23 @@ public class DefaultRReilBuilder implements IRReilBuilder {
}
@Override
public Statement sem_ite(ILinearExpression cond,
public Statement sem_ite(ISimpleExpression cond,
IRReilCollection then_branch, IRReilCollection else_branch) {
return new IfThenElseStatement((LinearExpression) cond,
return new IfThenElseStatement((SimpleExpression) cond,
(DefaultRReilCollection) then_branch,
(DefaultRReilCollection) else_branch);
}
@Override
public Statement sem_while(ILinearExpression cond, IRReilCollection body) {
return new WhileStatement((LinearExpression) cond,
public Statement sem_while(ISimpleExpression cond, IRReilCollection body) {
return new WhileStatement((SimpleExpression) cond,
(DefaultRReilCollection) body);
}
@Override
public Statement sem_cbranch(ILinearExpression cond, IAddress target_true,
public Statement sem_cbranch(ISimpleExpression cond, IAddress target_true,
IAddress target_false) {
return new ConditionalBranchStatement((LinearExpression) cond,
return new ConditionalBranchStatement((SimpleExpression) cond,
(Address) target_true, (Address) target_false);
}
......
......@@ -4,6 +4,7 @@ import rreil.id.IId;
import rreil.linear.ILinearExpression;
import rreil.operation.ICompareOperation;
import rreil.operation.IOperation;
import rreil.sexpression.ISimpleExpression;
import rreil.statement.IStatement;
public interface IRReilBuilder {
......@@ -167,6 +168,14 @@ public interface IRReilBuilder {
ILinearExpression sem_lin_scale(long imm, ILinearExpression opnd);
/*
* sem_sexpr
*/
ISimpleExpression sem_sexpr_lin(ILinearExpression _this);
ISimpleExpression sem_sexpr_cmp(ICompareOperation _this);
/*
* sem_op_cmp
*/
......@@ -253,12 +262,12 @@ public interface IRReilBuilder {
IStatement sem_store(IAddress lhs, IOperation rhs);
IStatement sem_ite(ILinearExpression cond, IRReilCollection then_branch,
IStatement sem_ite(ISimpleExpression cond, IRReilCollection then_branch,
IRReilCollection else_branch);
IStatement sem_while(ILinearExpression cond, IRReilCollection body);
IStatement sem_while(ISimpleExpression cond, IRReilCollection body);
IStatement sem_cbranch(ILinearExpression cond, IAddress target_true,
IStatement sem_cbranch(ISimpleExpression cond, IAddress target_true,
IAddress target_false);
IStatement sem_branch(IBranchHint branch_hint, IAddress target);
......
package rreil.statement;
import rreil.Address;
import rreil.linear.LinearExpression;
import rreil.sexpression.SimpleExpression;
public class ConditionalBranchStatement extends Statement {
protected LinearExpression condition;
protected SimpleExpression condition;
public LinearExpression getCondition() {
public SimpleExpression getCondition() {
return condition;
}
......@@ -22,7 +22,7 @@ public class ConditionalBranchStatement extends Statement {
return targetFalse;
}
public ConditionalBranchStatement(LinearExpression condition,
public ConditionalBranchStatement(SimpleExpression condition,
Address targetTrue, Address targetFalse) {
this.condition = condition;
this.targetTrue = targetTrue;
......
package rreil.statement;
import rreil.DefaultRReilCollection;
import rreil.linear.LinearExpression;
import rreil.sexpression.SimpleExpression;
public class IfThenElseStatement extends Statement {
protected LinearExpression condition;
protected SimpleExpression condition;
public LinearExpression getCondition() {
public SimpleExpression getCondition() {
return condition;
}
......@@ -22,7 +22,7 @@ public class IfThenElseStatement extends Statement {
return elseBranch;
}
public IfThenElseStatement(LinearExpression condition,
public IfThenElseStatement(SimpleExpression condition,
DefaultRReilCollection thenBranch, DefaultRReilCollection elseBranch) {
this.condition = condition;
this.thenBranch = thenBranch;
......
package rreil.statement;
import rreil.DefaultRReilCollection;
import rreil.linear.LinearExpression;
import rreil.sexpression.SimpleExpression;
public class WhileStatement extends Statement {
protected LinearExpression condition;
protected SimpleExpression condition;
public LinearExpression getCondition() {
public SimpleExpression getCondition() {
return condition;
}
......@@ -16,7 +16,7 @@ public class WhileStatement extends Statement {
return body;
}
public WhileStatement(LinearExpression condition,
public WhileStatement(SimpleExpression condition,
DefaultRReilCollection body) {
this.body = body;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment