IntelliJ plugin that provides a modern and powerful byte code analyzer tool window.

Overview

IntelliJ Byte Code Analyzer Plugin

Plugin Logo

This IntelliJ plugin provides a modern and powerful byte code analyzer tool window. Its supports Java, Kotlin, Groovy and other JVM language class files.

It's available on the official IntelliJ plugin marketplace.

The tool window is available via View | Tool Windows | Byte Code and will be shown by default in the lower right corner of IntelliJ.

Class files can be either opened directly from the tool window or from the "Analyze Byte Code" action. This action is available in the project view and in the editor for JVM class or source files:

Open Files From Editor

If the action is executed from the editor, the class relative to the current cursor position will be selected. This makes it easy to analyse inner, locale or anonymous classes.

The plugin currently uses ASM 9.1 under the hood, which supports JVM class files up to version 16.

Features

Structure View

The heart of the tool window is the structure view of a class file. It gives a quick and detailed tree overview of the individual components of a class file:

Structure View

In addition to listing the method instructions, the state of the method frames can be viewed after each instruction:

Method Frames View

Constant Pool View

This view provides insights into the constant pool entries of the class file:

Constant Pool View

Plain View

The plain view provides a textified representation of the byte code:

Plain View

ASM View

The ASM view provides Java source code that contains all instructions to generate the class via the ASM library:

ASM View

Byte Code Tools

Some generic byte code tools are provided via the menu in the upper right corner of the tool window. These are providing a general way to better understand certain aspects of the byte code specification.

Access Converter

The access values are stored in a compressed single number in the byte code. With the help of the access converter tool, this number can be broken down into readable single values, and a compressed one can be calculated:

Access Converter

Signature Parser

With the help of the signature parser a signature string can be broken down into its components:

Signature Parser

Other

Additionally, there is an action to verify the byte code of a class file:

Verify Byte Code Action

Development

In general all packages starting with an underscore _ are seen as internal. The code in those packages is not intended to be used by other plugins and do not necessarily adhere to the semantics version rules.

If you want to contribute something, please follow the code style in the .editorconfig and sign your commits.

Update ASM / add new Java version

To update the bundled ASM, set the new version in the main build.gradle.kts. The new bundled ASM library should automatically be created, or execute the Gradle task shadowAsmJar. The ASM API version is defined globally in the variable: dev.turingcomplete.intellijbytecodeplugin._ui.DefaultClassFileContext.ASM_API. Also, the new version must be set in the description block of the plugin.xml and in the README.md.

New Java versions must be added to the field dev.turingcomplete.intellijbytecodeplugin.bytecode.ClassVersionUtils.CLASS_VERSIONS.

Extension Points

Open Class Files Action

Open class files actions (e.g., the "open from disk" action) offer a way to read class files and open are new tab in the tool window.

  • Extension name: dev.turingcomplete.intellijbytecodeplugin.openClassFilesAction
  • Interface: dev.turingcomplete.intellijbytecodeplugin.openclassfiles.OpenClassFilesToolWindowAction

To open a class file in the byte code analyzer tool window one of the methods in the service project.getService(ByteCodeToolService::class.java) can be called.

Byte Code Tool

The byte code tools do not directly refer to an opened class file (use a byte code action for that).

  • Extension name: dev.turingcomplete.intellijbytecodeplugin.byteCodeTool
  • Interface: dev.turingcomplete.intellijbytecodeplugin.tool.ByteCodeTool

Byte Code View

Byte code views (e.g., the structure view) display a representation of the byte code.

  • Extension name: dev.turingcomplete.intellijbytecodeplugin.byteCodeViewCreator
  • Interface: dev.turingcomplete.intellijbytecodeplugin.view.ByteCodeView$Creator

Byte Code Action

Byte code actions (e.g., the decompile action) will be added to each byte code view toolbar. They are working with the currently opened class file.

  • Extension name: dev.turingcomplete.intellijbytecodeplugin.byteCodeAction
  • Interface: dev.turingcomplete.intellijbytecodeplugin.view.ByteCodeAction

