當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractInsnNode.getType方法代碼示例

本文整理匯總了Java中org.objectweb.asm.tree.AbstractInsnNode.getType方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractInsnNode.getType方法的具體用法?Java AbstractInsnNode.getType怎麽用?Java AbstractInsnNode.getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.objectweb.asm.tree.AbstractInsnNode的用法示例。


在下文中一共展示了AbstractInsnNode.getType方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addDirectExits

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
private static void addDirectExits(InsnList il, BitSet entryPoints, Map<AbstractInsnNode, int[]> exitPoints) {
	int idx = 0; // ignore 0 since it has no preceding instruction

	while ((idx = entryPoints.nextSetBit(idx + 1)) != -1) {
		AbstractInsnNode prev = il.get(idx - 1);
		if (exitPoints.containsKey(prev)) continue;
		int type = prev.getType();

		if (prev.getOpcode() != Opcodes.ATHROW
				&& (prev.getOpcode() < Opcodes.IRETURN || prev.getOpcode() > Opcodes.RETURN)
				&& type != AbstractInsnNode.JUMP_INSN
				&& type != AbstractInsnNode.TABLESWITCH_INSN
				&& type != AbstractInsnNode.LOOKUPSWITCH_INSN) {
			exitPoints.put(prev, new int[] { idx });
		}
	}
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:18,代碼來源:Analysis.java

示例2: findID

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
private static void findID(ClassNode classNode) throws Throwable {
    for (MethodNode methodNode : classNode.methods) {
        Iterator<AbstractInsnNode> insnIterator = methodNode.instructions.iterator();
        while (insnIterator.hasNext()) {
            AbstractInsnNode insnNode = insnIterator.next();
            String str;
            if ((insnNode.getType() == 9)) {
                Object cst = ((LdcInsnNode) insnNode).cst;
                if (cst instanceof String) {
                    str = ((LdcInsnNode) insnNode).cst.toString();
                    Matcher matcher = NONCEID_PATTERN.matcher(str);
                    if (matcher.find()) {
                        possiblenonces.add(str);
                    }
                }
            }
        }
    }
}
 
開發者ID:ItzSomebody,項目名稱:Spigot-Nonce-ID-Finder,代碼行數:20,代碼來源:Finder.java

示例3: populateClassGraph

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
public void populateClassGraph() {
  String className = Type.getObjectType(classNode.name).getClassName();
  logger.debug("Creating graph for class {}" , className);
  for (MethodNode methodNode : classNode.methods) {
    String methodName = methodNode.name;
    MethodGraph caller = new MethodGraph(className, methodName);
    InsnList instructions = methodNode.instructions;
    for (int i = 0; i < instructions.size(); i++) {
      AbstractInsnNode insnNode = instructions.get(i);
      if (insnNode.getType() == AbstractInsnNode.METHOD_INSN) {
        MethodInsnNode methodInsnNode = (MethodInsnNode)insnNode;
        String calledOwner = Type.getObjectType(methodInsnNode.owner).getClassName();
        String calledName = methodInsnNode.name;
        MethodGraph called = new MethodGraph(calledOwner, calledName);
        Call call = new Call(caller, called);
        if (!called.getOwner().equals("java.lang.Object") && !called.getName().equals("<init>")) {
          logger.trace("Adding call graph: {}", call.toString());
          GraphHolder.addCallGraph(call);
        }
      }
    }
  }
}
 
開發者ID:fergarrui,項目名稱:custom-bytecode-analyzer,代碼行數:24,代碼來源:ClassCallGraph.java

示例4: process

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public void process() {
  for (MethodNode methodNode : getClassNode().methods) {
    InsnList instructions = methodNode.instructions;
    for (int i = 0; i < instructions.size(); i++) {
      AbstractInsnNode insnNode = instructions.get(i);
      if (insnNode.getType() == AbstractInsnNode.METHOD_INSN) {
        MethodInsnNode methodInsnNode = (MethodInsnNode)insnNode;
        processMethodInsnNode(methodNode, methodInsnNode);
      }
    }
  }
}
 
開發者ID:fergarrui,項目名稱:custom-bytecode-analyzer,代碼行數:14,代碼來源:CustomMethodInvocationVisitor.java

示例5: populate

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
private void populate(InsnList opcodes) {
	int selected = -1, labelCount = 0;;
	DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
	for (int i = 0; i < opcodes.size(); i++) {
		AbstractInsnNode ain = opcodes.get(i);
		if (ain.getType() == AbstractInsnNode.LABEL) {
			LabelNode label = (LabelNode) ain;
			String s = i + ".";
			if (list != null) {
				s += " : " + list.getLabelName(ain);
			}
			labels.put(s, label);
			model.addElement(s);
			if (label.equals(initial)) {
				selected = labelCount;
			}
			labelCount++;
		}
	}
	combo.setModel(model);
	combo.setSelectedIndex(selected);
	combo.addItemListener(new ItemListener() {
		@Override
		public void itemStateChanged(ItemEvent e) {
			updater.accept(labels.get(e.getItem()));
			if (list != null) {
				list.repaint();
			}
		}
	});
}
 
開發者ID:Col-E,項目名稱:Recaf,代碼行數:32,代碼來源:LabelSwitcherPanel.java

示例6: updateState

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
private void updateState(AbstractInsnNode insn) {
  switch (insn.getType()) {
    case AbstractInsnNode.INSN:
      updateState((InsnNode) insn);
      break;
    case AbstractInsnNode.INT_INSN:
      updateState((IntInsnNode) insn);
      break;
    case AbstractInsnNode.VAR_INSN:
      updateState((VarInsnNode) insn);
      break;
    case AbstractInsnNode.TYPE_INSN:
      updateState((TypeInsnNode) insn);
      break;
    case AbstractInsnNode.FIELD_INSN:
      updateState((FieldInsnNode) insn);
      break;
    case AbstractInsnNode.METHOD_INSN:
      updateState((MethodInsnNode) insn);
      break;
    case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
      updateState((InvokeDynamicInsnNode) insn);
      break;
    case AbstractInsnNode.JUMP_INSN:
      updateState((JumpInsnNode) insn);
      break;
    case AbstractInsnNode.LABEL:
      updateState((LabelNode) insn);
      break;
    case AbstractInsnNode.LDC_INSN:
      updateState((LdcInsnNode) insn);
      break;
    case AbstractInsnNode.IINC_INSN:
      updateState((IincInsnNode) insn);
      break;
    case AbstractInsnNode.TABLESWITCH_INSN:
      updateState((TableSwitchInsnNode) insn);
      break;
    case AbstractInsnNode.LOOKUPSWITCH_INSN:
      updateState((LookupSwitchInsnNode) insn);
      break;
    case AbstractInsnNode.MULTIANEWARRAY_INSN:
      updateState((MultiANewArrayInsnNode) insn);
      break;
    case AbstractInsnNode.LINE:
      updateState((LineNumberNode) insn);
      break;
    default:
      throw new Unreachable("Unexpected instruction " + insn);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:52,代碼來源:JarSourceCode.java

示例7: build

import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
private void build(AbstractInsnNode insn, IRBuilder builder) {
  switch (insn.getType()) {
    case AbstractInsnNode.INSN:
      build((InsnNode) insn, builder);
      break;
    case AbstractInsnNode.INT_INSN:
      build((IntInsnNode) insn, builder);
      break;
    case AbstractInsnNode.VAR_INSN:
      build((VarInsnNode) insn, builder);
      break;
    case AbstractInsnNode.TYPE_INSN:
      build((TypeInsnNode) insn, builder);
      break;
    case AbstractInsnNode.FIELD_INSN:
      build((FieldInsnNode) insn, builder);
      break;
    case AbstractInsnNode.METHOD_INSN:
      build((MethodInsnNode) insn, builder);
      break;
    case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
      build((InvokeDynamicInsnNode) insn, builder);
      break;
    case AbstractInsnNode.JUMP_INSN:
      build((JumpInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LABEL:
      build((LabelNode) insn, builder);
      break;
    case AbstractInsnNode.LDC_INSN:
      build((LdcInsnNode) insn, builder);
      break;
    case AbstractInsnNode.IINC_INSN:
      build((IincInsnNode) insn, builder);
      break;
    case AbstractInsnNode.TABLESWITCH_INSN:
      build((TableSwitchInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LOOKUPSWITCH_INSN:
      build((LookupSwitchInsnNode) insn, builder);
      break;
    case AbstractInsnNode.MULTIANEWARRAY_INSN:
      build((MultiANewArrayInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LINE:
      build((LineNumberNode) insn, builder);
      break;
    default:
      throw new Unreachable("Unexpected instruction " + insn);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:52,代碼來源:JarSourceCode.java


注:本文中的org.objectweb.asm.tree.AbstractInsnNode.getType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。