PDA

Click to See Complete Forum and Search --> : can javap not reveal the whole program


vb_student
Oct 28th, 2006, 12:54 PM
Hello
I have started coming to grips with java, and came across javap.

I was wondering if javap does not reveal all the code written by the coder. and just anyone can using the byte code plagiarise the source code. or is there something that prevents plagiarism from happening?

CornedBee
Oct 28th, 2006, 02:31 PM
javap disassembles, it doesn't decompile. You get the equivalent of machine code assembly, except that IMO JVM assembly is even more unreadable.

There are also decompilers for Java, but they never restore the exact source code. That is impossible, as there is an n:m mapping from source code to assembly.

There are some limited ways of scrambling .class files to make decompilation harder, but it cannot be prevented completely. But then, the same applies to machine executables.

vb_student
Oct 29th, 2006, 06:19 AM
thanks for the reply

so javap produces assembler not java code, correct?

CornedBee
Oct 29th, 2006, 10:44 AM
Yes.

mebhas
Nov 7th, 2006, 12:01 AM
i came across a prog called dj java decompiler. it is a demo software copy that i have but then even as a demo it works like a charm on class files. i made some java class files(my own code) and tested the software in it and lo-behold, even the variable names are the same. so maybe java class are not so difficult to disassemble as people think.

CornedBee
Nov 7th, 2006, 06:08 AM
Did you compile your Java files with or without debug info? How complicated was the code?