TC JAD Java Decompiler Plugin - See class files as java code

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Stefan2, white, sheep, Hacker

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

TC JAD Java Decompiler Plugin - See class files as java code

Post by *esandrei » 2012-05-21, 07:29 UTC

Hi,

First, thank you Christian Ghisler for a great file manager!

I made a Total Commander Lister plugin for java classes. I've been using it for the last year and shared it with my friends too. It is tested on Win XP/Vista/7 and it seems release ready, no bugs in the last year :)

It is displaying decompiled java code from .class files in TC Lister. It is fast as it is written in C++ and the code is highlighted. All default Lister features are available (search, select, copy etc.)

Installation

Download: TC JAD Plugin

Automatic installation is supported - open tc_jad_plugin_1.0.zip using Total Commander and choose yes to install it

Manual Installation

1. Unpack tc_jad_plugin_1.0.zip wherever you would like to install it
2. In TC go to Configuration -> Options -> Plugins -> Configure (next to Lister Plugins (.WLX))
3. In Lister plugins window click Add and browse to tc_jad_plugin.wlx in the location where you chose to unpack tc_jad_plugin_1.0.zip
4. Click OK to close Lister plugins window
5. Click OK to close TC Configuration window
6. DONE

You can now press F3 on any class file to view its decompiled code. Enjoy :)

Sources

The source is opened and available in tc_jad_plugin_sources.zip. I used Eclipse C++ as IDE and MinGW/MinGW-w64 as x32/x64 compilers so you can just import the .cproject in Eclipse

I started from the official Lister plugin sample which is a VC++ 6.0 project so VC++ can also be used (beware of newer versions of VC++ which require manual configuration of listplug.def to create the right DLL interfaces signature)
Last edited by esandrei on 2012-05-25, 06:53 UTC, edited 7 times in total.

User avatar
white
Power Member
Power Member
Posts: 2020
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white » 2012-05-21, 09:41 UTC

Message from moderator

Moved to Plugins and addons forum.

White (moderator)
2esandrei: You have been a member for longer than a day and you have now posted a message so you can probably fix your link by clicking the Edit button and editing your message.

2Sir_SiLvA: Thanks for the hint.
Last edited by white on 2012-05-22, 10:14 UTC, edited 3 times in total.

User avatar
white
Power Member
Power Member
Posts: 2020
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC Jad Plugin - See .class files as decompiled java code

Post by *white » 2012-05-21, 10:22 UTC

Hi esandrei,

I suggest to add version number.

You don't seem to use the latest version of jad.exe. Why?
pluginst.inf wrote:defaultdir=plugins\wlx\tc_jad_plugin
Remove the path "plugins\wlx". It doesn't do anything.

I suggest to include a better description in the top of the readme.txt file. For example use the same description as in pluginst.inf:
"JAD Lister plugin for Java binary .class files. Uses jad to decompile the .class file and highlights the resulted code."

User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 2790
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA » 2012-05-21, 10:41 UTC

2white
would it be to much ask of you to make the link into a REAL link when you allready move the post? tia :D

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

Updated the link to the versioned plugin tc_jad_plugin-1.0

Post by *esandrei » 2012-05-21, 20:19 UTC

Thanks white and Sir_SiLvA.

I was able to post the real download url now, I included a version in the plugin name too. I left the wlx name as is though as per my understanding TC automatic installer doesn't handle uninstall old version. Keeping same wlx name between releases makes it easy to upgrade.

I also updated the plugin description in the readme.txt and included the jad version I use too - I upgraded to what it seems the latest jad - 1.5.8g - there was no special reason why I used 1.5.8f probably it was the one I had on my PC at the time I wrote the plugin :)

User avatar
tbeu
Power Member
Power Member
Posts: 1256
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu » 2012-05-23, 10:41 UTC

Two comments:
* MultiLister also displays decompiled class files - without syntax highlighting though.
* Totalcmd.net link also displays x64 download but there is no wlx64 file in the downloaded archive tc_jad_plugin-1.0.zip.
TC plugins: Autodesk 3ds Max Preview, Autodesk Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

yyang
Junior Member
Junior Member
Posts: 68
Joined: 2007-03-27, 11:41 UTC
Location: China

Post by *yyang » 2012-05-23, 15:55 UTC

Thanks for the nice plugin! Could you add an option for custom display font, please?

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

Post by *esandrei » 2012-05-25, 06:16 UTC

@tbeu, thank you for your feedback!

Oops, never noticed TC has a 64-bit version and I didn't realize x64 means it works with TC 64-bit, I though it just means that runs on Win x64.

