IT정리노트

블로그 이미지

Edward. K

메멘토적 기억능력을 소유한 개발자 노트.

'Programming/JAVA'에 해당되는 글 76건

제목 날짜
  • Use Decompiler 2008.06.20
  • Eclipse On JAD ( Java Decompiler )1 2008.06.20
  • Eclipse-SWT Setting 2008.06.19
  • indexOf 와 subString 를 이용한 '구분자로 처리된 문자열 자르기' 예 2008.05.02
  • [Exception] Unable to recognize OLE stream1 2008.04.21

Use Decompiler

Programming/JAVA 2008. 6. 20. 09:36
반응형
걍.. 일반적인 시용법

1. Jad 다운로드
    : http://www.kpdus.com/jad.html

2. class 파일을 jad.exe root 폴더로 이동, Decompile 
사용자 삽입 이미지
     ※ 이동안하고.. jad c:\pjeroot\aaa\bbb\*.class  로 하시던가..

3. [고급] Package Decompile
    :모든 class들을 디컴파일 하고자 할때..( 나처럼..하나의 java파일도 존재하지 않을 경우..아하하하하 --; )
사용자 삽입 이미지

                                                             - jad ReadMe.txt 에 있는 내용
Jad accepts the following options:

   -a       - annotate the output with JVM bytecodes (default: off)
   -af      - same as -a, but output fully qualified names when annotating
   -clear   - clear all prefixes, including the default ones (can be abbreviated as -cl)
   -b       - output redundant braces (e.g., if(a) { b(); }, default: off)
   -d <dir> - directory for output files (will be created when necessary)
   -dead    - try to decompile dead parts of code (if any) (default: off)
   -disass  - disassemble method bytecodes (no JAVA source generated)
   -f       - output fully qualified names for classes/fields/methods (default: off)
   -ff      - output class fields before methods (default: after methods)
   -i       - output default initializers for all non-final fields
   -l<num>  - split strings into pieces of maximum <num> chars (default: off)
   -lnc     - annotate the output with line numbers (default: off)
   -lradix<num> - display long integers using the specified radix (8, 10 or 16)
   -nl      - split strings on newline character (default: off)
   -nocast  - don't generate auxiliary casts
   -nocode  - don't generate the source code for methods
   -noconv  - don't convert Java identifiers (default: convert)
   -noctor  - suppress the empty constructors
   -nodos   - do not check for class files written in DOS mode (CR before NL, default: check)
   -nofd    - don't disambiguate fields with the same names by adding signatures to their names (default: do)
   -noinner - turn off the support of inner classes (default: on)
   -nolvt   - ignore Local Variable Table information
   -nonlb   - don't output a newline before opening brace (default: do)
   -o       - overwrite output files without confirmation (default: off)
   -p       - send decompiled code to STDOUT (e.g., for piping)
   -pi<num> - pack imports into one line after <num> imports (default: 3)
   -pv<num> - pack fields with identical types into one line (default: off)
   -pa <pfx>- prefix for all packages in generated source files
   -pc <pfx>- prefix for classes with numerical names (default: _cls)
   -pf <pfx>- prefix for fields with numerical names (default: _fld)
   -pe <pfx>- prefix for unused exception names (default: _ex)
   -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)
   -r       - restore package directory structrure
   -radix<num> - display integers using the specified radix (8, 10 or 16)
   -s <ext> - output file extension (by default '.jad')
   -safe    - generate additional casts to disambiguate methods/fields (default: off)
   -space   - output space between keyword (if/for/while/etc) and expression (default: off)
   -stat    - display the total number of processed classes/methods/fields
   -t       - use tabs instead of spaces for indentation
   -t<num>  - use <num> spaces for indentation (default: 4)
   -v       - display method names being decompiled
   -8       - convert UNICODE strings into 8-bit strings
              using the current ANSI code page (Win32 only)
   -&       - redirect STDERR to STDOUT (Win32 only)

All single-word options have three formats:

  -o    - 'reverses' value of an option
  -o+   - set value to 'true' or 'on'
  -o-   - set value to 'false' or 'off'

You can specify the options you want to be set by default in the environment variable
JAD_OPTIONS. For example:

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



-  Editplus 에서 확인하기..( jad 파일명 java 구문강조 문구로..)

사용자 삽입 이미지

반응형
Posted by Edward. K

Eclipse On JAD ( Java Decompiler )

