News for hackers. Stuff that matters.
Re:Impossible Java by 0x0 on Tuesday March 28, 2017 @11:32AM (#13977445)
Not if you are talking about compilable java code, because as the article explains, there are things you can express in byte code which you can simply not express in java source code.
Re:Impossible Java by barahilia on Tuesday March 28, 2017 @12:52PM (#13978259)
Indeed. The lower level language must be more expressive by the "definition". It is more difficult to write but allows fine grain control. This is the reason some optimization and obfuscation tricks are done in Assembler (native world, not Java). And hence disassembler simply can not re-translate it back.
Re:Impossible Java by unsoundInput on Tuesday March 28, 2017 @01:18PM (#13978502)
There are two valid ways for a disassembler mitigate this: a) decompile to a language in which the bytecode can be expressed (in a concise / expresive manner, Java would always be a "possible" target because of turing completeness) or b) accommodate for the fact that there could be signature collisions in java, e.g. by prefixing/suffixing the method name
Re:Impossible Java by 0x0 on Tuesday March 28, 2017 @02:38PM (#13979352)
If you change the method name you end up with code that acts differently, just imagine something that does something like this pseudocode:

if (!new Exception().getStackTrace().getSha1sum().startsWith("0000")) alert("hello decompiler")

Your comment about java and turing completeness doesn't make sense unless you want the decompiler to basically output a java implementation of a JVM?

Re:Impossible Java by jevinskie on Tuesday March 28, 2017 @01:18PM (#13978499)
Dare [0] emulates the Dalvik VM's runtime behavior to generate verifiable (for the vast majority of cases) Java bytecode from dex bytecode.

[0]: http://siis.cse.psu.edu/dare/