Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompile without loading the class file into the JVM #15

Open
meiMingle opened this issue Nov 14, 2024 · 1 comment
Open

Decompile without loading the class file into the JVM #15

meiMingle opened this issue Nov 14, 2024 · 1 comment

Comments

@meiMingle
Copy link

Through studying the code, it seems that the premise of this decompiler's work is to correctly load the target class into the JVM, which is very dangerous for studying class files containing malicious code. And in most cases, it is very difficult to load the target class file into the JVM due to missing dependencies. Is there a way to make the decompiler work without loading the clss file into the JVM?

@teletha
Copy link
Owner

teletha commented Nov 14, 2024

This decompiler was originally developed as a Java (bytecode) to Javascript transpiler. Now, by splitting the mechanism into Decompiler and (Re)Compiler, it is used as a runtime transpiler for JS, CSS, and SQL.

Currently, there is no way to get it to behave the way you want it to. Reincarnation makes heavy use of reflection-related classes (Class, Method, Field, etc.) as metadata holder.

To break the dependency on the Java's core-reflection would require a major overhaul that would require re-implementation of all the proprietary reflection types.

As for missing dependencies, the current implementation just throws an error and aborts the process. Therefore, it may be possible to provide an option to continue processing as an unresolved type.

However, there should be no problem with malicious code as it is configured not to initialize when loading classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants