Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2003
    Posts
    52

    Help editing a JAR file

    This is what I've been able to do so far with example.jar....

    1. extracted the jar
    2. found the file I needed to modify A.class
    3. I can edit the A.class file using DJ Java Decompiler

    How do I save it back to a *.class format? dj java decompiler will only let me save it as a .java, jad, and js.

    I need to be able to put the modified A.class file back into example.jar

    Thanks.

  2. #2
    Join Date
    Jun 2003
    Location
    Scotland
    Posts
    298
    if you save the file as A.java, and then complie the java code, then the class file will be created for you by the complier.

    hope this helps

    Liam

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    1,331
    Quote Originally Posted by snoopgst View Post
    This is what I've been able to do so far with example.jar....

    1. extracted the jar
    2. found the file I needed to modify A.class
    3. I can edit the A.class file using DJ Java Decompiler

    How do I save it back to a *.class format? dj java decompiler will only let me save it as a .java, jad, and js.

    I need to be able to put the modified A.class file back into example.jar

    Thanks.
    You need to use a Java compiler. The standard Java package will include javac that you can use to compile Java files with.
    .
    @jmedwards
    - find me on Twitter!
    Kayako help desk software - we help our customers help their customers

  4. #4
    Join Date
    Nov 2003
    Posts
    52
    I downloaded JDK and i'm getting errors when I try to compile.


    C:\Program Files\Java\jdk1.6.0_04\bin>javac A$9.java
    A$9.java:80: <identifier> expected
    int i = B.A.(B.A.f, A);

  5. #5
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Quick question: Do you have the author's permission to decompile and modify this program?
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  6. #6
    Join Date
    Nov 2003
    Posts
    52
    Quote Originally Posted by foobic View Post
    Quick question: Do you have the author's permission to decompile and modify this program?
    I would not be doing this if I could get support from the company. But it looks like they have gone out of business. They even canceled their domain so any emails get bounced back.

  7. #7
    Join Date
    Apr 2006
    Posts
    1,120
    Quote Originally Posted by snoopgst View Post
    int i = B.A.(B.A.f, A);
    That doesn't make any sense to me. What is it your trying to do?

  8. #8
    Join Date
    Aug 2002
    Location
    Superior, CO, USA
    Posts
    633
    Quote Originally Posted by snoopgst View Post
    I downloaded JDK and i'm getting errors when I try to compile.


    C:\Program Files\Java\jdk1.6.0_04\bin>javac A$9.java
    A$9.java:80: <identifier> expected
    int i = B.A.(B.A.f, A);
    Jad and general decompiling of Java code isn't perfect. Jad hasn't been updated in a while so, depending on the version of Java that the code has been compiled with, it may or may not work.

    Additionally, with method and variable names like this it looks like the code has also been run through some sort of obfuscation product too. That will make things much more difficult.

    You'll need to manually fix the incorrect code and then try to compile it.
    Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •