Package jadx.core.dex.instructions.args

Examples of jadx.core.dex.instructions.args.InsnArg


    }
    return null;
  }

  public static InsnNode searchInsnParent(MethodNode mth, InsnNode insn) {
    InsnArg insnArg = searchWrappedInsnParent(mth, insn);
    if (insnArg == null) {
      return null;
    }
    return insnArg.getParentInsn();
  }
View Full Code Here


    if (!insn.contains(AFlag.WRAPPED)) {
      return null;
    }
    for (BlockNode bn : mth.getBasicBlocks()) {
      for (InsnNode bi : bn.getInstructions()) {
        InsnArg res = foundWrappedInsn(bi, insn);
        if (res != null) {
          return res;
        }
      }
    }
View Full Code Here

      if (arg.isInsnWrap()) {
        InsnNode wrapInsn = ((InsnWrapArg) arg).getWrapInsn();
        if (wrapInsn == insn) {
          return arg;
        }
        InsnArg res = foundWrappedInsn(wrapInsn, insn);
        if (res != null) {
          return res;
        }
      }
    }
View Full Code Here

    if (cond.isCompare()) {
      IfNode cmpInsn = cond.getCompare().getInsn();
      return foundWrappedInsn(cmpInsn, insn);
    }
    for (IfCondition nestedCond : cond.getArgs()) {
      InsnArg res = foundWrappedInsnInCondition(nestedCond, insn);
      if (res != null) {
        return res;
      }
    }
    return null;
View Full Code Here

    InvokeType type = insn.getInvokeType();
    switch (type) {
      case DIRECT:
      case VIRTUAL:
      case INTERFACE:
        InsnArg arg = insn.getArg(0);
        // FIXME: add 'this' for equals methods in scope
        if (!arg.isThis()) {
          addArgDot(code, arg);
        }
        k++;
        break;
View Full Code Here

    int argsCount = insn.getArgsCount();
    code.add('(');
    if (k < argsCount) {
      boolean overloaded = callMth != null && callMth.isArgsOverload();
      for (int i = k; i < argsCount; i++) {
        InsnArg arg = insn.getArg(i);
        boolean cast = overloaded && processOverloadedArg(code, callMth, arg, i - startArgNum);
        if (!cast && i == argsCount - 1 && processVarArg(code, callMth, arg)) {
          continue;
        }
        addArg(code, arg, false);
View Full Code Here

    }
    InsnNode insn = ((InsnWrapArg) lastArg).getWrapInsn();
    if (insn.getType() == InsnType.FILLED_NEW_ARRAY) {
      int count = insn.getArgsCount();
      for (int i = 0; i < count; i++) {
        InsnArg elemArg = insn.getArg(i);
        addArg(code, elemArg, false);
        if (i < count - 1) {
          code.add(", ");
        }
      }
View Full Code Here

    } else {
      // remap args
      InsnArg[] regs = new InsnArg[callMthNode.getRegsCount()];
      List<RegisterArg> callArgs = callMthNode.getArguments(true);
      for (int i = 0; i < callArgs.size(); i++) {
        InsnArg arg = insn.getArg(i);
        RegisterArg callArg = callArgs.get(i);
        regs[callArg.getRegNum()] = arg;
      }
      // replace args
      List<RegisterArg> inlArgs = new ArrayList<RegisterArg>();
      inl.getRegisterArgs(inlArgs);
      Map<RegisterArg, InsnArg> toRevert = new HashMap<RegisterArg, InsnArg>();
      for (RegisterArg r : inlArgs) {
        int regNum = r.getRegNum();
        if (regNum >= regs.length) {
          LOG.warn("Unknown register number {} in method call: {} from {}", r, callMthNode, mth);
        } else {
          InsnArg repl = regs[regNum];
          if (repl == null) {
            LOG.warn("Not passed register {} in method call: {} from {}", r, callMthNode, mth);
          } else {
            inl.replaceArg(r, repl);
            toRevert.put(r, repl);
View Full Code Here

  private void makeTernary(TernaryInsn insn, CodeWriter code, Set<Flags> state) throws CodegenException {
    boolean wrap = state.contains(Flags.BODY_ONLY);
    if (wrap) {
      code.add('(');
    }
    InsnArg first = insn.getArg(0);
    InsnArg second = insn.getArg(1);
    ConditionGen condGen = new ConditionGen(this);
    if (first.equals(LiteralArg.TRUE) && second.equals(LiteralArg.FALSE)) {
      condGen.add(code, insn.getCondition());
    } else {
      condGen.wrap(code, insn.getCondition());
      code.add(" ? ");
      addArg(code, first, false);
View Full Code Here

    }
  }

  private void makeArithOneArg(ArithNode insn, CodeWriter code) throws CodegenException {
    ArithOp op = insn.getOp();
    InsnArg arg = insn.getArg(1);
    // "++" or "--"
    if (arg.isLiteral() && (op == ArithOp.ADD || op == ArithOp.SUB)) {
      LiteralArg lit = (LiteralArg) arg;
      if (lit.isInteger() && lit.getLiteral() == 1) {
        assignVar(code, insn);
        String opSymbol = op.getSymbol();
        code.add(opSymbol).add(opSymbol);
View Full Code Here

TOP

Related Classes of jadx.core.dex.instructions.args.InsnArg

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.