Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 19 of 19

Thread: class files inside exe : can i edit them ?

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default class files inside exe : can i edit them ?

    Sup java masters , ive got a question for ya. Ive got an .exe => I open it and find inside some libraries and .class files .
    Can I edit some of those .class files and replace the old ones or maybe pack the .exe again ?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    Maybe, but it won't be easy. class files are output by the javac compiler. A class file's format is documented so you can probably take it apart and build a new one with a lot of careful programming. It would be easier to work with the source file that created the class file.

    I don't know anything about opening an exe file, removing its contents and packing it again.
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    n_byte (October 25th, 2013)

  4. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by Norm View Post
    Maybe, but it won't be easy. class files are output by the javac compiler. A class file's format is documented so you can probably take it apart and build a new one with a lot of careful programming. It would be easier to work with the source file that created the class file.

    I don't know anything about opening an exe file, removing its contents and packing it again.
    Editing .class file is pretty easy and compiling back as .class. THe problem is how to replace/repack again ?

    Is any way to create a new .exe or replace with the new .class files ? Anybody pls ?

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    Java does not create exe files. This doesn't seem like a java programming problem.
    Have you tried asking about this on a forum for exe files?
    If you don't understand my answer, don't ignore it, ask a question.

  6. The Following User Says Thank You to Norm For This Useful Post:

    n_byte (October 25th, 2013)

  7. #5
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by Norm View Post
    Java does not create exe files. This doesn't seem like a java programming problem.
    Have you tried asking about this on a forum for exe files?
    The class files are written in java, im pretty sure.
    And the app graphics (GUI is called i think) is created with Java Scene.
    I dont know how he packed that .exe

    What forum for exe files btw ?

  8. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    Do you have access to a Search Engine?
    If you don't understand my answer, don't ignore it, ask a question.

  9. The Following User Says Thank You to Norm For This Useful Post:

    n_byte (October 25th, 2013)

  10. #7
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by Norm View Post
    Do you have access to a Search Engine?
    I thought u can recommend me that kind of website

  11. #8
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,845
    My Mood
    Mellow
    Thanks
    239
    Thanked 721 Times in 707 Posts

    Default Re: class files inside exe : can i edit them ?

    Note the name of this web site. Web sites do exist that will help you find other web sites. One of them starts with "Google."

  12. #9
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,343
    Thanks
    182
    Thanked 831 Times in 774 Posts
    Blog Entries
    5

    Default Re: class files inside exe : can i edit them ?

    I would also recommend thoroughly reading the license of the 'exe' you with to alter - in most cases software licenses prohibit reverse engineering, which is exactly what you seem to be trying to do.

  13. #10
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by copeg View Post
    I would also recommend thoroughly reading the license of the 'exe' you with to alter - in most cases software licenses prohibit reverse engineering, which is exactly what you seem to be trying to do.
    Nope, cuz it's my own program.

    I've read this Using JAR Files: The Basics (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files) : How can i ipen the Java archive tool ? Where is it ?

  14. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    The jar program is in the JDK's bin folder.
    If you don't understand my answer, don't ignore it, ask a question.

  15. The Following User Says Thank You to Norm For This Useful Post:

    n_byte (October 25th, 2013)

  16. #12
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by Norm View Post
    The jar program is in the JDK's bin folder.
    Ok, I did it using the cmd.

    One last question: how can I edit a .class file (and save it as .class) ?

  17. #13
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    how can I edit a .class file
    In post#2
    A class file's format is documented so you can probably take it apart and build a new one with a lot of careful programming.
    There might be some programs out there that do that. I've never seen one.
    If you don't understand my answer, don't ignore it, ask a question.

  18. #14
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Quote Originally Posted by Norm View Post
    In post#2

    There might be some programs out there that do that. I've never seen one.
    I've managed to open a .class file and it's written in normal java lang, but I'm editing it as .java. How can I compile this edited file to .class ?

  19. #15
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    See the javac program for compiling java programs.
    If you don't understand my answer, don't ignore it, ask a question.

  20. #16
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    Ive got a problem with the jdk exe's (javac, jar tools etc) If i double click them , they open and close immedeatly. WHY ?

  21. #17
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    They are mostly commandline programs. No GUI.

    How many months have you used a computer?
    If you don't understand my answer, don't ignore it, ask a question.

  22. #18
    Junior Member
    Join Date
    Oct 2013
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: class files inside exe : can i edit them ?

    I can use those .exe by opening cmd and typing name.exe
    Is this the only way ?

  23. #19
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,225
    Thanks
    52
    Thanked 2,296 Times in 2,267 Posts

    Default Re: class files inside exe : can i edit them ?

    Or use a batch file.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] files size for files inside the JAR file
    By Natherul in forum Java Theory & Questions
    Replies: 3
    Last Post: February 9th, 2012, 02:17 PM
  2. How to create or edit .ser files in Jar files
    By xbill in forum Java IDEs
    Replies: 1
    Last Post: May 18th, 2011, 05:15 AM
  3. Seraching through files in a folder for a pattern match inside the files.
    By dazzabiggs in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 2nd, 2011, 08:35 AM
  4. How to edit .class files in Eclipse
    By xbill in forum Java IDEs
    Replies: 2
    Last Post: April 22nd, 2011, 02:31 PM
  5. exe files
    By subhvi in forum Java Theory & Questions
    Replies: 17
    Last Post: September 3rd, 2009, 09:43 AM