@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), convertReference(instruction.getReference())); }
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; Instruction deodexedInstruction; int startRegister = instruction.getStartRegister(); // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear // to generate invoke-object-init/range instructions with an invalid register count. We know it should // always be 1, so just use that. int registerCount = 1; if (startRegister < 16) { deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT, registerCount, startRegister, 0, 0, 0, 0, instruction.getReference()); } else { deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE, startRegister, registerCount, instruction.getReference()); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); if (analyzeResult) { analyzeInstruction(analyzedInstruction); } }
@Override boolean isUsedAsFloatingPoint(DexBody body, int register) { Instruction3rc i = (Instruction3rc) instruction; Type arrayType = DexType.toSoot((TypeReference) i.getReference()); int startRegister = i.getStartRegister(); int endRegister = startRegister + i.getRegisterCount(); return register >= startRegister && register <= endRegister && isFloatLike(arrayType); }
private boolean analyzeInvokeVirtual(@Nonnull AnalyzedInstruction analyzedInstruction, boolean isRange) { MethodReference targetMethod; if (!normalizeVirtualMethods) { return true; } if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } MethodReference replacementMethod = normalizeMethodReference(targetMethod); if (replacementMethod == null || replacementMethod.equals(targetMethod)) { return true; } Instruction deodexedInstruction; if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction3rc(instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), replacementMethod); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction35c(instruction.getOpcode(), instruction.getRegisterCount(), instruction.getRegisterC(), instruction.getRegisterD(), instruction.getRegisterE(), instruction.getRegisterF(), instruction.getRegisterG(), replacementMethod); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); return true; }
Type t = DexType.toSoot((TypeReference) filledNewArrayInstr.getReference());
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; Instruction deodexedInstruction; int startRegister = instruction.getStartRegister(); // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear // to generate invoke-object-init/range instructions with an invalid register count. We know it should // always be 1, so just use that. int registerCount = 1; if (startRegister < 16) { deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT, registerCount, startRegister, 0, 0, 0, 0, instruction.getReference()); } else { deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE, startRegister, registerCount, instruction.getReference()); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); if (analyzeResult) { analyzeInstruction(analyzedInstruction); } }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), convertReference(instruction.getReference())); }
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; Instruction deodexedInstruction; int startRegister = instruction.getStartRegister(); // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear // to generate invoke-object-init/range instructions with an invalid register count. We know it should // always be 1, so just use that. int registerCount = 1; if (startRegister < 16) { deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT, registerCount, startRegister, 0, 0, 0, 0, instruction.getReference()); } else { deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE, startRegister, registerCount, instruction.getReference()); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); if (analyzeResult) { analyzeInstruction(analyzedInstruction); } }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
private boolean analyzeInvokeVirtual(@Nonnull AnalyzedInstruction analyzedInstruction, boolean isRange) { MethodReference targetMethod; if (!normalizeVirtualMethods) { return true; } if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } MethodReference replacementMethod = normalizeMethodReference(targetMethod); if (replacementMethod == null || replacementMethod.equals(targetMethod)) { return true; } Instruction deodexedInstruction; if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction3rc(instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), replacementMethod); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction35c(instruction.getOpcode(), instruction.getRegisterCount(), instruction.getRegisterC(), instruction.getRegisterD(), instruction.getRegisterE(), instruction.getRegisterF(), instruction.getRegisterG(), replacementMethod); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); return true; }
args[i] = ((Instruction3rc)inst).getStartRegister() + i; String cname = ((org.jf.dexlib2.iface.reference.TypeReference)((Instruction3rc)inst).getReference()).getType(); if (cname.endsWith(";")) cname = cname.substring(0,cname.length()-1); args[i] = ((Instruction3rc)inst).getStartRegister() + i; String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference());
args[i] = ((Instruction3rc)inst).getStartRegister() + i; String cname = ((org.jf.dexlib2.iface.reference.TypeReference)((Instruction3rc)inst).getReference()).getType(); if (cname.endsWith(";")) cname = cname.substring(0,cname.length()-1); args[i] = ((Instruction3rc)inst).getStartRegister() + i; String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()); String cname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getDefiningClass(); String mname = ((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference()).getName(); String pname = DexUtil.getSignature((org.jf.dexlib2.iface.reference.MethodReference)((Instruction3rc)inst).getReference());