Programming/JAVA 2008. 6. 20. 08:56
반응형
Java Decompiler ... 
코드 보안 측면에서 봐선 있으면 안되는 넘인데.(물론 Obfuscatr 가 있으니..다행이다만..)
한편으로는 원 소스를 잃어버렸거나.. 혹은 API를 분석하는데 큰 도움이 되는 녀석이다.

지금은 원소스가 없는 쪽이다...헐..인수인계도 없고..-_-;
내 개발자 인생인 왜 이리 재미있는 게냐..앙?

뭐..여튼..재미있는 인생 자랑은 그만하고..
Eclipse Plugin을 이용해 Java Decompiler를 사용해 보자.
invalid-file
[통합 파일 - 2008-07기준-]


7.1 JAD 설정시
         Default로 해도 된다..   <- 3.3 에서의 기본 사항인듯함..확인 필요.

★. jre 혹은 확장 jar 내의  class 들이 decompiler 가안되는 경우가 있는데..
     무슨 원인인지는 모르겠으나...-_-
     이전 파일도 함께 설치해 주면 잘 된다.
jadclipse_3.2.0.jar 54 KB JadClipse for Eclipse 3.2M3 and M4
jadclipse_3.1.0.jar 54 KB JadClipse for Eclipse 3.1 (including milestone builds starting from 3.1M6 up to 3.2M2)




Eclipse On JAD ( Java Decompiler )   - Eclipse 3.3 기준-

1. Eclipse Download
      [다운로드] eclipse-SDK-3.3.2-win32.zip

2. JAD  Download ( jadnt158.zip-Jad.exe- )
    : http://www.kpdus.com/jad.html
       >Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform  (238600 bytes).  페이지 중간정도에 있다

3. Eclipse Plugin Download  ( net.sf.jadclipse_3.3.0.jar )
    : http://jadclipse.sourceforge.net/wiki/index.php/Main_Page#Download
        JadClipse 3.3
        This release stream is appropriate for Eclipse 3.3.
Filename Size Description
net.sf.jadclipse_3.3.0.jar 45 KB JadClipse for Eclipse >= 3.3M6


4. Eclipse  설치

5. Eclipse Jad Plugin(net.sf.jadclipse_3.3.0.jar) 을 Eclipse/plugins 폴더에 저장.
사용자 삽입 이미지

6. Jad (Jad.exe) 파일을 적당한 위치에 저장.
사용자 삽입 이미지

7. 이클립스 실행
    7.1 JAD 설정
        Window > Preferences... > Java > JadClipse
            |_ Path to Decompiler  : C:\_utils\jad.exe
            |_ directory for temporary files : C:\_decompiler     > 역컴파일 폴더
            |_  Reuse code buffer  : 역컴파일된 코드를 Buffer에 기록하도록
사용자 삽입 이미지

    7.2 설정 확인
        Window > Preferences... > General > Editors > File Associations
            : "*.class"의 설정값이 "JadClipse Class File Viewer"로 설정되었는지 확인.
사용자 삽입 이미지



    ※. 한글이 깨지는 경우
            : Window > Preferences... > Java > JadClipse > Misc
                |_ Convert Unicode strings into ANSI strings 체크
사용자 삽입 이미지


8. 사용.



반응형
Posted by Edward. K

Eclipse-SWT Setting

Programming/JAVA 2008. 6. 19. 16:00
반응형
새로운 Eclipse 버젼인..Ganymede가 나왔길래..
걍... 설치하고 나서..걍....SWT를 세팅해 봤다.-_-;


[ How to Eclipse-SWT Setting ]


    0. Eclipse    Ganymede 설치함..
        : http://www.eclipse.org/ganymede/
          http://www.eclipse.org/downloads/packages/
          >      Eclipse Classic 3.4RC4 (152 MB)


    1. SWT  Download
        : http://archive.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/index.php#swt    
            |_ SWT binary and Source
                : http://archive.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/index.php#SWT
                    [swt-3.3-win32-win32-x86.zip]

    2. Setting SWT
        : File > Import > General > Exiistiong Projects into Workspace
            - select root directory :     프로젝트workspace
            - select archive file :     다운받은 파일

    3. Create Project
        1. New > Java Project > HelloWorldSWT
        2. properties 설정   
            : 생성된 프로젝트  > properties    > Java Build Path > Projects > Add : org.eclipse.swt
        3. Class   생성
            : 생성된 프로젝트 > New > Class >  public static voie main(STring[] args) 선택. 생성.

                    import org.eclipse.swt.widgets.Display;
                    import org.eclipse.swt.widgets.Shell;

                    public class HelloWorldSWT {
                        /**
                         * @param args
                         */
                        public static void main(String[] args) {
                            // TODO Auto-generated method stub
                            Display display = new Display();
                            Shell shell = new Shell(display);
                            shell.setText("Hello world!");
                            shell.open();
                            while (!shell.isDisposed()) {
                            if (!display.readAndDispatch()) display.sleep();
                            }
                            display.dispose();                        
                        }
                    }

    4. Run appliction
         : 생성한 class package 에서 오른쪽 마루스 선택 > Run As > Java Application  실행, swt창 생성 확인.

        
