当前位置: 首页>>代码示例>>Java>>正文


Java Instruction35c类代码示例

本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.Instruction35c的典型用法代码示例。如果您正苦于以下问题:Java Instruction35c类的具体用法?Java Instruction35c怎么用?Java Instruction35c使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Instruction35c类属于org.jf.dexlib2.iface.instruction.formats包,在下文中一共展示了Instruction35c类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: rewrite

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
@Nonnull
@Override
public Instruction rewrite(@Nonnull Instruction instruction) {
    if (instruction instanceof ReferenceInstruction) {
        switch (instruction.getOpcode().format) {
            case Format20bc:
                return new RewrittenInstruction20bc((Instruction20bc) instruction);
            case Format21c:
                return new RewrittenInstruction21c((Instruction21c) instruction);
            case Format22c:
                return new RewrittenInstruction22c((Instruction22c) instruction);
            case Format31c:
                return new RewrittenInstruction31c((Instruction31c) instruction);
            case Format35c:
                return new RewrittenInstruction35c((Instruction35c) instruction);
            case Format3rc:
                return new RewrittenInstruction3rc((Instruction3rc) instruction);
            default:
                throw new IllegalArgumentException();
        }
    }
    return instruction;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:24,代码来源:InstructionRewriter.java

示例2: analyzeExecuteInline

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
private void analyzeExecuteInline(@Nonnull AnalyzedInstruction analyzedInstruction) {
    if (inlineResolver == null) {
        throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
    }

    Instruction35mi instruction = (Instruction35mi) analyzedInstruction.instruction;
    Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);

    Opcode deodexedOpcode;
    int acccessFlags = resolvedMethod.getAccessFlags();
    if (AccessFlags.STATIC.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_STATIC;
    } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_DIRECT;
    } else {
        deodexedOpcode = Opcode.INVOKE_VIRTUAL;
    }

    Instruction35c deodexedInstruction = new ImmutableInstruction35c(deodexedOpcode, instruction.getRegisterCount(),
            instruction.getRegisterC(), instruction.getRegisterD(), instruction.getRegisterE(),
            instruction.getRegisterF(), instruction.getRegisterG(), resolvedMethod);

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
    analyzeInstruction(analyzedInstruction);
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:26,代码来源:MethodAnalyzer.java