Tests

There are some tests that are testing the parsing of the structure tree and the constant pool and the opening of files with all class files from the java base module and from the groovy-all kotlin-stdlib libraries. Since this involves tens of thousands of files, these tests take a lot of time. Therefore, execution in dev.turingcomplete.intellijbytecodeplugin.ClassFileConsumerTestCase.LIMIT_CLASSES is limited to 800 class per library. When a new version is to be released it is advisable that this value should be increased significantly for a test run.

Planned Features

  • Detailed byte code instructions overview.
  • Make texts translatable.

License

Copyright (c) 2021 Marcel Kliemannel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.

Comments
  • IJ 2021.3 EAP compatibility: NoSuchMethodError with ToolWindow.getEmptyText()

    IJ 2021.3 EAP compatibility: NoSuchMethodError with ToolWindow.getEmptyText()

    Hi, I know that EAP are unfinished products, but I though I should report this error.

    java.lang.NoSuchMethodError: 'com.intellij.util.ui.StatusText com.intellij.openapi.wm.ToolWindow.getEmptyText()'
    	at dev.turingcomplete.intellijbytecodeplugin._ui.ByteCodeToolWindowFactory.setupEmptyText$lambda-5(ByteCodeToolWindowFactory.kt:102)
    	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
    	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
    	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
    	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
    	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
    	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
    	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
    	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
    	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    
    bug 
    opened by bric3 1
  • Stackoverflow when trying to analyze Kotlin Code

    Stackoverflow when trying to analyze Kotlin Code

    Here is a truncated version of the stack trace:

    java.lang.StackOverflowError
    	at com.intellij.util.messages.impl.MessageBusImpl.deliverImmediately(MessageBusImpl.java:556)
    	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverImmediately(MessageBusConnectionImpl.java:60)
    	at com.intellij.psi.impl.file.impl.FileManagerImpl.dispatchPendingEvents(FileManagerImpl.java:306)
    	at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:355)
    	at com.intellij.psi.impl.PsiManagerImpl.findFile(PsiManagerImpl.java:154)
    	at dev.turingcomplete.intellijbytecodeplugin.openclassfiles._internal.OpenClassFilesTask.consumeFiles(OpenClassFilesTask.kt:102)
    	at dev.turingcomplete.intellijbytecodeplugin.openclassfiles._internal.OpenClassFilesTask.consumePsiFiles(OpenClassFilesTask.kt:143)
    	at dev.turingcomplete.intellijbytecodeplugin.openclassfiles._internal.OpenClassFilesTask.consumeFiles(OpenClassFilesTask.kt:113)
    	at dev.turingcomplete.intellijbytecodeplugin.openclassfiles._internal.OpenClassFilesTask.consumePsiFiles(OpenClassFilesTask.kt:143)
    	at dev.turingcomplete.intellijbytecodeplugin.openclassfiles._internal.OpenClassFilesTask.consumeFiles(OpenClassFilesTask.kt:113)
    

    To reproduce, just create a New project in Intellij Idea, and create a new Kotlin source file.

    
    package com.example
    
    class Sample {
    }
    

    Right click the editor and select Analyze Byte Code and see this StackOverflowError. Note: I did not create a Gradle Project. I created an IML project. This problem went away once I build the module using the Build menu.

    P.S: It works incredibly well with Java files, and thanks for making this available.

    bug 
    opened by tikurahul 1
  • "Analyze Byte Code" does not show tool window

    If the action "Analyze Byte Code" is performed from the editor and the tool window is closed, a new tab is created but the tool window stays hidden.

    bug 
    opened by marcelkliemannel 1
  • Improvements

    Improvements

    Changed

    • Move method frames to a non-modal dialog
    • Move byte code actions to the left to keep them at a fixed position
    • Move byte code related links to a separate group
    • Add report issue link

    Fixed

    • Fix TooManyListenersException (GitHub issue #12)
    • Fix removed ToolWindow#getEmptyText() in 2021.3 (GitHub issue #13)
    opened by marcelkliemannel 0
  • TooManyListenersException

    TooManyListenersException

    I have now received the following error twice. The last time it occurred was when I opened a new project in a new window while one was already open.

    java.util.TooManyListenersException
    	at java.desktop/java.awt.dnd.DropTarget.addDropTargetListener(DropTarget.java:317)
    	at dev.turingcomplete.intellijbytecodeplugin._ui.ByteCodeToolWindowFactory.initDropTarget$lambda-1(ByteCodeToolWindowFactory.kt:92)
    	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
    	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
    	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:350)
    	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
    	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
    	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
    	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:886)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:755)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:442)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:441)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:487)
    	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    
    bug 
    opened by marcelkliemannel 0
