Package org.jreversepro.reflect.instruction

Examples of org.jreversepro.reflect.instruction.InstructionList


      throws InstructionListParserException {
    bytecodes = _bytecodes;
    if (bytecodes == null) {
      throw new InstructionListParserException("bytecodes are null");
    }
    InstructionList il = new InstructionList();

    int maxCode = bytecodes.length;
    int currentPc = 0;
    int nextPc = -1;
    int startPc = -1;
    boolean bWide = false;
    while (currentPc < maxCode) {
      int curOpcode = Instruction.signedToUnsigned(bytecodes[currentPc]);
      startPc = currentPc + 1;
      if (curOpcode == Opcodes.OPCODE_TABLESWITCH) {
        startPc = currentPc + 4 - (currentPc % 4);
        nextPc = parseTableSwitchInstruction(startPc);
      } else if (curOpcode == Opcodes.OPCODE_LOOKUPSWITCH) {
        startPc = currentPc + 4 - (currentPc % 4);
        nextPc = parseLookupSwitchInstruction(startPc);
      } else {
        nextPc = currentPc
            + JVMInstructionSet.getOpcodeLength(curOpcode, bWide);
      }
      Instruction ins = new Instruction(currentPc, curOpcode, getArgArray(
          startPc, nextPc), nextPc, bWide);
      il.add(ins);
      bWide = (curOpcode == Opcodes.OPCODE_WIDE);
      currentPc = nextPc;
    }
    return il;
View Full Code Here


    for (Method method : clazz.getMethods()) {
      outputMethodHeader(method);
      openBlock();
      try {
        InstructionList list = InstructionListParserFactory
            .createInstructionListParser().parseBytes(method.getBytes());
        outputInstructionList(list);
      } catch (InstructionListParserException e) {
        logger.warning(e.toString());
      }
View Full Code Here

TOP

Related Classes of org.jreversepro.reflect.instruction.InstructionList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.