本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.ArrayPayload类的典型用法代码示例。如果您正苦于以下问题:Java ArrayPayload类的具体用法?Java ArrayPayload怎么用?Java ArrayPayload使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArrayPayload类属于org.jf.dexlib2.iface.instruction.formats包,在下文中一共展示了ArrayPayload类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeInstructionFormatMethodItem
import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入依赖的package包/类
public static InstructionMethodItem makeInstructionFormatMethodItem(
MethodDefinition methodDef, int codeAddress, Instruction instruction) {
if (instruction instanceof OffsetInstruction) {
return new OffsetInstructionFormatMethodItem(methodDef.classDef.options, methodDef, codeAddress,
(OffsetInstruction)instruction);
}
if (instruction instanceof UnresolvedOdexInstruction) {
return new UnresolvedOdexInstructionMethodItem(methodDef, codeAddress,
(UnresolvedOdexInstruction)instruction);
}
switch (instruction.getOpcode().format) {
case ArrayPayload:
return new ArrayDataMethodItem(methodDef, codeAddress, (ArrayPayload)instruction);
case PackedSwitchPayload:
return new PackedSwitchMethodItem(methodDef, codeAddress, (PackedSwitchPayload)instruction);
case SparseSwitchPayload:
return new SparseSwitchMethodItem(methodDef, codeAddress, (SparseSwitchPayload)instruction);
default:
return new InstructionMethodItem<Instruction>(methodDef, codeAddress, instruction);
}
}
示例2: 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());
}
示例3: 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());
}
示例4: 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());
}
示例5: newBuilderArrayPayload
import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入依赖的package包/类
@Nonnull
private BuilderArrayPayload newBuilderArrayPayload(@Nonnull ArrayPayload instruction) {
return new BuilderArrayPayload(instruction.getElementWidth(), instruction.getArrayElements());
}
示例6: ArrayDataMethodItem
import org.jf.dexlib2.iface.instruction.formats.ArrayPayload; //导入依赖的package包/类
public ArrayDataMethodItem(MethodDefinition methodDef, int codeAddress, ArrayPayload instruction) {
super(methodDef, codeAddress, instruction);
}
示例7: 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);
}