Decompiling of class files

Why is it possible to reverse engineer or de-compile .class files. Is there an easy workaround for this problem that does not require buying expensive software to compile a java program into platform-specific form?

it is possible to decompile .class files because JRE has to be able to read and parse and understand your code... (i mean your bytecode that you have got from compiler)
if you want to protect your code from being decompyled and reused by your competitors, then you should odfuscate your code...
(examples of obfuscated C code my be found from http://www.ioccc.org unfortunatelly i don't know if there is such thing for obfuscated java code anywhere)
this doesn't make your code unusable for others, but makes it bit more difficult to reuse your code.
i personally see no reason why i should keep in ecret what my programs source looked like, but you may have your reasons... so i dodn't judge you...
well... i just rememberd that as a homeassignment i had at school to write some program... and i just had found one decompiler... so i looked up a program from internet that did exactly what i had to do and decompiled it....
i couldn't use it because it had used lot's of private variables that where named byte1, byte2, ... and so on... and in every method they these same names for different variables...
so the code was unusable for me, allthough it comiled with no errors
another way to make your code less usable for others is to write it in your own language 8if your native language is english then using it would not misslead others too much, but i have found some chinese code that had variable names something like "katakana" etc. and also some comments that were no use for me... (since i dond't understand chinese, not even if it's written with lattin letters)
also you might want to look from internet for articles that explain how to write unmaintainable code...
http://mindprod.com/unmain.html
but in such case you'd be out of luck when you have to debug the same code after some weeks... :P
i hope that you got some ideas of some things related to your question...
L.

Similar Messages

  • Junk values when decompiling the class file

    Hi All,
    When i decompiling the class file , i am getting junk values i.e <file>.class$java.lang.string and _mtclass$("java.lang.string").
    I am using JAD for decompilation .
    Can any body help.. how remove the junk data

    ya and better part being that its an issue with the tool used for decompilation. Nothing specific to OAF here. Any class file will behave in the same way to this tool.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                   

  • Can anyone help me decompile a class file?

    Can anyone pls help me decompile a class file? I've used DJ decompiler and Cavaj decompiler to decompile it but both can't seem to decompile it successfully. How do I attach the class file here? Thanks in advance!

    Oh! Now I get it. So sorry I didnt intend for anybody
    to do something illegal/unethical. I dont know much
    about Java programming since I am very new to this
    language. I didnt know anything about obfuscating
    codes either. The reason why I was trying to
    decompile the said class file is because I wanted to
    check whether the hack program I downloaded ...That is completely contradictory.
    By the way, can you tell me how I can learn Jave programming
    without the aid of a book since I couldnt find one
    yet.Given the eleventy bachillionty kathousand books that exist on java programming, something tells me you haven't looked too hard for one.
    The best non-hard-copy source:
    www.google.com

  • Preventing decompilation of class files

    Hi,
    I tried yesterday running a decompiler on my .class files, and was shocked to see the result - it was amazingly similar to the original code, and very easy to understand...
    Is there any tool or way to prevent using a decompiler on your .class files, or to make sure the results of running one are not clear? Otherwise it seems like you can just as well send out your original source files.
    Thank you,
    Nir.

    "Otherwise it seems like you can just as well send out your original source files."
    Which is something you might want to consider. I doubt you have coded something so extraordinary, that you should have to protect it?

  • How to decompile a .class file into .java file using DEJDecompiler?

    Hi all,
    I am using DeJDecompiler and working with swing applications.If I try to convert a .class file into .java file,it is converting into .jad file only.Fine but if I try to save that file into .java file,It is giving lot of errors in that program.When I went into that program the total style of the program is changed and TRY-CATCH block is not recognised by the dejdecompiler,hence If I try to include some methods in the existing .java file thus got,I could not do.Kindly help me.
    If I get the .java file without error then I can process the rest of the functionality.
    Thanks in advance
    With kind Regs
    Satheesh.K

    Not so urgent today then!
    http://forum.java.sun.com/thread.jsp?thread=553576&forum=31&message=2709757
    I'm still not going to help you to steal someone�s code.

  • Decompile class file

    i wrote the program for my friends to use
    i dont want them to see the source code
    but people can download decompiler from the web...
    so they are joking that java programmer is the open source editor
    it is not good if we want to write a commercial software
    does anyone know what to do when distributing a jar file to others?
    (dont want people to decompile the class file)

    Please search the forums, this has been asked and answered many times.

  • Decompile Class files

    Hello,
    Has anyone decompiled the class files given by Oracle. I want to know if they worked fine. I would also like to know what decompiler you used. Mocha???
    I trying to convert PublicListsTableCO.class given by Oracle to PublicListsTableCO.java using Mocha.
    Thanks

    Hi,
    The Jad Decompiler is working fine.
    Adi

  • Decompiling class file

    Hi all,
    I have found an applet which I would like to modify, but the jar file contains only the class files, preventing me from making changes to the applet code. Is there any way I can make changes to the applet code? i.e. by decompiling the class files?
    I am using the code for non-commercial use, so there's no concern over copywrite.
    Thanks,
    David.

    > I am using the code for non-commercial use, so there's no concern over copywrite.
    So then have you contacted the author? Maybe they'd be happy to give you source. Or not.
    -slj-

  • Verifying .java and .class files match

    I have a bit of a strange situation in a team-working environment where many developers copy code to a production server. None of this code is in a Version Control System and I have been given the task of getting it into one (I've chosen Subversion, but that isnt important)
    The problem is, its not as simple as doing a full commit of the production server because developers may have copied edited .class files onto the server, but not copied edited .java (therefore the .java file is not the same as the .class file)
    Because the server has hundreds (if not thousands) or java and class files, I cant just decompile each of the class files and manually see if they match the java files, so I'm asking, is there a tool that can verify a java file matches a class file of the same name in terms of version (or if not is there an easier way of doing it than the decompile method)?
    Thanks in advance

    Years ago I had to do something very much like this...and now I'm trying to recall how we did it (and for that matter whether it worked)...and I'm having trouble recalling. Ah, that's what happens when you read forums out of insomnia.
    Of course, you can do a baseline check by just checking the file timestamps. Also instead of decompiling the class files you can try re-compiling the source code, and then generating checksums on both class files to see if they're the same.
    You might be able to use BCEL (http://jakarta.apache.org/bcel/) to extract some useful information out of the class files. As I recall I tried this but the data wasn't useful for this kind of project, but maybe I'm misremembering. It's worth looking into.

  • How to decomplie a java class file when java application is running/launch?

    I have a simple java application with some components being displayed, now i need to get the components instance names that are been created in that java application. How do i do that?
    Eg: Button b1 = new button();
    now how to write a java application to decompile this class file & return me the button instance ie "b1".

    I think you wanna do two different things:
    1. find out which objects were created at runtime.
    2. decompile class file.
    I'm no so sure why.
    have you tried insrospecting the class using reflection ?
    Here is a code snippet that prints class field names.
    try{
      Class c = Class.forName("MyClass");
      java.lang.reflect.Field[]  f=    c.getFields();
      for (int i = 0;i<f.length; i++)
           System.out.println(f.getName());
    catch(Exception e){ }
    Regards
    Joseph.

  • Where do these class files go?

    I downloaded a library of code that I'd like to use in my program. It came packaged as some .java files and some .class files. Many of the .class files don't have corresponding .java files. I assume this is because they did not want us to see the source code. Can I still use these class files? I put them in the bin folder of my project (I'm using eclipse) but the code still can't recognize the objects from that class.
    I found this: http://stackoverflow.com/questions/661110/how-do-i-include-class-files-in-my-project-in-eclipse-java
    and I think I did correctly what they said to do. I moved the files to a new folder called lib, and then added lib to the buildpath as a class folder, but Eclipse can't find it.
    Edited by: JFactor2004 on May 19, 2010 11:06 AM

    Need to be under the folder in the package (i.e. com.org.blah....)
    You can also decompile any class file to see what are in there
    use JAD ecplise plug-in or JD (for java >5)

  • How to decompile new class specification

    Hello:
    I tried to decompile some class files that I compiled with jdk1.6, however I got a problem, since it seems that class specification have changed. I tried jdec, jad, jode, cavaj, jreverse, jcavaj, and none of them has been updated to support the new specification (49 and/or 50), so I'd like to know if somebody of you know about any updated decompiler.
    Thanks

    To analyze Java Bytecode I have developed my own tool that is written in pure C++. It does not depend of JDK version and Java provider. This is not a decompiler but only a bytecode viewer, which can show Java Bytecode as a tree with with raw data.

  • Encode class files

    hi,
    i want to encode my class files so that my customer can not decompile the class files!
    please help me with this question. what oppportunities i have??
    thanks, christoph

    Google [ java obfuscation ]

  • Encrypting class files

    Does anyone know if its possible to encrypt your compiled class files?
    Purely for the reasons to stop people using tools to decompile your class files before they have paid for them etc..
    Cheers

    Yes. Just use any encryption program, like PGP.
    The problem is of course that the JVM won't be able to decrypt it, so that is kind of pointless. :)
    What you are looking for is not encryption, but obfuscation. Yes, there are programs out there that will change your bytecode in order to
    a) Make it harder for decompilers to decompile it
    and/or
    b) Make it harder for humans to understand what is going on if someone still manages to decompile the bytecode.
    Once upon a time I used a program called "SourceGuard" or something like that for this. I have later seen other programs mentioned in discussions about this, like "Zelix Klassmaster" http://www.zelix.com/klassmaster/
    None of these tools should be expected to be absolutely safe, but they will make it so much harder that most people probably won't care to do the decompilation.
    There is also a risk that the changes done with the bytecode will make the code unrunnable by some VMs.

  • Need help with a class file!

    How do you decompress or decompile a class file??? I just can't seem to get it...

    One program is called JAD...
    Also the jedit program has a plugin to decompile class files.
    http://www.jedit.org
    Uwe

Maybe you are looking for

  • PL/SQL log in java concurrent program is missing

    Hi, I'm experiencing something strange with EBS R12 concurrent program logs. Our concurrent program is just a normal program that runs fine in most cases. It is written in java, which calls PL/SQL procedures. Usually the log is concatenation of logs

  • How to handle password changes if we implement singlesignon between BO& BI7

    Hi, As we know ,we can implement single signon between BO and SAP BI 7, by importing roles and users through CMC and by selecting the option "Use Single signon during report refresh time". My doubt here is, When we import roles from SAP and Auto impo

  • Why is my mac syncing multiple version of the same song?

    I wonder if anyone could help with this: My sync takes so long sometimes and it often syncs 2 or 3 versions of the same song on loads of albums. I have to go through manually one by one and delete them off my phone, and sometimes i only stumble acros

  • Black screen in source monitor

    I am trying to synch a good audio file with my .mov. But when I do exactly what is described here Automatically synchronize audio and video files in Adobe Premiere Pro CC based on audio waves - YouTube I just get a black screen in the source monitor.

  • Table for existing PO/Sch.Agg pricing condition types

    Hi Experts, Which table will have PO / Sch.Aggrement  - pricing condition types with values as maintained in PO (like freight / P&F etc). I have the input of PO/Sch.Agg ref, plant, vendor & material. We have created Z condition types for freight/ P&F