Jad FQ

FAQ

Q1: Is the source code of Jad available?

A1: Currently I have no plans to release the Jad source code for any purposes including porting to other computer platforms.

Q2: What is the option -dead for?

A2: This option forces Jad to decompile the dead portions of bytecode. For example, non-optimizing compilation of the following code can produce the dead bytecode:

      if (false) 
      {
          ...
      }
This option should be on by default, but the incorrect dead bytecode can crash Jad.

Q3: Why does Jad fail to generate the throws clause in the method declarations like the one in

       int divide(int a, int b) throws DivideByZero { ... }   ?

A3: This throws clause is represented in the Java class files by the Exceptions attribute. The Java Virtual Machine itself doesn't use these attributes (well, at least, the common implementations of JVM), so they can be stripped out of the Java class files. Jad has no way of restoring this information in full if it's missing from the class file.

Q4: Why does Jad generate weird-looking static fields like class$java$lang$Float and static methods class$(String)?

A4: These fields/methods are the internal representation of the <classname>.class expression and automatically generated by compiler. For example, java.lang.Thread.class is translated into the following:

...
((class$java$lang$Thread == null) ?
    (class$java$lang$Thread = class$("java.lang.Thread")) :
     class$java$lang$Thread);
...


static Class class$(String s)
{
  try
  {
      return Class.forName(s);
  }
  catch(ClassNotFoundException ex)
  {
      throw new NoClassDefFoundError(ex.getMessage());
  }
}

static Class class$java$lang$Thread;
This is fixed in 1.5.8. The explanation for the previous versions: Jad doesn't convert all that back to the original expression, but apparently the Sun JDK 1.2 compiler is able to compile "the long format" successfully. JDK 1.3 compiler doesn't accept names containing class$, so in order to recompile the decomplied class you need to change all expressions similar to the conditional expression above to <classname>.class and remove static methods/fields whose names start with class$.

Q5: Jad refuses to decompile my class file saying "Class file version mismatch". What can I do?

A5: Use -debug option. Jad then complains about the version mismatch, but attempts to decompile the file anyway. Note that this works starting from the version 1.5.6e.

Q6: Jad fails to decompile my class file, it spits out a bunch of gotos and JVM instructions. Why is that?

A6: There could be several possible reasons: the class file has been obfuscated or it was produced by non-JDK Java compiler or some functions were inlined by Java compiler. Generally Jad works best with class files generated by Sun Java compilers. If you encounter such a behaviour, please send me a bug report with attached .class files.

Q7: How to decompile jar or zip archive with classes?

A7: "Unjar" (jar xvf <jarfile>) or unzip (using unzip or WinZip) the archive into a directory on your hard drive. Then see the next answer.

Q8: How to decompile the whole class tree?

A8: Run

      jad -r [-d<directory_for_sources>] [<other_options>] <directory_with_classes>**/*.class
On Unix the last argument should be in single quotes. For more information please read Readme.txt.

Q9: Why do I get "Class <<ambiguous>>List not found" from the compiler?

A9: There are two List classes: java.awt.List and java.util.List. If Jad generates two import directives:

	import java.awt.*; 
	import java.util.*;
and your class actually uses the List class, the compiler will complain. Prior version 1.5.7d use the command-line option -pi to prevent Jad from combining the import directives.

Q10: How to make the command-line options -ff -nonlb -space -t to be on by default?

A10: Use the environment variable JAD_OPTIONS to permanently override the default settings. The example for Windows:

	set JAD_OPTIONS=-ff+ -nonlb+ -t+ -space+

Q11: How to extract Java classes from an executable file (.exe)?

A11: Use the Java-Split utility written by the Decafe Pro team. Download it from http://decafe.hypermart.net/javasplit.htm.
Or use J++Extract from
http://www.multimania.com/dolmen/productions.

Q12: What does the error message "JavaClassFileParseException: Invalid tag value 0x0" mean exactly?

A12: It means that your file is not a valid Java class and Jad was unable to parse it successfully. Either the file was broken (for example, during download) or the package this class belongs to contains a custom Java class loader that modifies (or decrypts) Java classes after reading them into the memory. In both cases Jad cannot decompile this file as it is.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
反编译工具jad.exe 和 对应的eclipse插件jadclipse:(网络资源,服务大众) 已测试环境:windows 2000/NT/xp/vista; 推荐eclipse插件安装方法:.lnk文件安装; ----------使用方法------------ JadClipse Eclipse Plugin for Eclipse version 3.3 一、下载: 下载插件: 下载jadclipse_3.3.0.jar版本,该版本支持eclipse3.3M6以上版本 下载Jad反编译工具: http://www.kpdus.com/jad.html#download,在该页中找到适合自己操作系统平台的jad下载。下载后解压,然后将解压后的jad.exe文件复制到%JAVA_HOME%\bin目录下面(可以将jad.exe放到任意位置,只要记住其存放路径就好,下面要用到)。 二、安装: Eclipse中的插件安装可以参考:Eclipse使用技巧(三)Eclipse中插件的安装 方法1、直接将jadclipse_x.x.x.jar(x.x.x.代表版本号)复制到%ECLIPSE_HOME%\plugins目录下。 方法2、使用link方式安装,建立D:\Myplugins\jadclipse3.2.4\eclipse\plugins的目录结构,将jadclipse_3.2.4.jar放到plugins目录下面(注:其中D:\Myplugins为你自己定义的一个专门放置插件的目录)。再在%ECLIPSE_HOME%\links目录下面建立一个jadclipse3.2.4.link文件(该文件名随便取)。文件里面内容为:path=D:/Myplugins/jadclipse3.2.4. 三、使用: 启动eclipse,点击反编译的类文件,此时会激活jadclipse插件,在eclipse菜单中会多出一个jadclipse菜单,如下图所示: 一般地它会自动反编译相应的class文件,如果没有自动反编译,请点击 jadclipse->Decompile 常见问题及解决: (一)启动eclipse,打开Window->Preferences->Java->JadClipse,如果没有找到JadClipse,即JadClipse插件没有激活。 (1)检查插件安装的版本是否与你安装的eclipse版本对应 (2)使用 –clean参数来启动eclipse (二)在使用JadClipse插件反编译class文件时出现如下类似错误: /*jadclipse*/ /* DECOMPILATION REPORT Decompiled from: D:\Program Files\Java\jdk1.5.0_12\jre\lib\rt.jar Total time: 16 ms Jad reported messages/errors: Exit status: 0 Caught exceptions: java.io.IOException: CreateProcess: (...) */ 请确保你的Jad路径在eclipse中正确制定。 启动eclipse,打开:Window->Preferences->Java->JadClipse. 1、Path to decompiler,这里设置反编译工具jad的全路径名,比如:%JAVA_HOME%\bin\jad.exe. 2、Directory for temporary files,这里设置临时文件路径。 至于Window->Preferences->Java->JadClipse目录下的Debug,Directives,Formatting,Misc目录中的参数设置,就不再罗嗦了。 (三)安装完成后,eclipse没有自动将JadClipse Class File Viewer设置成class文件的缺省打开方式。 如果没有默认,可以在Eclipse的Windows—> Perference—>General->Editors->File Associations中修改“*.class”默认关联的编辑器为“JadClipse Class File Viewer”。设置完成后,双击*.class文件,eclipse将自动反编译。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值