반응형
Posted by Edward. K

indexOf 와 subString 를 이용한 '구분자로 처리된 문자열 자르기' 예

Programming/JAVA 2008. 5. 2. 11:38
반응형

'구분자로 처리된 문자열 자르기'  제목 길다..ㅎㅎ

구분자로 처리된 문자열 중에서 원하는 내용만을 화면에 뿌려 달라는 요구 사항이 있었다.
간단한 넘인데.. indexOf 와subString 함수를 학습하는데 도움이 될 것이다.

___________________________

String  resourceStr = "대한민국|인천|도화2동|김성호|"

resourceStr  = getNameCut( resourceStr );

  public String getNameCut(String Name)
  {   
         String realName = Name;

             int  firstDiv = realName.indexOf("|");       // '대한민국'을 제어할 경우
             //int  firstDiv = realName.lastIndexOf("|");      // '김성호'만 남기고 제거
             int nameLen = realName.length();

             realName = realName.substring(firstDiv+1,nameLen);        

         return realName;
   }


반응형
Posted by Edward. K

[Exception] Unable to recognize OLE stream

Programming/JAVA 2008. 4. 21. 09:50
반응형
근데..이거 뭐가 문제 여서 찾아보고 해결한거였지? -_-;


jxl.read.biff.BiffException: Unable to recognize OLE stream  
2005. 12. 1 ?? 2:28

Click to email this message

 
hi,
I am trying to dynami ally generate Excel sheet using Java code.
Wht I did was I generated the numbers in NOTEPAD and rename it with .xls.
Now when I am trying to read the .xls file using JExcelApi..
I am getting the following error
jxl.read.biff.BiffException: Unable to recognize OLE stream

Can any one tell me what should I do..to over come it.....
If I have to read the filr from Notepad it self.
Vijay
 
TheTincho
Posts:6
Registered: 6/13/06
Re: jxl.read.biff.BiffException: Unable to recognize OLE stream  
2006. 6. 13 ?? 6:11 (reply 1 of 1)

Click to email this message

 
the file that you create isn't in excel format, you can generate the numbers in notepad, separated by comas (,) and save the file as comma separated values (.csv) and open this file with excel and save as theNameWhatYouWant.xls (select the format in de combo box)



음... 엑셀 문서 관련한 에러 였었구나아..-_-;

Amrish_Nagar
Posts:21
Registered: 1/9/08
Re: jxl.read.biff.BiffException: Unable to recognize OLE stream   
2008. 6. 12 ?? 3:23 (reply 2 of 3)  (In reply to #1 )

Click to email this message

 
Hi ,,
I am also getting the same error message ..
What i have done is i have read a xls file from the browser and write it to a specific location and then trying to read it by
Workbook but it is giving me this error............The below is the part of my code
ServletInputStream in = request.getInputStream();
 
  byte[] line = new byte[512];
  int i = in.readLine(line, 0, 512);
  int boundaryLength = i - 2;
  String boundary = new String(line, 0, boundaryLength); 
    while (i != -1) {
    String newLine = new String(line, 0, i);
    if (newLine.startsWith("Content-Disposition: form-data; name=\"")) {
     
   
 
//Some more lines
      //this is the file content
      i = in.readLine(line, 0, 512);
      i = in.readLine(line, 0, 512);
    
      
      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      newLine = new String(line, 0, i);
      while (i != -1 && !newLine.startsWith(boundary)) {
               buffer.write(line, 0, i);
        i = in.readLine(line, 0, 512);
        newLine = new String(line, 0, i);
      }
      
        // save the uploaded file
        RandomAccessFile f = new RandomAccessFile(savePath + filename, "rw");
        byte[] bytes = buffer.toByteArray();
        f.write(bytes, 0, bytes.length - 2);
        f.close();
      
      }
      }
    i = in.readLine(line, 0, 512);
 
  } // end while
