Live data from Hacker News

Show HN: I wrote a Java decompiler in pure C language

github.com

11–20 of 104 posts

Re: Show HN: I wrote a Java decompiler in pure C language

#12

Very cool project! Love the idea of a Java decompiler written in C — the speed must be great. Any plan to support `.dex` in the future? Also curious how you handle inner classes inside JARs.

The "jikes" compiler from IBM https://github.com/daveshields/jikespg> was written in C++ and was for the longest time screaming fast. It also had its own parser generator lpg which was fun to play with, if you're into those things https://github.com/daveshields/jikespg>

It seems someone liked it and made a "v2" along with LSP support https://github.com/A-LPG/LPG2#lpg2

Re: Show HN: I wrote a Java decompiler in pure C language

#13

Very cool project! Love the idea of a Java decompiler written in C — the speed must be great. Any plan to support `.dex` in the future? Also curious how you handle inner classes inside JARs.

I am writing the part of decompiling dex and apk. The current speed is about 10 times faster than that of Java, and it takes up less resources than Java. And the compiled binary is smaller, only about 300k. Thank you for your attention.

Re: Show HN: I wrote a Java decompiler in pure C language

#14

Very cool project! Love the idea of a Java decompiler written in C — the speed must be great. Any plan to support `.dex` in the future? Also curious how you handle inner classes inside JARs.

It is processes inner classes recursively. First read all entry from jar, and analyze the relationships between classes. Then do some decompile job.

Re: Show HN: I wrote a Java decompiler in pure C language

#16

By hand or with AI? Fascinating. So much work! What was your motivation for this?

90% by hand, 10% AI. I do this for fun and to learn about jvm.

I think that sort of ratio is the sweet spot for learning. I've been writing an 8086 simulator in C++ and using an LLM for answering specific technical questions I come up with has drastically sped up my progress without it actually doing the work for me.

Re: Show HN: I wrote a Java decompiler in pure C language

#18

Earlier quoted context omitted.

LLMs can explain the process, and you can build projects with LLMs explaining the process.

LLMs can attempt to explain the code, but it can't explain people's thought process and that's the interesting part. I want to hear about the reverse engineering, how you thought the code through. LLMs are boring.

They can, if you write down your thought process, which is probably what you should do when you are using an LLM to create a product, but what do I know.

Re: Show HN: I wrote a Java decompiler in pure C language

#19
post #6

Earlier quoted context omitted.

To some people the process leading to a finished project is the most interesting thing about posts like these.

LLMs can explain the process, and you can build projects with LLMs explaining the process.

LLM output is simply not interesting

Re: Show HN: I wrote a Java decompiler in pure C language

#20

Very cool project! Love the idea of a Java decompiler written in C — the speed must be great. Any plan to support `.dex` in the future? Also curious how you handle inner classes inside JARs.

I am writing the part of decompiling dex and apk. The current speed is about 10 times faster than that of Java, and it takes up less resources than Java. And the compiled binary is smaller, only about 300k. Thank you for your attention.

This has been my life experience with things written in C/C++, so speed doesn't matter. Or, I guess from an alternative perspective, it ran very fast, but exited very fast, too :-D

  $ ./objdir/garlic $the_jar_file -o out-dir -t $(nproc)
  Progress : 85 (1024)Segmentation fault: 11
Post reply on HN