if (s.containsArrayRef()) { ArrayRef arrayRef = s.getArrayRef(); handleArrayRef(arrayRef, out); if (s.containsFieldRef()) { FieldRef fieldRef = s.getFieldRef(); handleFieldRef(fieldRef, out); if (s.containsInvokeExpr()) { InvokeExpr invokeExpr = s.getInvokeExpr(); handleInvokeExpr(invokeExpr, out);
for (ValueBox vbox : stmt.getUseAndDefBoxes()) { Value v = vbox.getValue();
while (liveLocalsIt.hasNext()) { Value v = (Value) liveLocalsIt.next(); s.addTag(new StringTag("Live Variable: " + v, "Live Variable")); Iterator usesIt = s.getUseBoxes().iterator(); while (usesIt.hasNext()) { ValueBox use = (ValueBox) usesIt.next(); Iterator defsIt = s.getDefBoxes().iterator(); while (defsIt.hasNext()) { ValueBox def = (ValueBox) defsIt.next();
@Override protected void internalTransform(Body b, String phaseName, Map<String, String> options) { for (Unit u : b.getUnits()) { Stmt s = (Stmt) u; if (s.containsInvokeExpr()) { InvokeExpr ie = s.getInvokeExpr(); if (FixedMethods.isFixed(ie)) { System.err.println("+++ " + ie); yes++; } else { System.err.println(" - " + ie); no++; } } } }
if (s.containsInvokeExpr()) { if (!pag.getCGOpts().types_for_invoke()) { return; InvokeExpr iexpr = s.getInvokeExpr(); if (iexpr instanceof VirtualInvokeExpr) { if (!isReflectionNewInstance(iexpr)) { s.apply(new AbstractStmtSwitch() { @Override final public void caseAssignStmt(AssignStmt as) {
Iterator boxIt = s.getUseBoxes().iterator(); s.clearUnitBoxes(); s.clearUnitBoxes(); s.containsInvokeExpr()) InvokeExpr e = s.getInvokeExpr(); newInvoke.addAllTagsOf(s);
if (((Stmt) u).containsFieldRef() && ((Stmt) u).getFieldRef().getType() instanceof ArrayType) { FieldRef fr = ((Stmt) u).getFieldRef(); String sig = fr.getField().getSignature(); Verify.verify(fieldSubstitutionMap.containsKey(sig), "No entry found for " + fr + " in stmt " + u); fr.setFieldRef(fieldSubstitutionMap.get(sig).makeRef()); } else if (((Stmt) u).containsInvokeExpr()) { InvokeExpr ive = ((Stmt) u).getInvokeExpr(); final String oldSignature = ive.getMethodRef().toString(); if (methodSubstitutionMap.containsKey(oldSignature)) { if (((Stmt) u).containsArrayRef()) { ArrayRef aref = ((Stmt) u).getArrayRef(); am.makeRef(), Arrays.asList(new Value[] { aref.getIndex(), ((DefinitionStmt) u).getRightOp() }))); ivk.addAllTagsOf(u); ((Stmt) u).getArrayRefBox().setValue(ivk); Stmt ccall = Jimple.v() .newInvokeStmt(Jimple.v().newSpecialInvokeExpr(lhs, constructor.makeRef(), na.getSize())); ccall.addAllTagsOf(u); body.getUnits().insertAfter(ccall, u); } else if (u instanceof DefinitionStmt Stmt ccall = Jimple.v() .newInvokeStmt(Jimple.v().newSpecialInvokeExpr(lhs, constructor.makeRef(), args)); ccall.addAllTagsOf(u); body.getUnits().insertAfter(ccall, u);
while (unitsIt.hasNext()) { Stmt s = (Stmt) unitsIt.next(); if (s.containsFieldRef()) { FieldRef fr = s.getFieldRef(); if (fr.getFieldRef().resolve().getDeclaringClass() == appClass) { if (fr instanceof StaticFieldRef) { if (s.containsInvokeExpr()) { InvokeExpr ie = s.getInvokeExpr(); if (ie.getMethodRef().resolve().getDeclaringClass() == appClass) // what about sub/superclasses
if (!s.containsInvokeExpr()) { continue; InvokeExpr ie = s.getInvokeExpr(); SootMethod target = ie.getMethod(); if (target.getDeclaringClass().getName().equals("java.lang.System") && target.getName().equals("exit")) { for (Iterator<Unit> sIt = m.getActiveBody().getUnits().iterator(); sIt.hasNext();) { final Stmt s = (Stmt) sIt.next(); for (Iterator<ValueBox> bIt = s.getUseBoxes().iterator(); bIt.hasNext();) { final ValueBox b = bIt.next(); Value v = b.getValue(); if (!s.containsInvokeExpr()) { continue; InvokeExpr ie = s.getInvokeExpr(); SootMethod target = ie.getMethod(); calls(target);
Stmt use = (Stmt) uuse; if (!use.containsArrayRef() || !defLocals.contains(use.getArrayRef().getBase())) { replaceWithNull(use); if (u instanceof Stmt) { Stmt stmt = (Stmt) u; if (stmt.containsInvokeExpr()) { InvokeExpr invExpr = stmt.getInvokeExpr(); for (int i = 0; i < invExpr.getArgCount(); i++) { if (isObject(invExpr.getMethodRef().parameterType(i))) {
oldStmt.apply(new AbstractStmtSwitch() { public void caseAssignStmt(AssignStmt s) { newStmtBox.setUnit(Grimp.v().newAssignStmt(s)); useBoxesIt = newStmt.getUseBoxes().iterator(); while (useBoxesIt.hasNext()) { ValueBox b = (useBoxesIt.next()); b.setValue(Grimp.v().newExpr(b.getValue())); useBoxesIt = newStmt.getDefBoxes().iterator(); while (useBoxesIt.hasNext()) { ValueBox b = (useBoxesIt.next()); updates.add(updateStmtBox.getUnit()); if (oldStmt.hasTag("LineNumberTag")) { newStmt.addTag(oldStmt.getTag("LineNumberTag")); if (oldStmt.hasTag("SourceLnPosTag")) { newStmt.addTag(oldStmt.getTag("SourceLnPosTag")); Stmt stmt = (Stmt) (it.next()); stmt.apply(new AbstractStmtSwitch() { public void caseGotoStmt(GotoStmt s) { GotoStmt newStmt = (GotoStmt) (oldToNew.get(s));
public Edge(MethodOrMethodContext src, Stmt srcUnit, MethodOrMethodContext tgt) { this.kind = ieToKind(srcUnit.getInvokeExpr()); this.src = src; this.srcUnit = srcUnit; this.tgt = tgt; }
Chain<Unit> inlineeUnits = inlineeB.getUnits(); InvokeExpr ie = toInline.getInvokeExpr(); for (Iterator<Unit> currIt = inlineeUnits.iterator(); currIt.hasNext();) { final Stmt curr = (Stmt) currIt.next(); Stmt currPrime = (Stmt) curr.clone(); if (currPrime == null) { throw new RuntimeException("getting null from clone!"); currPrime.addAllTagsOf(curr); Stmt patchee = (Stmt) it.next(); for (ValueBox box : patchee.getUseAndDefBoxes()) { if (!(box.getValue() instanceof Local)) { continue; for (UnitBox box : patchee.getUnitBoxes()) { Unit uPrime = (oldUnitsToNew.get(box.getUnit())); if (uPrime != null) {
if (fromStmt == null || !fromStmt.containsInvokeExpr()) return; SootMethod callee = fromStmt.getInvokeExpr().getMethod(); InstanceInvokeExpr iiexpr = (InstanceInvokeExpr) fromStmt.getInvokeExpr(); args.add(iiexpr.getBase()); args.add(iiexpr.getArg(0)); } else if (fromStmt.toString().contains("bindService")) { Value arg0 = fromStmt.getInvokeExpr().getArg(0); // intent Value arg1 = fromStmt.getInvokeExpr().getArg(1); // serviceConnection args.add(arg1); args.add(arg0); } else { Value arg0 = fromStmt.getInvokeExpr().getArg(0); args.add(arg0); List<ValueBox> vbs = stmt.getUseAndDefBoxes(); Unit assignU = Jimple.v().newAssignStmt(vbs.get(0).getValue(), vbs.get(1).getValue()); copyTags(stmt, assignU);
if (s.containsArrayRef()) { ArrayRef aref = s.getArrayRef(); obj = aref.getBase(); } else { } else { Iterator<ValueBox> boxIt; boxIt = s.getDefBoxes().iterator(); while (boxIt.hasNext()) { ValueBox vBox = (ValueBox) boxIt.next(); boxIt = s.getUseBoxes().iterator(); while (boxIt.hasNext()) { ValueBox vBox = (ValueBox) boxIt.next(); s.addTag(nullTag);
FieldRef fr = null; SootField sf = null; if (s.containsFieldRef()) { fr = s.getFieldRef(); sf = fr.getField(); if (sf != null) {
@Override public boolean isCallStmt(Unit u) { return ((Stmt) u).containsInvokeExpr(); }
Value expr = fromStmt.getInvokeExprBox().getValue(); Value arg0 = null; if (expr instanceof JVirtualInvokeExpr) Value arg1 = fromStmt.getInvokeExpr().getArg(0); args.add(arg0); args.add(arg1); Value arg0 = fromStmt.getInvokeExpr().getArg(0); //intent Value arg1 = fromStmt.getInvokeExpr().getArg(1); //serviceConnection args.add(arg1); args.add(arg0); Value arg0 = fromStmt.getInvokeExpr().getArg(0); args.add(arg0); List<ValueBox> vbs = stmt.getUseAndDefBoxes(); Unit assignU = Jimple.v().newAssignStmt(vbs.get(0).getValue(), vbs.get(1).getValue()); copyTags(stmt, assignU);
if (!s.containsArrayRef()) { return; ArrayRef op = s.getArrayRef();