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: sheep, Hacker, Stefan2, white

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

Post by *yyang » 2012-06-08, 02:11 UTC

esandrei wrote: Is there a specific reason why you would like to change the font or you just prefer another font/font size?
Sorry for my late response... Courier New is my favorite too, but on my laptop the decompiled code is obviously not display in Courier New:

Image: http://i50.tinypic.com/fwmxwx.png

That's why I thought a configuration option might help.

My environment is Windows XP Pro with SP3 Simplified Chinese Edition. The font in the linked image is SimSun, the system default for simplified Chinese text on Windows prior to Vista, I think.

Update: It seems that adding these lines to initDefaultStyle() in highlight.cpp fixes my problem :D:

Code: Select all

default_style.dwMask |= CFM_CHARSET;
default_style.bCharSet = DEFAULT_CHARSET;

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

Post by *yyang » 2012-06-08, 17:58 UTC

XPEHOPE3KA wrote: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.
The first issue is due to a reasonable assumption in the source code that file Foo.class corresponds to class Foo. If the .class file is renamed to Bar.class, the plugin will fail to locate the generated file Foo.java in the plugin's installation directory. (You can find it there anyway; since a Java class cannot contain any space, you must have renamed the .class file, have you?) This could be fixed by reading from JAD's output (stderr) for the path of the generated .java file.

The second issue is caused by the decompiler JAD itself. It just can't handle "unusual" characters like CJK and Russian in the path. This could be fixed by setting the JAD process' current directory to the .class file's directory.

I'll try to make a patch or something if my time allows.

Update: I've made a mod version and uploaded it here: http://www.4shared.com/zip/HmiBqkZn/tc_jad_plugin_sources_101_mod_.html. The problems found by XPEHOPE3KA and me have been fixed (hopefully). To have a try please replace your old tc_jad_plugin.wlx with my version.

As I'm more familiar with Visual C++, I just put all necessary source files into one folder and compile. All modifications are marked out in the comment (search for "yyang"). The modified files are decompile.cpp (major patch work), highlight.cpp (1 mod), and listplug.cpp (2 cosmetic mods for VC 2008 and VC 2010 to compile). The included tc_jad_plugin.wlx is compiled with VC6. You can use build.bat to compile your own version (provided cl.exe is on your PATH; remove "/opt:nowin98" if you use VC 2010).

If the .class file itself contains, say, CJK characters, my version won't work. It's a limitation of the JAD decompiler. Copying it to a regular-name tmp file and decompiling that file feels weird to me. Please do it manually.

@esandrei: Please feel free to incorporate my code into your future version. Thanks.

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

TC Jad Plugin 1.1

Post by *esandrei » 2012-06-17, 07:48 UTC

Thanks you XPEHOPE3KA and yyang for finding bugs and fixes and taking your time to post them here.

@yyang you got them all right :)

TC Jad Plugin 1.1 includes your fix for the font(could't test it on a Chinese system though) and is also fixing XPEHOPE3KA's bugs.

I actually opted for your last thought to copy the class file in the tmp location with a non unicode name. It don't like it too much but Java accepts unicode chars in class names so it makes sense for the plugin to do the same. So now unicode characters anywhere in the class file path including the class name ore ok. Spaces in the file name are fine too.

Also did some refactoring in decompile.cpp as there was mixed usage of char and WCHAR and now all paths are WCHARs only.

I realize that most of the windows C++ devs are mostly familiar with VC++ (I am one of them) but I used Eclipse C++ just for the fun of learning something new. I am planning to add basic user configuration sometimes (I hope sooner rather than later) in the next major release and it will most probably be a VC++ project.

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-17, 09:52 UTC

2yyang
2esandrei
Thanks for fixing this, it works now.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..

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

Post by *jmwap » 2014-03-14, 11:19 UTC

EDIT: a restart brought order into things.

suddenly F3 shows the usual lister, and is not using this very useful plugin. I am not sure I have changed anything.

What is the best way to debug this? I am already missing looking into any class file, was so handy!!

thanks

daobi
New Member
New Member
Posts: 1
Joined: 2015-10-16, 08:06 UTC

Post by *daobi » 2015-10-16, 08:14 UTC

After a successful automatic installation of tc_jad_plugin-1.1.zip into
c:\Program Files\totalcmd\plugins\wlx\tc_jad_plugin\
lister doesn't show decompiled class files.

After installing into a path without spaces (c:\dev\totalcmd\plugins\wlx\tc_jad_plugin\) lister shows decompiled java classes correctly.

Can you provide a bugfix please?
Thanks in advance

Aleq
Junior Member
Junior Member
Posts: 52
Joined: 2006-06-07, 07:24 UTC
Location: CZ, EU

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

Post by *Aleq » 2019-02-15, 19:54 UTC

Hi,
anybody has a local copy or mirror of the plugin? The hosting server has been down for several days and I can't find it anywhere else.

Thanks a lot,
A.

User avatar
Ovg
Power Member
Power Member
Posts: 614
Joined: 2014-01-06, 16:26 UTC
Location: MOW

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

Post by *Ovg » 2019-02-16, 07:28 UTC

It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 9.5 β8 x64, Windows 7 SP1 x64

mikedepetris
Junior Member
Junior Member
Posts: 63
Joined: 2006-11-07, 16:36 UTC
Location: Trieste, Italy
Contact:

Re:

Post by *mikedepetris » 2019-02-16, 20:47 UTC

daobi wrote:
2015-10-16, 08:14 UTC
After a successful automatic installation of tc_jad_plugin-1.1.zip into
c:\Program Files\totalcmd\plugins\wlx\tc_jad_plugin\
lister doesn't show decompiled class files.

After installing into a path without spaces (c:\dev\totalcmd\plugins\wlx\tc_jad_plugin\) lister shows decompiled java classes correctly.

Can you provide a bugfix please?
Thanks in advance
I confirm it must be placed in a path without spaces

ChristianGruen
Junior Member
Junior Member
Posts: 8
Joined: 2008-09-14, 15:45 UTC

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

Post by *ChristianGruen » 2019-05-07, 05:54 UTC

I would still love to have an option to change the display font. Is there any chance that someone could provide such an option in the ini file?

Thanks in advance,
Christian

Post Reply