Java 类soot.jimple.DynamicInvokeExpr 实例源码

项目:petablox    文件:DomI.java   
@Override
public String toFIString(Unit u) {
    StringBuilder sb = new StringBuilder();
    boolean printId = Utils.buildBoolProperty("petablox.printrel.printID", false);
    if (printId) sb.append("(" + indexOf(u) + ")");
    InvokeExpr ie = SootUtilities.getInvokeExpr(u);
    if (ie instanceof DynamicInvokeExpr) {
        return "";
    }
    if (SootUtilities.isInterfaceInvoke(u)) sb.append("INTERFACEINVK:");
    else if (SootUtilities.isVirtualInvoke(u)) sb.append("VIRTUALINVK:");
    else if (SootUtilities.isStaticInvoke(u)) sb.append("STATICINVK:");
    else if (SootUtilities.isInstanceInvoke(u)) sb.append("SPECINVK:");
    SootMethod m = SootUtilities.getInvokeExpr(u).getMethod();
    sb.append(m.getName() + "@" + m.getDeclaringClass().getName() + "@" + SootUtilities.toJavaLocStr(u));
    return sb.toString();
}
项目:petablox    文件:RelThreadAllocI.java   
@Override
public void fill() {
    DomI domI = (DomI) doms[0];
    int numI = domI.size();
    for (int i = 0; i < numI; i++) {
        Unit q = domI.get(i);
        if(SootUtilities.isInvoke(q)) {
            InvokeExpr ie = SootUtilities.getInvokeExpr(q);
            if(ie instanceof DynamicInvokeExpr)
                continue;
            SootMethod m = ie.getMethod();
            if (m.getDeclaringClass().getName().equals("java.lang.Thread") &&
                    m.getName().toString().equals("<init>")) {
                add(i);
            }
        }
    }
}
项目:petablox    文件:RelThreadStartI.java   
@Override
public void fill() {
    DomI domI = (DomI) doms[0];
    int numI = domI.size();
    for (int i = 0; i < numI; i++) {
        Unit q = domI.get(i);
        if(SootUtilities.isInvoke(q)) {
            InvokeExpr ie = SootUtilities.getInvokeExpr(q);
            if(ie instanceof DynamicInvokeExpr)
                continue;
            SootMethod m = ie.getMethod();
            if (m.getName().toString().equals("start") &&
                    //m.getDesc().toString().equals("()V") &&
                    m.getParameterCount() == 0 && (m.getReturnType() instanceof VoidType) &&
                    m.getDeclaringClass().getName().equals("java.lang.Thread")) {
                add(i);
            }
        }
    }
}
项目:jgs    文件:AnnotationValueSwitch.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    logger.fine("Invoke expression is of type DynamicInvoke");
    logger.finest(v.toString());
    rightElement = RightElement.NOT;

    if (actualContext == StmtContext.INVOKE 
            || actualContext == StmtContext.ASSIGNRIGHT ) {
        Local[] args = vh.getArgumentsForInvokedMethod(v);
        String method = v.getMethod().toString();

        if (ExternalClasses.methodMap.containsKey(method)) {
            logger.fine("Found an external class " + method);
            logger.fine("This class is treated in a special way");
            ExternalClasses.receiveCommand(method, callingStmt, args);
        } else {
            logger.fine("Found an external class " + method);
            logger.fine("This class is treated as an internal class");
            JimpleInjector.storeArgumentLevels(callingStmt, args);
        }
    } else {
        throw new InternalAnalyzerException(
                "Unexpected Context for Invoke Expression");
    }
}
项目:petablox    文件:DomExpr.java   
public void visit(Value e) {
    add(e);
    if (e instanceof DynamicInvokeExpr) {
        DynamicInvokeExpr ex = (DynamicInvokeExpr) e;
        for (Value arg : ex.getBootstrapArgs())
            add(arg);
    }
}
项目:petablox    文件:DomZ.java   
@Override
public void visit(InvokeExpr e) {
    int numActuals = 0;
    if (e instanceof InstanceInvokeExpr) {
        numActuals = 1 + e.getArgs().size();
    } else if (e instanceof DynamicInvokeExpr) {
        DynamicInvokeExpr ex = (DynamicInvokeExpr) e;
        int numBootstrapArgs = ex.getBootstrapArgs().size();
        numActuals = Math.max(e.getArgs().size(), numBootstrapArgs);
    } else {
        numActuals = e.getArgs().size();
    }
    if (numActuals > maxArgs)
        grow(numActuals);
}
项目:jgs    文件:SecurityConstraintValueReadSwitch.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    SootClass sootClass = v.getMethod().getDeclaringClass();
    handleStatic(sootClass);
    handleInvoke(v);
    addProgramCounterConstraint(sootClass.getName());
}
项目:FuzzDroid    文件:JimpleExprVisitorImpl.java   
@Override
    public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
