Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
asm
asm
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • asm
  • asmasm
  • Issues
  • #317887

Closed
Open
Opened Sep 21, 2019 by Jan Brachthäuser@devtastisch

ClassRemapper not remapping super method calls reliably

I am trying to deobfuscate a jar file with the asm ClassRemapper. Everything is working fine for normal outer classes. But when I try to remap a method that is used in a method of an inner class, the references to this method are not remapped. I know that inner classes are not alot more than syntactic sugar and work mostly like normal classes, so I am wondering if the ClassRemapper does not handle inner classes correctly or if I am missing something.

  private Map<String, ClassNode> classes;
  private Map<String, byte[]> bytes;

  private void applyClassMappings() {
    Remapper mapper = SimpleSimpleRemapper.create(this.mappings);
    this.classes.forEach(
        (name, classNode) -> {
          ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);
          ClassVisitor classRemapper = new ClassRemapper(classWriter, mapper);
          classNode.accept(classRemapper);


          this.bytes.put(
              (this.mappings.containsKey(classNode.name)
                      ? this.mappings.get(classNode.name)
                      : classNode.name)
                  + ".class",
              classWriter.toByteArray());
        });
  }

So this code does remap everything correctly in normal outer classes, but ignores any references to anything else in methods of inner classes. It looks like the method bodies are just not translated of inner classes.

Edited Sep 25, 2019 by Jan Brachthäuser
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: asm/asm#317887