decompiler for eclipse

2012. 11. 14. 16:36OpenSource/Spring

반응형

소스를 까볼려고했는데..xxx.class 파일이라서..보이지가 않는다..--;;
그래서 jad라는것이 떠올라 마켓이나 install and software를 통해 플러그인을 설치 하려고 했으나..
링크가 끊겨있었다...
그래서! 다른 방법으로 플러그인을 설치 할려고 한다.

[1] eclipse에 decompiler를 장착 해보자!ㅋ

아래의 페이지를 참고 하였다.
http://www.mkyong.com/java/java-decompiler-plugin-for-eclipse/

Java Decompiler Plugin For Eclipse IDE

1) 다운로드 제드

1)에서 jad.exe를 얻을 수가 있다. 이젠 이클립스 플러그인을 깔고 연동 시키면 된다.^-^good~

2) Download Jad Eclipse plugin
Download the Jad Eclipse plugin named “Jabclipse (net.sf.jadclipse_x.x.x.jar)
 
http://sourceforge.net/projects/jadclipse/ 

 
3) Copy it to Eclipse plugin folder
Copy the downloaded Jad Eclipse plugin – Jabclipse(jadclipse_x.x.x.jar) to Eclipse plugin folder.
For example,
  
D:\eclipse\plugins\net.sf.jadclipse_3.3.0.jar
 
P.S No need to extract it, just copy the whole jar file.

아래의 그림처럼 플러그인 디렉토리에 다운받은 이클립스 플러그인을 넣어준다.

 

4) Restart Eclipse 재시작^-^

Restart Eclipse to make the plugin take effect.


5) Configure Jadclipse in Eclipse

In Eclipse, Click Window –> Preference –> Java –> Jadclipse , Key in Jad’s path in “Path to Decompiler” field
경로를 잡아줄 때는 풀path로 아래처럼 해주거나 jad 라고 써놓고 환경변수에다가 경로를 잡아주고 하는 방법이 있다.
보통 jdk path가 환경변수에 잡혀있기 때문에 bin아래에 넣어두고 Path to decompiler에는 jad라고 적혀있는 그대로 두면 된다.^-^good~~


혹시나 에러가 난다면?!
아래와 같이 default 유무를 확인 해본다.
경로는 Window > Preferences > General > Editors > File Associations 이다^-^
*.class를 선택하고 확인 하면 된다.



6) Done
In Eclipse, try F3 into any class which does not has the source, Jad will decompile it automatically. 

F3이 보통 소스 따라 갈 때 보면 컨트롤+메소드 해서 가는 단축기이다.

가고자하는 메소드에 마우스로 찍어놓고 F3을 누르면 해당 class가 역컴파일되어 소스가 보여지게 된다.



7) 정말 중요한..jad 사용법!!!
     6번에서 처럼 F3을 이용한...decompile이 되어진다. 
      그것도 모르고..삽질을 올골차게 하였다..뉴뉴..
      왜냐면 테스트를 아래와 같이 하였을 때 오류가 났기 때문이다.
 


알아보니 위와 같이 하면 안된다고 한다...ㅜ_ㅜ ..
F3 or Ctrl+메소드 등으로 하면 된다..^-^b
 

위에처럼 했을 때 결과는..

/*jadclipse*/// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
 
// Jad home page: http://www.kpdus.com/jad.html
 
// Decompiler options: packimports(3) radix(10) lradix(10) 

위와 같은 주석이 달리면서 자바코드로 변환이 된다.^-^good~~~ 

- 끝 -
 

 
반응형