//      caseInvokeExpr(v, null);
        throw new RuntimeException("todo");
    }
项目:JAADAS    文件:ValueTemplatePrinter.java   
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    printInvokeExpr(v);     
}
项目:JAADAS    文件:ExprVisitor.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    throw new Error("DynamicInvokeExpr not supported: " + v);
}
项目:JAADAS    文件:UnitThrowAnalysis.java   
public void caseDynamicInvokeExpr(DynamicInvokeExpr expr) {
    //caseInstanceInvokeExpr(expr);
}
项目:bixie    文件:SootValueSwitch.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr arg0) {
    throw new RuntimeException("This must be handeled by SootStmtSwitch!");
}
项目:jar2bpl    文件:SootValueSwitch.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr arg0) {
    throw new RuntimeException("This must be handeled by SootStmtSwitch!");
}
项目:jgs    文件:SecurityConstraintValueWriteSwitch.java   
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    throwInvalidWriteException(v);
}
项目:jgs    文件:SecurityLevelValueWriteSwitch.java   
/**
 * The method should update the <em>security level</em> of an invoke
 * expression with type {@link DynamicInvokeExpr}, but it is not possible to
 * update the level of an invoke expression.
 * 
 * @param v
 *            The invoke expression for which the <em>security level</em>
 *            should be updated.
 * @see soot.jimple.ExprSwitch#caseDynamicInvokeExpr(soot.jimple.DynamicInvokeExpr)
 * @throws InvalidSwitchException
 *             Always, because the update is not possible.
 */
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    throw new SwitchException(getMsg("exception.analysis.switch.update_error",
                                     this.getClass().getSimpleName(),
                                     v.getClass().getSimpleName(),
                                     v.toString(),
                                     getSourceLine()));
}
项目:jgs    文件:AnnotationValueSwitch.java   
/**
 * DOC
 * 
 * @see soot.jimple.ExprSwitch#caseDynamicInvokeExpr(soot.jimple.DynamicInvokeExpr)
 */
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    this.extractor.addMethodEnvironmentForMethod(v.getMethod());
}
项目:jgs    文件:SecurityLevelValueReadSwitch.java   
/**
 * Looks up the <em>security level</em> of the given invoke expression with
 * the type {@link DynamicInvokeExpr} and stores the resulting level in
 * {@link SecurityLevelValueReadSwitch#level}. Also the parameter
 * <em>security level</em> and the <em>write effects</em> will be handled.
 * 
 * @param v
 *            The invoke expression, for which the level should be looked
 *            up.
 * @see soot.jimple.ExprSwitch#caseDynamicInvokeExpr(soot.jimple.DynamicInvokeExpr)
 * @see SecurityLevelValueReadSwitch#handleInvokeExpr(InvokeExpr)
 */
@Override
public void caseDynamicInvokeExpr(DynamicInvokeExpr v) {
    handleInvokeExpr(v);
}