I compiled a x64 version and included it in TC Jad Plugin 1.0.1 - works fine on Win7 x64 + TC 64-bit.

Indeed, MultiLister and also JADDemo(couldn't find a link anymore) are displaying decompiled classes however MultiLister is much more complex as it's a 'one size fits all' and unfortunately on my PC was not stable, didn't figure out why but half the times was just opening default Lister window. JADDemo has highlighted code as it displays the code in a Java Swing JTextPane and I used it for a while. What determined me to write my own plugin, besides the jre dependency which was making it slow at least for the first class, is that search and copy was not working and ESC key was not closing the window ... and I also think the page was scrolled all the way down.

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

Post by *esandrei » 2012-05-25, 07:23 UTC

@yyang

Thanks, glad you find it useful.

About the font, it's Courier New, the standard coding font and I never felt the need to change it myself but if this is a desired feature I would gladly implement it when I get some spare time ... if someone else doesn't beat me to it :)

Is there a specific reason why you would like to change the font or you just prefer another font/font size?

User avatar
white
Power Member
Power Member
Posts: 2020
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white » 2012-05-25, 07:47 UTC

esandrei wrote:I compiled a x64 version and included it in - works fine on Win7 x64 + TC 64-bit.
[quote=""What's new" on http://totalcmd.net/plugring/tc_jad_plugin.html"]- binary for TC 64-bit
[/quote]
How come the size of tc_jad_plugin.wlx (which is the 32-bit version) changed from 25600 bytes to 29.184 bytes?

Any reason why jad.exe version 1.5.8f is now included in tc_jad_plugin_sources_1.0.1.zip?

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

Post by *esandrei » 2012-05-25, 09:31 UTC

Wow, eagle eyes White :)

I've rebuilt the whole project(x32 and x64) with optimize most (previously was none). This is the only reason of wlx file size difference (the header changed too but that didn't affect the binary size).

The sources zip is in synch with the binaries and is also versioned so after upgrading one will have both versions side by side for a fast diff.

Jad 1.5.8f is in the sources zip and it's not used. It's a waste of space, I will remove it next time I update the package.

jmwap
Member
Member
Posts: 117
Joined: 2008-03-23, 12:40 UTC

Post by *jmwap » 2012-05-26, 22:54 UTC

just installed this great plugin, i'm java developer by trade so i'll make great use of this thanks!!!

one Q, does jad decompile java1.7 code too? is still being developed ? I thought it was mostly abandoned.

jmwap
Member
Member
Posts: 117
Joined: 2008-03-23, 12:40 UTC

Post by *jmwap » 2012-05-28, 11:55 UTC

I verified and Jad is not developed anymore. This one http://java.decompiler.free.fr/ seems to be a good replacement.

One feature suggestion I can thin of: for the ones that use a more suited editor, and probably have it open already (notepad++ for example), could it be possible to open the decompiled text in it directly? This way we could use goodies like method lists, navigation etc

regards

esandrei
Junior Member
Junior Member
Posts: 8
Joined: 2012-04-09, 04:21 UTC

Post by *esandrei » 2012-05-30, 03:58 UTC

@jmwap,

Thanks for your feedback.

JD-Core is the best java decompiler I know. I personally sometimes use JD-GUI(gui based on JD-Core) and quite often JD-Eclipse (JD-Core plugin for Eclipse) which I also improved with an align code for debugging feature.

JD-Core was my first option for a TC decompiler plugin, unfortunately it is not available in a raw form. I tried using the dll that comes with JD-Eclipse but couldn't figure out a way to simulate the JNI way of calling it. If anyone has that knowledge, please share :)

I am only using TC Jad Plugin for light tasks like checking if a line is present in a class from a specific jar version for example. For reverse engineering I am using JD-Eclipse which is more suited for this job than any other text editor and handles Java 7 quite good.

On quick look I am not sure where I could fit opening the decompiled code in an external editor. I don't know if TC exposes its configured text editor to plugins so it will probably have to be added as a configuration to the plugin itself or just open the java file with the default windows application. But then if I loose control to the editor, who will remove the temporary file. I'll give more thought when I get some time to see how feasible would be a feature like that.

User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 849
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA » 2012-06-03, 10:23 UTC

2esandrei
Bugs:
- doesn't support spaces in filenames (opens e:\Cache.class, but if I rename it to e:\C ache.class, just binary lister view is shown)
- doesn't support Russian characters in path (d:\Development\Java\Диплом\bin\org\spbu\bdd\core\Cache.class wouldn't open)

Reproducable 99% of the time.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..

Post Reply