INDEX
Javaクラスファイルの逆コンパイル
1  NI-Lab.  2002/06/16(Sun) 17:11
Javaバイトコード, 逆コンパイルツール, Obfuscator 等について。
2  NI-Lab.  2002/06/16(Sun) 17:14
http://home7.highway.ne.jp/dayan/java/obfuscate.html
Java によるプログラミングにおいてObfuscatorの利用のすすめ

Obfuscatorを使うと、逆コンパイルしても理解しにくい(汚い)ソースコードを生成できる。
3  NI-Lab.  2002/06/16(Sun) 18:05
http://spacejug.org/resources/Java_Utilities/Decompilers/jad.html
Jad - the fast JAva Decompiler

クラスファイルからJavaソースコードを生成する逆コンパイルツール。
以前は、GeoCities.com にサイトがあったと思うけど、いまはココが公式?
4  NI-Lab.  2002/06/25(Tue) 09:16
http://www-6.ibm.com/jp/developerworks/java/011026/j_j-obfus.html
Javaコードを守る方法 (あるいは他人のJavaコードを参照する方法)

>Javaコードの逆コンパイルおよび曖昧化の完全ガイド

5  NI-Lab.  2004/06/03(Thu) 19:42
Jadでクラスファイルを逆コンパイルする。
パッケージ構造のディレクトリを、そのままソースコードへ変換。

jad -o -r -sjava -dsrc classes/**/*.class

-o 上書き確認なし
-r パッケージディレクトリ構造
-s 拡張子をjavaにする。
-d 生成されたソースコードファイルの出力先ディレクトリ

6  NI-Lab.  2004/06/03(Thu) 19:42
// Jadのヘルプ。
> C:\>jad
> Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov (kpdus@yahoo.com).
> Usage: jad [option(s)] <filename(s)>
> Options: -a - generate JVM instructions as comments (annotate)
> -af - output fully qualified names when annotating
> -b - generate redundant braces (braces)
> -clear - clear all prefixes, including the default ones
> -d <dir> - directory for output files
> -dead - try to decompile dead parts of code (if there are any)
> -dis - disassembler only (disassembler)
> -f - generate fully qualified names (fullnames)
> -ff - output fields before methods (fieldsfirst)
> -i - print default initializers for fields (definits)
> -l<num> - split strings into pieces of max <num> chars (splitstr)
> -lnc - output original line numbers as comments (lnc)
> -lradix<num>- display long integers using the specified radix
> -nl - split strings on newline characters (splitstr)
> -noconv - don't convert Java identifiers into valid ones (noconv)
> -nocast - don't generate auxiliary casts
> -noclass - don't convert .class operators
> -nocode - don't generate the source code for methods
> -noctor - suppress the empty constructors
> -nodos - turn off check for class files written in DOS mode
> -nofd - don't disambiguate fields with the same names (nofldis)
> -noinner - turn off the support of inner classes
> -nolvt - ignore Local Variable Table entries (nolvt)
> -nonlb - don't insert a newline before opening brace (nonlb)
> -o - overwrite output files without confirmation
> -p - send all output to STDOUT (for piping)
> -pa <pfx>- prefix for all packages in generated source files
> -pc <pfx>- prefix for classes with numerical names (default: _cls)
> -pe <pfx>- prefix for unused exception names (default: _ex)
> -pf <pfx>- prefix for fields with numerical names (default: _fld)
> -pi<num> - pack imports into one line using .* (packimports)
> -pl <pfx>- prefix for locals with numerical names (default: _lcl)
> -pm <pfx>- prefix for methods with numerical names (default: _mth)
> -pp <pfx>- prefix for method parms with numerical names (default:_prm)
> -pv<num> - pack fields with the same types into one line (packfields)
> -r - restore package directory structure
> -radix<num>- display integers using the specified radix (8, 10, or 16)
> -s <ext> - output file extension (default: .jad)
> -safe - generate additional casts to disambiguate methods/fields
> -space - output space between keyword (if, while, etc) and expression
> -stat - show the total number of processed classes/methods/fields
> -t<num> - use <num> spaces for indentation (default: 4)
> -t - use tabs instead of spaces for indentation
> -v - show method names while decompiling
> -8 - convert Unicode strings into ANSI strings (ansi)
> -& - redirect STDERR to STDOUT

7  NI-Lab.  2004/06/03(Thu) 19:43
http://www.egworks.jp/technical.htm
EGworks イージーワークス - Javaソースコードを保護する方法
8  NI-Lab.  2004/06/03(Thu) 19:43
http://www.cipher.is.tsukuba.ac.jp/~kana/research/java_reverse/decompiler.htm
java逆コンパイラ

逆コンパイラ(DeCompiler)とオブファスケータ(Obfuscator)を使って、
逆コンパイルと曖昧化の検証をしている 金岡 晃 氏 のページ。
参考になる。

9  NI-Lab.  2004/06/03(Thu) 19:44
>>8
いろんな逆コンパイラによる検証がされているので、
逆コンパイラを比較するのにいいかも。
10  NI-Lab.  2004/06/03(Thu) 19:45
http://jode.sourceforge.net/
JODE

java -cp jode-1.1.1.jar jode.decompiler.Main

最新バージョンは1.1.1で、 2001-08-12 のもの。

>>8
をみた感じでは、これが一番有望かなぁ。
11  NI-Lab.  2004/06/03(Thu) 19:45
http://members.fortunecity.com/neshkov/dj.html
DJ Java Decompiler

12  NI-Lab.  2004/06/03(Thu) 19:45
JadをEclipseから使うためのプラグイン。

http://sourceforge.net/projects/jadclipse
JadClipse - Eclipse plugin

http://kpdus.tripod.com/jad.html
Jad - the fast JAva Decompiler

わかりやすい説明↓ページ

http://muimi.com/j/eclipse/use_plugin/jadclipse/
むいみこむ - JadClipse

http://w3.cube-web.net/eclipse/index.php?%5B%5BJadClipse%A5%D7%A5%E9%A5%B0%A5%A4%A5%F3%5D%5D
eclipse - JadClipseプラグイン