Releases(v2.5.0)
Owner
Marcel Kliemannel
I test in prod.
Marcel Kliemannel
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
Kirill Rakhman 4 Sep 15, 2022
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Marcel Kliemannel 6 Jul 29, 2022
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.

IntelliJ Protobuf Language Plugin Reference Inspired by protobuf-jetbrains-plugin and intellij-protobuf-editor. Descriptor IntelliJ-based IDEs Protobu

Kanro 72 Dec 7, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
Intellij Idea Plugin that can convert HTML to Compose for Web code.

HtmlToComposeWebConverter Intellij Idea Plugin that can convert HTML to Compose for Web code. Turn this: Into this: Show some ❤️ and star the repo to

Jens Klingenberg 90 Oct 10, 2022
An IntelliJ IDEA plugin is used to inspire you to write code.

InspireWritingPlugin An IntelliJ IDEA plugin is used to inspire you to write code. Whenever you write code that exceeds the specified character, the p

Airsaid 6 Feb 11, 2021
A plugin for Jetbrains IDE, Your code is powerful, unleash it like playing osu!

Osu! Mode A plugin for Jetbrains IDE, Your code is powerful, unleash it like playing osu! Demo 2021-10-15.18-50-30.mp4 Bilibili Feature open project /

Nthily 8 Sep 8, 2022
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Philippe Breault 2k Dec 28, 2022
An IntelliJ plugin for x86 and x86_64 AT&T assembly (for GNU as)

asms An IntelliJ plugin for x86 and x86_64 AT&T assembly (for GNU as). Motivation Contrary to popular belief, assembly is still taught in universities

Dinu Blanovschi 1 Jun 26, 2022
IntelliJ platform plugin that shows errors, warnings, and other inspection highlights inline.

IntelliJ plugin that shows errors, warnings, and other inspection highlights inline. Simply install the plugin and inspection descriptions will appear

null 13 Dec 19, 2022
IntelliJ / Android Studio plugin for Android Holo Colors

This project is not maintained anymore. Holo Colors doesn't make sense since the introduction of Material Design and the ability to set the primary co

Jérôme Van Der Linden 644 Nov 10, 2022
Android Studio & IntelliJ Plugin for sort xml by name="xxx".

AndroidXmlSorter Android Studio & IntelliJ Plugin for sort xml by name="xxx". Options Insert space between difference prefix ('Snake Case', 'Camel Cas

Kaoru Tsutsumishita 102 Nov 29, 2022
Plugin for IntelliJ-based IDEs folding root files in the ProjectView

Foldable ProjectView The Foldable ProjectView is a plugin for the IntelliJ-based IDEs that lets you fold files located in the root of your project. Av

Jakub Chrzanowski 47 Dec 13, 2022
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)

JetBrains Copilot GitHub Copilot support for the IntellIJ Platform. Installation Download the latest release. Select the Install Plugin from Disk opti

Koding 155 Dec 10, 2022
A plugin that adds support for rs2asm files to IntelliJ.

Rs2Asm This plugin adds some simple features when interacting with rs2asm files. Features Syntax highlighting Autocompletion for label names and instr

Joshua Filby 3 Dec 16, 2021
IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template is a repository that provides a pure template to make it easier to create a new plugin project (check the Creating a repository from a template article).

null 0 Nov 8, 2021