반응형

Jad Decompiler 사용법

Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
Copyright 2000 Pavel Kouznetsov (kpdus@yahoo.com). 


[ 사용방법 ]


1. 클래스 하나만 디컴파일시

           example1.class   를 디컴파일시 

           jad.exe 를 디컴파일할 파일과 동일한 폴더에 놓는다.

         

           Command 창에   jad -o -sjava example1.class   

       

   결과물 : 'example1.java' 

   

2. Package 를 디컴파일시   

         tree  폴더 아래의 모든 클래스파일을 디컴파일시 

         폴더와 같은 폴더에 jad.exe  를 위치하고


          Command 창에    jad -o -r -sjava -dsrc tree/**/*.class 

          

          결과물 : 폴더내에 [src] 폴더가 생성된다. 

=============================================================================================================

윈도우버전(for Windows 9x/NT/2000 on Intel platform)


jad -r -d .\src -s java .\ifxjdbc\**\*.class


참고 : jad -r [-d<directory_for_sources>] [<other_options>] <directory_with_classes>**/*.class



설명 :


-r : 해당 패키지 형태로 디렉토리 구조를 만듬( restore package directory structure)

-d : 디컴파일될 디렉토리(-d <dir> - directory for output files)

 -s java : 디컴파일된 파일의 확장자를 java로 하라


.\ifxjdbc\**\*.class : ifxjdbc 디렉토리 아래의 모든 클래스들 지정



-----------------------------------------------------------------------------------------


이클립스 디컴파일러인 JAD를 설치하는 방법입니다.


이클립스로 개발을하다보면 F3버튼으로 열심히 따라가는 경우가생깁니다.


그러다 라이브러리로 묶여있는 클래스파일들을 로딩하게되면 읽긴읽되 내용을 분석하지못하죠~


그래서 디컴파일러 ~ 컴파일한클래스파일을 다시 자바파일로 보여주는 도구를 설치하게되면


클래스파일도 자바파일처럼 열수있게됩니다^^~



우선 jad.exe, jadclipse_3.1.0.jar를 다운로드 합니다.


jad.exe파일은 이클립스 폴더에 jadclipse_3.1.0.jar파일은 플러그인 폴더에 카피합니다.


window->preference->general->editors->file assosiationsd에서 *.class선택후


하단의 JadClipse Class File Viewr 를 선택후 default 를 선택합니다.


window->preference->java->JadClipse를 선택한후 ignore existing source를 체크해줍니다.


이렇게하시고 이클립스를 실행시키시면 *.class파일을 찾아갈경우 자동으로 디컴파일해줍니다~

http://sourceforge.net/projects/jadclipse



반응형

Mocha - http://www.brouhaha.com/~eric/computers/mocha.html 
Hanpeter van Vliet's first Java Decompiler. Orphaned at Java 1.02, so crashes on inner classes. [Freeware]

WingDis 2.15 - http://www.wingsoft.com/wingdis.shtml 
Command line Java decompiler. [Commercial]

SourceAgain - http://www.ahpah.com/product.html 
Java Decompiler for Win95/NT, Unix, web-based trial version from Ahpah Software. [Commercial]

Jad - http://www.geocities.com/SiliconValley/Bridge/8617/jad.html 
the fast Java decompiler. Separate versions for Win32, OS/2, most Unixen. [Freeware].

SourceTec Java decompiler - http://www.srctec.com/decompiler.htm 
Patch to Mocha which defeats Crema. [Shareware]

NMI's Java Code Viewer - http://njcv.htmlplanet.com 
The "user-friendly, visual" Java decompiler and disassembler for Win32 platform. [Shareware]

Java Code Engineering - http://www.meurrens.org/ip-Links/Java/codeEngineering/ 
Marc Meurrens' page on engineering & reverse engineering Java class files. Review of books and on line resources on: the Java Virtual Marchine (JVM); code engineering & reverse engineering; class browsers, viewers & editors; assemblers; compilers; disassemblers & decompilers; obfuscators & unobfuscators. Comprehensive, well organized site.

Decafe Pro - http://decafe.hypermart.net/ 
Java Decompiler for Win32 platform. [Commercial]

 Kimera - http://kimera.cs.washington.edu/disassembler.html 
Online Java Disassembler. Just enter an URL of a .class file and it will be disassembled into a form suitable for re-assembly by Jasmin. [Freeware] 

Dumping Class Files - http://professionals.com/~cmcmanis/java/dump/index.html 
Chuck McManis's code to parse class files. [Free for non-commercial].

ClassCracker - http://www.pcug.org.au/~mayon/ 
Visual Java decompiler from Mayon Software Research. [Commercial]

Java Optimize and Decompile Environment (JODE) - http://jode.sourceforge.net/ 
Java decompiler with full source code. Supports inner/anonymous classes. Also contains a small, but extensible bytecode obfuscator/optimizer. [Open Source, GPL]

CafeBabe - http://jfa.javalobby.org/projects/CafeBabe.html 
Graphical disassembler and editor of Java bytecodes. Part of the JFA. [Open Source]

RIIS: Decompiling Java - http://www.riis.com/depile.html 
Godfrey Nolan's book on writing your own Java decompiler may never be published, so early chapters are online in PDF format.

dis - http://www.cs.princeton.edu/~benjasik/dis/index.html 
A functional, fast and simple disassembler that is written in C. Like javap, produces bytecode. Download Solaris, Win95/NT versions. Mac or other Unixen or source code by email request. [Freeware]

BackToJava (BTJ) - http://www.backtojava.org/ 
General tool for manipulation of Java bytecode (disassembly, assembly, statistics, decompilation, debug information...), written in Java. In progress. [Open Source, LPGL]

JReveal.Org - http://www.jreveal.org 
Online decompiler and obfuscator. Also has a resource directory. [Freeware]

IceBreaker - http://www.suddendischarge.com/cgi-bin/antileech.cgi?icebreak10.zip 
(Zip-file) A 'Visual' Java decompiler/disassembler. Allows side-by-side comparison of disassembled byte code from class files, for easier decompilation. "Replete with bugs" and dependent on command-line decompiler, such as Mocha or Javap. [Freeware] 

반응형
세계는 나의 한계이며, 나의 한계는 언어의 한계이다.”     - 비트겐슈타인

최근 그 어느 때보다도 다양한 언어에 대한 관심이 높아지고 있습니다. 자바는 JRuby, 그루비(Groovy), 스칼라(Scala) 등을 통해 언어를 넘어 플랫폼으로 발전하고 있고, 닷넷은 CLR(Common Language Runtime), DLR(Dynamic Language Runtime)을 통해 다양한 언어를 지원하고 있습니다. 또한 동적 언어와 함수형 언어에 대한 관심도 뜨겁습니다.

이번 문제는 단순합니다. 초보자 책에서도 흔히 볼 수 있는 도형 그리기 문제입니다. 하지만 익숙한 문제를 익숙하지 않은 언어, 익숙하지 않은 방법을 사용해 해결해 보면 어떨까요? 자바, C#, 루비, 파이썬, 자바스크립트, 그루비, Erlang, 스칼라, ML, 해스켈(Haskell), 리스프, Io, 펄 등 다양한 언어를 이용해 다양한 방법으로 프로그램을 작성할 수 있을 것입니다.
  • 의도적으로 디자인 패턴을 마음껏 사용해 보는 것은 어떨까요?
  • 루비 등의 오리 타입(Ducking Type)을 한번 써보세요. 타입으로서 인터페이스는 과연 어떤 의미를 지니고 있는 것일까요?
  • 함수형 언어를 이용해 작성하면 프로그램이 어떤 모습이 될까요?
  • 자바스크립트로는 어떻게 프로그램을 구조화할 수 있을까요, 클래스 상속을 사용할까요, 프로토타입 기반 상속을 사용해 볼까요?

제가 자바로 작성해 본 간단한 예제가 있습니다. 어떤 언어, 어떤 방법도 좋습니다. 다양한 언어의 상상력에 여러분의 상상력을 더해 주세요.

마지막으로 여러분이 작성한 코드를 공유해 주세요. 블로그에 작성한 코드를 정리한 후, http://innolab.tistory.com/1173513751에 댓글이나 트랙백을 남겨주시거나 이메일(dwkorea@kr.ibm.com)로 보내주시면 됩니다. 창의적인 코드를 보내주신 분에게는 일정 기간에 한 번씩 선물도 드릴 예정입니다.



 
 



   
   
     
   
Listing 1. Shape.java
package codekata;

public interface Shape {
	public void draw();
	public void moveTo(int x, int y);
	public void moveBy(int dx, int dy);
}
 

Listing 2. AbstractShape.java
package codekata;

public abstract class AbstractShape implements Shape{
	protected int x;
	protected int y;
	
	public void moveTo(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	public void moveBy(int dx, int dy){
		this.x += dx;
		this.y += dy;
	}
	
	public String toString(){
		return "[X : " + x + " Y : " + y + "]";
	}
}
 

Listing 3. Rectangle.java
Package codekata;

public class Rectangle extends AbstractShape{
	private int width;
	private int height;

	public Rectangle(int x, int y, int width, int height){
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}
	
	@Override
	public void draw() {
		System.out.println("Drawing Rectangle - " + this.toString());
	}
	
	public String toString(){
		return super.toString() + " [Width : " + this.width + ", Height : " + this.height + "]";
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}
}
 

Listing 4. Circle.java
Package codekata;

public class Circle extends AbstractShape{
	private int radius;
	
	public Circle(int x, int y, int radius){
		this.x = x;
		this.y = y;
		this.radius = radius;
	}

	@Override
	public void draw() {
		System.out.println("Drawing Circle - " + this.toString());
	}
	
	public String toString(){
		return super.toString() + " [Radius - " + this.radius + "]";
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}
}
 

Listing 5. Test.java
Package codekata;

public class Test {
	private static void doPolymorphicOp(Shape shape){
		shape.draw();
		shape.moveBy(10, 20);
		shape.draw();
		shape.moveTo(100, 130);
		shape.draw();
	}
	
	public static void main(String[] args) {
		Shape[] shapes = new Shape[]{new Rectangle(0, 0, 10, 15), new Circle(10, 10, 5)};
		
		for (Shape shape : shapes) {
			doPolymorphicOp(shape);
		}
	}
}
 

+ Recent posts