Java Code Examples for soot.jimple.InstanceFieldRef#getField()

The following examples show how to use soot.jimple.InstanceFieldRef#getField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StmtVisitor.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
private Insn buildInstanceFieldPutInsn(InstanceFieldRef destRef, Value source) {
	SootField destSootField = destRef.getField();
	BuilderFieldReference destField = DexPrinter.toFieldReference(destSootField, belongingFile);
	Value instance = destRef.getBase();
	Register instanceReg = regAlloc.asLocal(instance);
	Register sourceReg = regAlloc.asImmediate(source, constantV);
	Opcode opc = getPutGetOpcodeWithTypeSuffix("iput", destField.getType());
	return new Insn22c(opc, sourceReg, instanceReg, destField);
}
 
Example 2
Source File: StmtVisitor.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
private Insn buildInstanceFieldGetInsn(Register destinationReg, InstanceFieldRef sourceRef) {
	Value instance = sourceRef.getBase();
	Register instanceReg = regAlloc.asLocal(instance);
	SootField sourceSootField = sourceRef.getField();
	BuilderFieldReference sourceField = DexPrinter.toFieldReference(sourceSootField, belongingFile);
	Opcode opc = getPutGetOpcodeWithTypeSuffix("iget", sourceField.getType());
	return new Insn22c(opc, destinationReg, instanceReg, sourceField);
}
 
Example 3
Source File: AbstractBoomerangSolver.java    From SPDS with Eclipse Public License 2.0 5 votes vote down vote up
protected Field getWrittenField(Stmt curr) {
    AssignStmt as = (AssignStmt) curr;
    if (as.getLeftOp() instanceof StaticFieldRef) {
        StaticFieldRef staticFieldRef = (StaticFieldRef) as.getLeftOp();
        return new Field(staticFieldRef.getField());
    }
    InstanceFieldRef ifr = (InstanceFieldRef) as.getLeftOp();
    return new Field(ifr.getField());
}
 
Example 4
Source File: WeightedBoomerang.java    From SPDS with Eclipse Public License 2.0 5 votes vote down vote up
protected FieldReadPOI createFieldLoad(Statement s) {
    Stmt stmt = s.getUnit().get();
    AssignStmt as = (AssignStmt) stmt;
    InstanceFieldRef ifr = (InstanceFieldRef) as.getRightOp();
    Val base = new Val(ifr.getBase(), icfg().getMethodOf(as));
    Field field = new Field(ifr.getField());
    return fieldReads
            .getOrCreate(new FieldReadPOI(s, base, field, new Val(as.getLeftOp(), icfg().getMethodOf(as))));
}
 
Example 5
Source File: WeightedBoomerang.java    From SPDS with Eclipse Public License 2.0 5 votes vote down vote up
protected FieldWritePOI createFieldStore(Statement s) {
    Stmt stmt = s.getUnit().get();
    AssignStmt as = (AssignStmt) stmt;
    InstanceFieldRef ifr = (InstanceFieldRef) as.getLeftOp();
    Val base = new Val(ifr.getBase(), icfg().getMethodOf(as));
    Val stored = new Val(as.getRightOp(), icfg().getMethodOf(as));
    Field field = new Field(ifr.getField());
    return fieldWrites.getOrCreate(new FieldWritePOI(s, base, field, stored));
}
 
Example 6
Source File: AbstractBoomerangSolver.java    From SPDS with Eclipse Public License 2.0 4 votes vote down vote up
protected Field getLoadedField(Stmt curr) {
    AssignStmt as = (AssignStmt) curr;
    InstanceFieldRef ifr = (InstanceFieldRef) as.getRightOp();
    return new Field(ifr.getField());
}