Package cuchaz.enigma.mapping

Examples of cuchaz.enigma.mapping.MethodEntry


  {
    // get all the child nodes
    List<MethodInheritanceTreeNode> nodes = Lists.newArrayList();
    for( String subclassName : index.getTranslationIndex().getSubclassNames( m_entry.getClassName() ) )
    {
      MethodEntry methodEntry = new MethodEntry(
        new ClassEntry( subclassName ),
        m_entry.getName(),
        m_entry.getSignature()
      );
      nodes.add( new MethodInheritanceTreeNode(
View Full Code Here


  @SuppressWarnings( "unchecked" )
  public static <T> T renameMethodsInThing( Map<MethodEntry,MethodEntry> renames, T thing )
  {
    if( thing instanceof MethodEntry )
    {
      MethodEntry methodEntry = (MethodEntry)thing;
      MethodEntry newMethodEntry = renames.get( methodEntry );
      if( newMethodEntry != null )
      {
        return (T)new MethodEntry(
          methodEntry.getClassEntry(),
          newMethodEntry.getName(),
          methodEntry.getSignature()
        );
      }
      return thing;
    }
View Full Code Here

        constructorEntry.getSignature()
      );
    }
    else if( thing instanceof MethodEntry )
    {
      MethodEntry methodEntry = (MethodEntry)thing;
      return (T)new MethodEntry(
        renameClassesInThing( renames, methodEntry.getClassEntry() ),
        methodEntry.getName(),
        methodEntry.getSignature()
      );
    }
    else if( thing instanceof ArgumentEntry )
    {
      ArgumentEntry argumentEntry = (ArgumentEntry)thing;
View Full Code Here

          addReference( reference );
        }
      }
      for( CtMethod method : c.getDeclaredMethods() )
      {
        MethodEntry methodEntry = new MethodEntry( m_classEntry, method.getName(), method.getSignature() );
        for( EntryReference<BehaviorEntry,BehaviorEntry> reference : index.getBehaviorReferences( methodEntry ) )
        {
          addReference( reference );
        }
      }
View Full Code Here

        if( methodMapping.getObfName().equals( "<init>" ) )
        {
          continue;
        }
       
        MethodEntry methodEntry = new MethodEntry(
          classEntry,
          methodMapping.getObfName(),
          methodMapping.getObfSignature()
        );
        if( !destIndex.containsObfBehavior( methodEntry ) )
        {
          System.err.println( "WARNING: method doesn't match: " + methodEntry );
         
          // show the available methods
          System.err.println( "\tAvailable dest methods:" );
          CtClass c = destLoader.loadClass( classMapping.getObfName() );
          for( CtBehavior behavior : c.getDeclaredBehaviors() )
          {
            MethodEntry declaredMethodEntry = new MethodEntry(
              new ClassEntry( classMapping.getObfName() ),
              behavior.getName(),
              behavior.getSignature()
            );
            System.err.println( "\t\t" + declaredMethodEntry );
          }
         
          System.err.println( "\tAvailable source methods:" );
          c = sourceLoader.loadClass( matchedClassNames.inverse().get( classMapping.getObfName() ) );
          for( CtBehavior behavior : c.getDeclaredBehaviors() )
          {
            MethodEntry declaredMethodEntry = new MethodEntry(
              new ClassEntry( classMapping.getObfName() ),
              behavior.getName(),
              behavior.getSignature()
            );
            System.err.println( "\t\t" + declaredMethodEntry );
View Full Code Here

      switch( opcode )
      {
        case Opcode.CHECKCAST:
         
          // get the type of this op code (next two bytes are a classinfo index)
          MethodEntry prevMethodEntry = getMethodEntry( prevPos );
          if( prevMethodEntry != null )
          {
            return new CheckCast(
              m_constants.getClassInfo( m_iter.s16bitAt( pos + 1 ) ),
              prevMethodEntry
View Full Code Here

      case Opcode.INVOKESTATIC:
      case Opcode.INVOKEDYNAMIC:
      case Opcode.INVOKESPECIAL:
      {
        int index = m_iter.s16bitAt( pos + 1 );
        return new MethodEntry(
          new ClassEntry( Descriptor.toJvmName( m_constants.getMethodrefClassName( index ) ) ),
          m_constants.getMethodrefName( index ),
          m_constants.getMethodrefType( index )
        );
      }
     
      case Opcode.INVOKEINTERFACE:
      {
        int index = m_iter.s16bitAt( pos + 1 );
        return new MethodEntry(
          new ClassEntry( Descriptor.toJvmName( m_constants.getInterfaceMethodrefClassName( index ) ) ),
          m_constants.getInterfaceMethodrefName( index ),
          m_constants.getInterfaceMethodrefType( index )
        );
      }
View Full Code Here

     
      // get the behavior entry
      BehaviorEntry behaviorEntry;
      if( behavior instanceof CtMethod )
      {
        behaviorEntry = new MethodEntry( classEntry, behavior.getMethodInfo().getName(), behavior.getSignature() );
      }
      else if( behavior instanceof CtConstructor )
      {
        behaviorEntry = new ConstructorEntry( classEntry, behavior.getSignature() );
      }
View Full Code Here

      if( behavior instanceof CtMethod )
      {
        CtMethod method = (CtMethod)behavior;
       
        // translate the name
        MethodEntry entry = new MethodEntry( classEntry, method.getName(), method.getSignature() );
        String translatedName = m_translator.translate( entry );
        if( translatedName != null )
        {
          method.setName( translatedName );
        }
View Full Code Here

TOP

Related Classes of cuchaz.enigma.mapping.MethodEntry

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.