Uploadfilepath = savePath + filename;
WorkbookSettings ws = new WorkbookSettings();
Workbook workbook = Workbook.getWorkbook(new java.io.File(savePath+"\\" + filename),ws);//Here the error is
 
WorldOfJava
Posts:81
Registered: 7/13/06
Re: jxl.read.biff.BiffException: Unable to recognize OLE stream   
2008. 9. 23 ?? 4:18 (reply 3 of 3)  (In reply to #2 )

Click to email this message

 
only way is u need to store the data as xls
using jxl api
use writable workspace

if u have any problem

i will help u

반응형
Posted by Edward. K
이전페이지 다음페이지
블로그 이미지

메멘토적 기억능력을 소유한 개발자 노트.

by Edward. K

공지사항

    최근...

  • 포스트
  • 댓글
  • 트랙백
  • 더 보기

태그

  • Eclipse
  • Flash Player
  • 이미지 편집
  • egov
  • 미네르바
  • eclipse plugin
  • EkNote
  • toad
  • flex
  • 이클립스
  • 컴퓨터 관리
  • EditPlus
  • Graphic
  • 전자정부프레임워크
  • Jboss
  • ERwin
  • 캡쳐툴
  • 가상화폐무료
  • 중독성게임
  • 플래시 게임
  • tomcat
  • android
  • sqlgate
  • rocketdock
  • 개한민국
  • 색상코드표
  • STS
  • netbeans
  • 사업 이야기
  • iBATIS

글 보관함

«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

링크

카테고리

분류 전체보기 (792)
행운이와함께 (1)
EkNote Project (18)
ARIS (0)
Android (2)
LINK (39)
UML (9)
Programming (154)
Cobol (0)
ASP (0)
CSS (5)
C_C++ (2)
IBatis (2)
JSP (3)
JAVA (76)
JavaScript (44)
PHP (2)
Utility (76)
Protable (3)
MobileProgram (4)
SKT (0)
KTF (0)
LGT (0)
자료들 (4)
DB (82)
mongoDB (0)
MySQL (8)
Oracle (61)
MSSQL (4)
Graphic (8)
Flash (3)
PhotoShop (3)
SourceFactory (4)
Collection (73)
작가의기막힌상상력 (14)
미소를찾아보는공간 (44)
내심장은작동중일까 (6)
멀더와스컬리의노트 (3)
이건어디에사용할까 (6)
Edward (275)
나만 알기엔 아까워 (100)
기억하기 위한 기록 (123)
시선이 머무는 공간 (50)
숨기고 싶은 이야기 (2)

카운터

Total
Today
Yesterday
방명록 : 관리자 : 글쓰기
Edward. K's Blog is powered by daumkakao
Skin info material T Mark3 by 뭐하라
favicon

IT정리노트

메멘토적 기억능력을 소유한 개발자 노트.

  • 태그
  • 링크 추가
  • 방명록

관리자 메뉴

  • 관리자 모드
  • 글쓰기
  • 분류 전체보기 (792)
    • 행운이와함께 (1)
    • EkNote Project (18)
    • ARIS (0)
    • Android (2)
    • LINK (39)
    • UML (9)
    • Programming (154)
      • Cobol (0)
      • ASP (0)
      • CSS (5)
      • C_C++ (2)
      • IBatis (2)
      • JSP (3)
      • JAVA (76)
      • JavaScript (44)
      • PHP (2)
    • Utility (76)
      • Protable (3)
    • MobileProgram (4)
      • SKT (0)
      • KTF (0)
      • LGT (0)
      • 자료들 (4)
    • DB (82)
      • mongoDB (0)
      • MySQL (8)
      • Oracle (61)
      • MSSQL (4)
    • Graphic (8)
      • Flash (3)
      • PhotoShop (3)
    • SourceFactory (4)
    • Collection (73)
      • 작가의기막힌상상력 (14)
      • 미소를찾아보는공간 (44)
      • 내심장은작동중일까 (6)
      • 멀더와스컬리의노트 (3)
      • 이건어디에사용할까 (6)
    • Edward (275)
      • 나만 알기엔 아까워 (100)
      • 기억하기 위한 기록 (123)
      • 시선이 머무는 공간 (50)
      • 숨기고 싶은 이야기 (2)

카테고리

PC화면 보기 티스토리 Daum

티스토리툴바