示例3: newBuilderInstruction35c

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
@Nonnull
private BuilderInstruction35c newBuilderInstruction35c(@Nonnull Instruction35c instruction) {
    return new BuilderInstruction35c(
            instruction.getOpcode(),
            instruction.getRegisterCount(),
            instruction.getRegisterC(),
            instruction.getRegisterD(),
            instruction.getRegisterE(),
            instruction.getRegisterF(),
            instruction.getRegisterG(),
            convertReference(instruction.getReference()));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:BuilderMutableMethodImplementation.java

示例4: of

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
public static ImmutableInstruction35c of(Instruction35c instruction) {
    if (instruction instanceof ImmutableInstruction35c) {
        return (ImmutableInstruction35c)instruction;
    }
    return new ImmutableInstruction35c(
            instruction.getOpcode(),
            instruction.getRegisterCount(),
            instruction.getRegisterC(),
            instruction.getRegisterD(),
            instruction.getRegisterE(),
            instruction.getRegisterF(),
            instruction.getRegisterG(),
            instruction.getReference());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:15,代码来源:ImmutableInstruction35c.java

示例5: isRegisterUsed

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
/**
 * Check if register is referenced by this instruction.
 *
 */
private boolean isRegisterUsed(int register) {
    Instruction35c i = (Instruction35c) instruction;
    return register == i.getRegisterD() ||
        register == i.getRegisterE() ||
        register == i.getRegisterF() ||
        register == i.getRegisterG() ||
        register == i.getRegisterC();
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:13,代码来源:FilledNewArrayInstruction.java

示例6: getUsedRegistersNums

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
/**
 * Return the indices used in this instruction.
 *
 * @return a list of register indices
 */
protected List<Integer> getUsedRegistersNums() {
    if (instruction instanceof Instruction35c)
        return getUsedRegistersNums((Instruction35c) instruction);
    else if (instruction instanceof Instruction3rc)
        return getUsedRegistersNums((Instruction3rc) instruction);
    throw new RuntimeException("Instruction is neither a InvokeInstruction nor a InvokeRangeInstruction");
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:13,代码来源:MethodInvocationInstruction.java

示例7: of

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
public static ImmutableInstruction35c of(Instruction35c instruction) {
    if (instruction instanceof ImmutableInstruction35c) {
        return (ImmutableInstruction35c) instruction;
    }
    return new ImmutableInstruction35c(
            instruction.getOpcode(),
            instruction.getRegisterCount(),
            instruction.getRegisterC(),
            instruction.getRegisterD(),
            instruction.getRegisterE(),
            instruction.getRegisterF(),
            instruction.getRegisterG(),
            instruction.getReference());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:15,代码来源:ImmutableInstruction35c.java

示例8: write

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
public void write(@Nonnull Instruction35c instruction) {
    try {
        writer.write(instruction.getOpcode().value);
        writer.write(packNibbles(instruction.getRegisterG(), instruction.getRegisterCount()));
        writer.writeUshort(getReferenceIndex(instruction));
        writer.write(packNibbles(instruction.getRegisterC(), instruction.getRegisterD()));
        writer.write(packNibbles(instruction.getRegisterE(), instruction.getRegisterF()));
    } catch (IOException ex) {
        throw new RuntimeException(ex);
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:12,代码来源:InstructionWriter.java

示例9: analyzeInvokeDirectEmpty

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
private void analyzeInvokeDirectEmpty(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
    Instruction35c instruction = (Instruction35c) analyzedInstruction.instruction;

    Instruction35c deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT,
            instruction.getRegisterCount(), instruction.getRegisterC(), instruction.getRegisterD(),
            instruction.getRegisterE(), instruction.getRegisterF(), instruction.getRegisterG(),
            instruction.getReference());

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);

    if (analyzeResult) {
        analyzeInstruction(analyzedInstruction);
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:15,代码来源:MethodAnalyzer.java

示例10: newBuilderInstruction35c

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
@Nonnull
private BuilderInstruction35c newBuilderInstruction35c(@Nonnull Instruction35c instruction) {
    return new BuilderInstruction35c(
            instruction.getOpcode(),
            instruction.getRegisterCount(),
            instruction.getRegisterC(),
            instruction.getRegisterD(),
            instruction.getRegisterE(),
            instruction.getRegisterF(),
            instruction.getRegisterG(),
            instruction.getReference());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:13,代码来源:MutableMethodImplementation.java

示例11: checkInstruction

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
/**
 * Check if the instruction must be rewritten
 * @param invokeInstr the instruction that contains the method invocation
 * @return the new instruction if exists a redefinition for this invocation,
 * null if the instruction must be removed (like an AD loading),
 * the original parameter if there's nothing to do
 */
private Instruction35c checkInstruction(final Instruction35c invokeInstr) {
    MethodReference mr = (MethodReference) invokeInstr.getReference();
    if (removeAds && isLoadingAd(mr))
        return null;
    if (onlyAdsRemoving)
        return invokeInstr;
    Set<String> permissions = apiToPermissions.get(mr);
    if (permissions == null)
        return invokeInstr;
    assert !permissions.isEmpty();
    out.printf(IOutput.Level.DEBUG, "Method %s.%s uses %s\n", mr.getDefiningClass(), mr.getName(), permissions);
    MethodReference redirection = redirections.get(mr);
    if (redirection != null) {
        out.printf(IOutput.Level.DEBUG, "Applying redirection to %s\n", redirection);
        return new BuilderInstruction35c(Opcode.INVOKE_STATIC,
                                         invokeInstr.getRegisterCount(),
                                         invokeInstr.getRegisterC(),
                                         invokeInstr.getRegisterD(),
                                         invokeInstr.getRegisterE(),
                                         invokeInstr.getRegisterF(),
                                         invokeInstr.getRegisterG(),
                                         redirection);
    }
    if (mr.getReturnType().equals("V") && !noAutoRemoveVoid)
        return null;
    ++nNotRedirected;
    out.printf(IOutput.Level.ERROR,
               "Method %s.%s uses %s, but I don't have a redirection for it\n",
               mr.getDefiningClass(),
               mr.getName(),
               permissions);
    return invokeInstr;
}
 
开发者ID:packmad,项目名称:RmPerm,代码行数:41,代码来源:BytecodeCustomizer.java

示例12: isUsedAsFloatingPoint

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
@Override
boolean isUsedAsFloatingPoint(DexBody body, int register) {
    Instruction35c i = (Instruction35c) instruction;
    Type arrayType = DexType.toSoot((TypeReference) i.getReference());
    return isRegisterUsed(register) && isFloatLike(arrayType);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:7,代码来源:FilledNewArrayInstruction.java

示例13: replaceMethodInvocations

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
private MethodImplementation replaceMethodInvocations(MethodImplementation implementation,
		final Method from, final Method to) throws PatchException {

	final boolean fromIsDirect = MethodUtil.isDirect(from);
	final Opcode toInvoke = getInvokeOpcode(to.getAccessFlags(), false);
	final Opcode toInvokeRange = getInvokeOpcode(to.getAccessFlags(), true);

	DexRewriter rewriter = new DexRewriter(new RewriterModule() {
		@Override
		public Rewriter<Instruction> getInstructionRewriter(Rewriters rewriters) {
			return new InstructionRewriter(rewriters) {

				@Override
				public Instruction rewrite(Instruction instruction) {
					if (!(instruction instanceof ReferenceInstruction)) return instruction;
					Reference reference = ((ReferenceInstruction) instruction).getReference();
					if (!from.equals(reference)) return instruction;
					boolean invokeIsDirect;
					switch (instruction.getOpcode()) {
						case INVOKE_DIRECT:
						case INVOKE_DIRECT_RANGE:
						case INVOKE_STATIC:
						case INVOKE_STATIC_RANGE:
							invokeIsDirect = true;
							break;
						case INVOKE_VIRTUAL:
						case INVOKE_VIRTUAL_RANGE:
							invokeIsDirect = false;
							break;
						case INVOKE_SUPER:
						case INVOKE_SUPER_RANGE:
						case INVOKE_INTERFACE:
						case INVOKE_INTERFACE_RANGE:
							invokeIsDirect = false;
							if (fromIsDirect == invokeIsDirect) {
								log(ERROR, "unsupported invocation type (" + instruction.getOpcode() + ")");
								return instruction;
							}
							break;
						default:
							return instruction;
					}
					if (fromIsDirect != invokeIsDirect) {
						log(ERROR, "unexpected invocation type (" + instruction.getOpcode() + ")");
						return instruction;
					}
					if (instruction instanceof Instruction35c) {
						return new RewrittenInstruction35c((Instruction35c) instruction) {
							@Override public Opcode getOpcode() { return toInvoke; }
							@Override public Reference getReference() { return to; }
						};
					} else if (instruction instanceof Instruction3rc) {
						return new RewrittenInstruction3rc((Instruction3rc) instruction) {
							@Override public Opcode getOpcode() { return toInvokeRange; }
							@Override public Reference getReference() { return to; }
						};
					} else {
						log(ERROR, "unexpected invocation instruction type (" +
								instruction.getClass().getSimpleName() + ": " + instruction.getOpcode() + ")");
						return instruction;
					}
				}

			};
		}
	});

	return rewriter.getMethodImplementationRewriter().rewrite(implementation);

}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:71,代码来源:MethodSetPatcher.java

示例14: RewrittenInstruction35c

import org.jf.dexlib2.iface.instruction.formats.Instruction35c; //导入依赖的package包/类
public RewrittenInstruction35c(@Nonnull Instruction35c instruction) {
    super(instruction);
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:4,代码来源:InstructionRewriter.java


注:本文中的org.jf.dexlib2.iface.instruction.formats.Instruction35c类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。