zoukankan      html  css  js  c++  java
  • Jad用法(转) 规格严格

    jadclipse

    jadclipse插件网站: http://jadclipse.sourceforge.net/

    一、下载:
    下载插件:
    下载jadclipse_3.1.0.jar版本,该版本支持eclipse3.1M6以上
    下载jadclipse_3.2.0.jar版本,该版本支持eclipse3.2M3和eclipse3.2M4.
    下载jadclipse_3.2.2.jar版本,该版本支持eclipse3.2M5以上。


        二、安装:
        方法1、直接将jadclipse_3.1.0.jar复制到%ECLIPSE_HOME%\plugins目录下。cmd -> %

    ECLIPSE_HOME% ->eclipse -clean
        方法2、使用link方式安装,建立E:\eclipse3.1plugins\jadclipse3.1.0

    \eclipse\plugins的目录结构,将jadclipse_3.1.0.jar放到plugins目录下面(注:其中E:

    \eclipse3.1plugins为你自己定义的一个专门放置插件的目录)。再在%ECLIPSE_HOME%

    \links目录下面建立一个jadclipse3.1.0.link文件(该文件名随便取,保证后缀为。link就

    OK)。文件里面内容为:path=E:\\eclipse3.1plugins\\jadclipse3.1.0.启动eclipse,打

    开Window->Preferences->Java->JadClipse,如果没有找到JadClipse,检查插件安装的版本

    是否与你安装的eclipse版本对应。
    我安装的eclipse是:eclipse3.1.2

    三、设置参数:
        启动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将自动反编译。

        注:对于存在源代码的类,它不会强行反编译,也就是说它还是会用eclipse自带的

    Class File Viewer查看class文件。

    错误 代码
    1.错误:   
    2.  
    3./*jadclipse*/Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov (kpdus@yahoo.com).   
    1.Usage:    jad [option(s)]    
    2.Options: -a       - generate JVM instructions as comments (annotate)   
    3.         -af      - output fully qualified names when annotating   
    4.         -b       - generate redundant braces (braces)   
    5.         -clear   - clear all prefixes, including the default ones   
    6.         -d
    - directory
    for output files   
    7.         -dead    - try to decompile dead parts of code (if there are any)   
    8.         -dis     - disassembler only (disassembler)   
    9.         -f       - generate fully qualified names (fullnames)   
    10.         -ff      - output fields before methods (fieldsfirst)   
    11.         -i       - print default initializers for fields (definits)   
    12.         -l<num></num>  - split strings into pieces of max <num></num> chars (splitstr)   
    13.         -lnc     - output original line numbers as comments (lnc)   
    14.         -nl      - split strings on newline characters (splitstr)   
    15.         -noconv  - don't convert Java identifiers into valid ones (noconv)   
    16.         -nocast  - don't generate auxiliary casts   
    17.         -nocode  - don't generate the source code for methods   
    18.         -noctor  - suppress the empty constructors   
    19.         -nodos   - turn off check for class files written in DOS mode   
    20.         -noinner - turn off the support of inner classes   
    21.         -nolvt   - ignore Local Variable Table entries (nolvt)   
    22.         -nonlb   - don't insert a newline before opening brace (nonlb)   
    23.         -o       - overwrite output files without confirmation   
    24.         -p       - send all output to STDOUT (for piping)   
    25.         -pa  <pfx></pfx> - prefix for all packages in generated source files   
    26.         -pc  <pfx></pfx> - prefix for classes with numerical names (default: _cls)   
    27.         -pe  <pfx></pfx> - prefix for unused exception names (default: _ex)   
    28.         -pf  <pfx></pfx> - prefix for fields with numerical names (default: _fld)   
    29.         -pi<num></num> - pack imports into one line using .* (packimports)   
    30.         -pl  <pfx></pfx> - prefix for locals with numerical names (default: _lcl)   
    31.         -pm  <pfx></pfx> - prefix for methods with numerical names (default: _mth)   
    32.         -pp  <pfx></pfx> - prefix for method parms with numerical names (default:_prm)   
    33.         -pv<num></num> - pack fields with the same types into one line (packfields)   
    34.         -r       - restore package directory structure   
    35.         -s <ext></ext> - output file extension (default: .jad)   
    36.         -space   - output space between keyword (if, while, etc) and expression   
    37.         -stat    - show the total number of processed classes/methods/fields   
    38.         -t<num></num>  - use <num></num> spaces for indentation (default: 4)   
    39.         -t       - use tabs instead of spaces for indentation   
    40.         -v       - show method names while decompiling   
    41.  
    42.  
    43./*  
    1. DECOMPILATION REPORT  
    2. 
    1. Decompiled from: D:\Program Files\MyEclipse 6.0\jre\lib\rt.jar  
    2. Total time: 141 ms  
    3. Jad reported messages/errors:  
    4. Exit status: 1  
    5. Caught exceptions:  
    6.*/  
    7.  
    8.解决方法:下载Jad(我附带了一个),放在jre\lib\下面,或者设置Jad的全路径名   

    反编译工具jad简单用法
    以下假设jad.exe在c:\java目录下
    一、基本用法
    Usage:    jad [option(s)]
    直接输入类文件名,且支持通配符,如下所示。
    c:\java\>jad example1.class
    c:\java\>jad *.class
    结果是将example1.class反编译为example1.jad。将example1.jad改为example1.java即得源

    文件。

    二、Option -o
    不提示,覆盖源文件
    三、Option -s
    c:\java\>jad -sjava example1.class
    反编译结果以.java为扩展名。

    四、Option -p
    将反编译结果输出到屏幕
    c:\java\>jad -p example1.class
    将反编译结果重定向到文件
    c:\java\>jad -p example1.class>example1.java

    五、Option -d
    指定反编译的输出文件目录
    c:\java\>jad -o -dtest -sjava *.class
  • 相关阅读:
    moment.js相关知识总结
    git相关使用解释
    .我的第一篇博客
    QT项目配置
    重载->
    内核对象同步
    模式对话框与非模式对话框
    显示与隐式类型转换
    size_t与size_type
    系统级源代码:系统裁剪
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/1610086.html
Copyright © 2011-2022 走看看