I made a decompilation tool for java5.0/6.0. Try it at will.

Source: Internet
Author: User

 

I made a decompilation tool for java5.0/6.0. Try it at will.

It is actually a shell. After modifying the version of the class file, call Jad to decompile the file.

The process of calling Jad is displayed to the foreground with sw_show to ensure that the same Java file already exists in the target file, such as the previous

It has been decompiled once. If it is not deleted, the Jad prompts overwriting. If the Jad process is not manually confirmed in the background, it will die in the process list.

It is best to clear the target folder before decompilation.

In addition, temporary folders are not automatically cleared because waitforsingleobject still produces a conflict when ShellExecute is called cyclically.

In addition, it is easier to manually right-click the tmp directory and delete the temporary directory after the program is run recursively.

When used, place jad5.exeand jad.exein the same directory or place jad.exe in the path environment variable. Select the folder where the class is located and the target

Folder to run.

Http://www.cnjbb.org/attachment/56/50307/65187/2333/release.rar

 

The following are the main recursive functions used. When the call is passed into the directory of the class file selected by the user, that is,

This-> srcdir.

In the function, this-> destdir is the target directory.

Void cjad5dlg: Process (cstring DIR ){

Win32_find_data FD;
Zeromemory (& FD, sizeof (win32_find_data ));
Handle hfile;
Hfile = findfirstfile (DIR + "// *", & FD );
Do {
If (strcmp (FD. cfilename, ".") & (strcmp (FD. cfilename, "..") & (FD. dwfileattributes & file_attribute_directory )){
// It is a directory but not "." and ".."
Process (DIR + "//" + FD. cfilename );
}
Else if (strcmp (FD. cfilename ,". ") & strcmp (FD. cfilename ,".. ") // not ". "and ".. ", can only be a file
{
Cstring srcfile = dir + "//" + FD. cfilename;
Cfile CF (srcfile, cfile: moderead );
If (Cf. getfilename (). Find (". Class")> 0) {// class file
Cstring Path = dir. mid (this-> srcdir. getlength ());
Cstring destpath = This-> destdir + path;
{// I like to put the operations that need to disappear instantly in {}.
Cfilefind CFF;
If (! CFF. findfile (destpath) shcreatedirectoryex (null, destpath, null); // mkdir-P
CFF. Close ();
}
Cstring tmpdir = This-> destdir + "// tmp" + path;
{
Cfilefind CFF;
If (! CFF. findfile (tmpdir) shcreatedirectoryex (null, tmpdir, null );
CFF. Close ();
}
Cfile CF1 (tmpdir + "//" + FD. cfilename, cfile: modecreate | cfile: modewrite | cfile: typebinary );
// Copy the class file to modify the version
Byte Buf [512];
Int x = Cf. Read (BUF, 512 );
If (x> 8 ){
Buf [7] = 46; // modify it to version 1.4
Cf1.write (BUF, X );
}
While (x = Cf. Read (BUF, 512 )){
Cf1.write (BUF, X );
}
Cf1.close ();
Cf. Close ();

ShellExecute (null, null, "jad.exe", "-S Java" + tmpdir + "//" + FD. cfilename, destpath, sw_show );
// Call Jad back-to-Compilation

}
Else Cf. Close ();
}
}
While (findnextfile (hfile, & FD ));
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.