Package cuchaz.enigma.bytecode

Examples of cuchaz.enigma.bytecode.ConstPoolEditor


    }
   
    // rename method references
    // translate all the field and method references in the code by editing the constant pool
    ConstPool constants = c.getClassFile().getConstPool();
    ConstPoolEditor editor = new ConstPoolEditor( constants );
    for( int i=1; i<constants.getSize(); i++ )
    {
      switch( constants.getTag( i ) )
      {
        case ConstPool.CONST_Methodref:
        case ConstPool.CONST_InterfaceMethodref:
        {
          BehaviorEntry behaviorEntry = BehaviorEntryFactory.create(
            Descriptor.toJvmName( editor.getMemberrefClassname( i ) ),
            editor.getMemberrefName( i ),
            editor.getMemberrefType( i )
          );
         
          if( behaviorEntry instanceof MethodEntry )
          {
            MethodEntry methodEntry = (MethodEntry)behaviorEntry;
           
            // translate the name and type
            MethodEntry bridgeMethodEntry = m_index.getBridgeMethod( methodEntry );
            if( bridgeMethodEntry != null )
            {
              // FIXIT FIXIT FIXIT FIXIT FIXIT FIXIT FIXIT
              editor.changeMemberrefNameAndType( i, bridgeMethodEntry.getName(), bridgeMethodEntry.getSignature() );
            }
          }
        }
        break;
      }
View Full Code Here


    }
  }
 
  private void updateHashWithConstant( MessageDigest digest, ConstPool constants, int index )
  {
    ConstPoolEditor editor = new ConstPoolEditor( constants );
    ConstInfoAccessor item = editor.getItem( index );
    if( item.getType() == InfoType.StringInfo )
    {
      updateHashWithString( digest, constants.getStringInfo( index ) );
    }
    // TODO: other constants
View Full Code Here

TOP

Related Classes of cuchaz.enigma.bytecode.ConstPoolEditor

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.