Search in sources :

Example 96 with InsnNode

use of jadx.core.dex.nodes.InsnNode in project jadx by skylot.

the class InsnDecoder method cast.

private InsnNode cast(DecodedInstruction insn, ArgType from, ArgType to) {
    InsnNode inode = new IndexInsnNode(InsnType.CAST, to, 1);
    inode.setResult(InsnArg.reg(insn, 0, to));
    inode.addArg(InsnArg.reg(insn, 1, from));
    return inode;
}
Also used : InsnNode(jadx.core.dex.nodes.InsnNode)

Example 97 with InsnNode

use of jadx.core.dex.nodes.InsnNode in project jadx by skylot.

the class InsnDecoder method neg.

private InsnNode neg(DecodedInstruction insn, ArgType type) {
    InsnNode inode = new InsnNode(InsnType.NEG, 1);
    inode.setResult(InsnArg.reg(insn, 0, type));
    inode.addArg(InsnArg.reg(insn, 1, type));
    return inode;
}
Also used : InsnNode(jadx.core.dex.nodes.InsnNode)

Example 98 with InsnNode

use of jadx.core.dex.nodes.InsnNode in project jadx by skylot.

the class InsnDecoder method insn.

private InsnNode insn(InsnType type, RegisterArg res) {
    InsnNode node = new InsnNode(type, 0);
    node.setResult(res);
    return node;
}
Also used : InsnNode(jadx.core.dex.nodes.InsnNode)

Example 99 with InsnNode

use of jadx.core.dex.nodes.InsnNode in project jadx by skylot.

the class InsnDecoder method arrayGet.

private InsnNode arrayGet(DecodedInstruction insn, ArgType argType) {
    InsnNode inode = new InsnNode(InsnType.AGET, 2);
    inode.setResult(InsnArg.reg(insn, 0, argType));
    inode.addArg(InsnArg.reg(insn, 1, ArgType.unknown(PrimitiveType.ARRAY)));
    inode.addArg(InsnArg.reg(insn, 2, ArgType.INT));
    return inode;
}
Also used : InsnNode(jadx.core.dex.nodes.InsnNode)

Example 100 with InsnNode

use of jadx.core.dex.nodes.InsnNode in project jadx by skylot.

the class InsnDecoder method filledNewArray.

private InsnNode filledNewArray(DecodedInstruction insn, int offset, boolean isRange) {
    int resReg = getMoveResultRegister(insnArr, offset);
    ArgType arrType = dex.getType(insn.getIndex());
    ArgType elType = arrType.getArrayElement();
    boolean typeImmutable = elType.isPrimitive();
    int regsCount = insn.getRegisterCount();
    InsnArg[] regs = new InsnArg[regsCount];
    if (isRange) {
        int r = insn.getA();
        for (int i = 0; i < regsCount; i++) {
            regs[i] = InsnArg.reg(r, elType, typeImmutable);
            r++;
        }
    } else {
        for (int i = 0; i < regsCount; i++) {
            int regNum = InsnUtils.getArg(insn, i);
            regs[i] = InsnArg.reg(regNum, elType, typeImmutable);
        }
    }
    InsnNode node = new FilledNewArrayNode(elType, regs.length);
    node.setResult(resReg == -1 ? null : InsnArg.reg(resReg, arrType));
    for (InsnArg arg : regs) {
        node.addArg(arg);
    }
    return node;
}
Also used : ArgType(jadx.core.dex.instructions.args.ArgType) InsnNode(jadx.core.dex.nodes.InsnNode) InsnArg(jadx.core.dex.instructions.args.InsnArg)

Aggregations

InsnNode (jadx.core.dex.nodes.InsnNode)123 BlockNode (jadx.core.dex.nodes.BlockNode)41 RegisterArg (jadx.core.dex.instructions.args.RegisterArg)39 IndexInsnNode (jadx.core.dex.instructions.IndexInsnNode)35 InsnArg (jadx.core.dex.instructions.args.InsnArg)32 InsnWrapArg (jadx.core.dex.instructions.args.InsnWrapArg)19 SSAVar (jadx.core.dex.instructions.args.SSAVar)16 ArrayList (java.util.ArrayList)14 ArgType (jadx.core.dex.instructions.args.ArgType)11 PhiInsn (jadx.core.dex.instructions.PhiInsn)10 FieldNode (jadx.core.dex.nodes.FieldNode)10 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)8 LiteralArg (jadx.core.dex.instructions.args.LiteralArg)7 ClassNode (jadx.core.dex.nodes.ClassNode)7 MethodNode (jadx.core.dex.nodes.MethodNode)7 FieldInfo (jadx.core.dex.info.FieldInfo)6 ArithNode (jadx.core.dex.instructions.ArithNode)6 ConstructorInsn (jadx.core.dex.instructions.mods.ConstructorInsn)6 InsnType (jadx.core.dex.instructions.InsnType)5 IContainer (jadx.core.dex.nodes.IContainer)5