public void caseArrayRef(ArrayRef ar) { inArrayRef(ar); caseExprOrRefValueBox(ar.getBaseBox()); caseExprOrRefValueBox(ar.getIndexBox()); // decideCaseExprOrRef(ar.getBase()); // decideCaseExprOrRef(ar.getIndex()); outArrayRef(ar); }
public soot.jimple.ArrayRef newArrayRef(Value base, Value index, ASTNode location) { soot.jimple.ArrayRef ref = Jimple.v().newArrayRef(base, index); createTag(ref, location); soot.tagkit.Tag baseTag = getTag(base); if(baseTag != null) ref.getBaseBox().addTag(baseTag); soot.tagkit.Tag indexTag = getTag(index); if(indexTag != null) ref.getIndexBox().addTag(indexTag); return ref; }
javafy(ar.getIndexBox());
private void convertArrayStoreInsn(InsnNode insn) { int op = insn.getOpcode(); boolean dword = op == LASTORE || op == DASTORE; StackFrame frame = getFrame(insn); if (!units.containsKey(insn)) { Operand valu = dword ? popImmediateDual() : popImmediate(); Operand indx = popImmediate(); Operand base = popLocal(); ArrayRef ar = Jimple.v().newArrayRef(base.stackOrValue(), indx.stackOrValue()); indx.addBox(ar.getIndexBox()); base.addBox(ar.getBaseBox()); AssignStmt as = Jimple.v().newAssignStmt(ar, valu.stackOrValue()); valu.addBox(as.getRightOpBox()); frame.in(valu, indx, base); frame.boxes(as.getRightOpBox(), ar.getIndexBox(), ar.getBaseBox()); setUnit(insn, as); } else { frame.mergeIn(dword ? popDual() : pop(), pop(), pop()); } }
private void convertArrayLoadInsn(InsnNode insn) { StackFrame frame = getFrame(insn); Operand[] out = frame.out(); Operand opr; if (out == null) { Operand indx = popImmediate(); Operand base = popImmediate(); ArrayRef ar = Jimple.v().newArrayRef(base.stackOrValue(), indx.stackOrValue()); indx.addBox(ar.getIndexBox()); base.addBox(ar.getBaseBox()); opr = new Operand(insn, ar); frame.in(indx, base); frame.boxes(ar.getIndexBox(), ar.getBaseBox()); frame.out(opr); } else { opr = out[0]; frame.mergeIn(pop(), pop()); } int op = insn.getOpcode(); if (op == DALOAD || op == LALOAD) { pushDual(opr); } else { push(opr); } }
aref.getIndexBox().addTag(new ColorTag(255, 0, 0, false, "ArrayCheckTag")); } else if (res == 1) { aref.getIndexBox().addTag(new ColorTag(255, 248, 35, false, "ArrayCheckTag")); } else if (res == 2) { aref.getIndexBox().addTag(new ColorTag(255, 163, 0, false, "ArrayCheckTag")); } else if (res == 3) { aref.getIndexBox().addTag(new ColorTag(45, 255, 84, false, "ArrayCheckTag"));
/** * Array Ref Expression Creation - LHS */ private soot.Value getArrayRefLocalLeft(polyglot.ast.ArrayAccess arrayRefExpr) { polyglot.ast.Expr array = arrayRefExpr.array(); polyglot.ast.Expr access = arrayRefExpr.index(); soot.Local arrLocal = (soot.Local) base().createAggressiveExpr(array, false, false); soot.Value arrAccess = base().createAggressiveExpr(access, false, false); soot.Local retLocal = generateLocal(arrayRefExpr.type()); soot.jimple.ArrayRef ref = soot.jimple.Jimple.v().newArrayRef(arrLocal, arrAccess); Util.addLnPosTags(ref.getBaseBox(), arrayRefExpr.array().position()); Util.addLnPosTags(ref.getIndexBox(), arrayRefExpr.index().position()); return ref; }
/** * Array Ref Expression Creation */ private soot.Value getArrayRefLocal(polyglot.ast.ArrayAccess arrayRefExpr) { polyglot.ast.Expr array = arrayRefExpr.array(); polyglot.ast.Expr access = arrayRefExpr.index(); soot.Local arrLocal = (soot.Local) base().createAggressiveExpr(array, false, false); soot.Value arrAccess = base().createAggressiveExpr(access, false, false); soot.Local retLocal = generateLocal(arrayRefExpr.type()); soot.jimple.ArrayRef ref = soot.jimple.Jimple.v().newArrayRef(arrLocal, arrAccess); Util.addLnPosTags(ref.getBaseBox(), arrayRefExpr.array().position()); Util.addLnPosTags(ref.getIndexBox(), arrayRefExpr.index().position()); soot.jimple.Stmt stmt = soot.jimple.Jimple.v().newAssignStmt(retLocal, ref); body.getUnits().add(stmt); Util.addLnPosTags(stmt, arrayRefExpr.position()); return retLocal; }
ValueBox sb = ar.getIndexBox(); if (sb.getValue() instanceof Local) { DalvikTyper.v().setType(sb, IntType.v(), true);
aref.getIndexBox().addTag(new ColorTag(255, 0, 0, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(255, 248, 35, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(255, 163, 0, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(45, 255, 84, false, "ArrayCheckTag"));
aref.getIndexBox().addTag(new ColorTag(255, 0, 0, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(255, 248, 35, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(255, 163, 0, false, "ArrayCheckTag")); aref.getIndexBox().addTag(new ColorTag(45, 255, 84, false, "ArrayCheckTag"));