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


Java ArrayPayload.getArrayElements方法代码示例

本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.ArrayPayload.getArrayElements方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayPayload.getArrayElements方法的具体用法?Java ArrayPayload.getArrayElements怎么用?Java ArrayPayload.getArrayElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jf.dexlib2.iface.instruction.formats.ArrayPayload的用法示例。


在下文中一共展示了ArrayPayload.getArrayElements方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: of

import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入方法依赖的package包/类
@Nonnull
public static ImmutableArrayPayload of(ArrayPayload instruction) {
    if (instruction instanceof ImmutableArrayPayload) {
        return (ImmutableArrayPayload)instruction;
    }
    return new ImmutableArrayPayload(
            instruction.getElementWidth(),
            instruction.getArrayElements());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:ImmutableArrayPayload.java

示例2: of

import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入方法依赖的package包/类
public static ImmutableArrayPayload of(ArrayPayload instruction) {
    if (instruction instanceof ImmutableArrayPayload) {
        return (ImmutableArrayPayload)instruction;
    }
    return new ImmutableArrayPayload(
            instruction.getElementWidth(),
            instruction.getArrayElements());
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:9,代码来源:ImmutableArrayPayload.java

示例3: of

import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入方法依赖的package包/类
@Nonnull
public static ImmutableArrayPayload of(ArrayPayload instruction) {
    if (instruction instanceof ImmutableArrayPayload) {
        return (ImmutableArrayPayload) instruction;
    }
    return new ImmutableArrayPayload(
            instruction.getElementWidth(),
            instruction.getArrayElements());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:10,代码来源:ImmutableArrayPayload.java

示例4: newBuilderArrayPayload

import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入方法依赖的package包/类
@Nonnull
private BuilderArrayPayload newBuilderArrayPayload(@Nonnull ArrayPayload instruction) {
    return new BuilderArrayPayload(instruction.getElementWidth(), instruction.getArrayElements());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:BuilderMutableMethodImplementation.java

示例5: jimplify

import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入方法依赖的package包/类
public void jimplify (DexBody body) {
  if(!(instruction instanceof Instruction31t))
    throw new IllegalArgumentException("Expected Instruction31t but got: "+instruction.getClass());

  Instruction31t fillArrayInstr = (Instruction31t)instruction;
  int destRegister = fillArrayInstr.getRegisterA();
  int offset = fillArrayInstr.getCodeOffset();
  int targetAddress = codeAddress + offset;

  Instruction referenceTable = body.instructionAtAddress(targetAddress).instruction;

  if(!(referenceTable instanceof ArrayPayload)) {
    throw new RuntimeException("Address " + targetAddress + "refers to an invalid PseudoInstruction.");
  }

  ArrayPayload arrayTable = (ArrayPayload)referenceTable;

  //        NopStmt nopStmtBeginning = Jimple.v().newNopStmt();
  //        body.add(nopStmtBeginning);

  Local arrayReference = body.getRegisterLocal(destRegister);
  List<Number> elements = arrayTable.getArrayElements();
  int numElements = elements.size();

  Stmt firstAssign = null;
  for (int i = 0; i < numElements; i++) {
    ArrayRef arrayRef = Jimple.v().newArrayRef(arrayReference, IntConstant.v(i));
    NumericConstant element = getArrayElement(elements.get(i),body,destRegister);
    if (element == null) //array was not defined -> element type can not be found (obfuscated bytecode?)
      break;
    AssignStmt assign = Jimple.v().newAssignStmt(arrayRef, element);
    addTags(assign);
    body.add(assign);
    if (i == 0) {
      firstAssign = assign;
    }
  }
  if (firstAssign == null) { // if numElements == 0. Is it possible?
      firstAssign = Jimple.v().newNopStmt();
      body.add (firstAssign);
  }

  //        NopStmt nopStmtEnd = Jimple.v().newNopStmt();
  //        body.add(nopStmtEnd);

  //        defineBlock(nopStmtBeginning, nopStmtEnd);
  setUnit (firstAssign);

}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:50,代码来源:FillArrayDataInstruction.java


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