how to decompile .exe to java


by jaredmt
Tags: decompile, java
jaredmt
jaredmt is offline
#1
Jul3-08, 11:30 AM
P: 123
I have Jbuilder2007 and im wondering if there is a way i can decompile .exe files so i can read the code in java.
Phys.Org News Partner Science news on Phys.org
NASA's space station Robonaut finally getting legs
Free the seed: OSSI nurtures growing plants without patent barriers
Going nuts? Turkey looks to pistachios to heat new eco-city
Crosson
Crosson is offline
#2
Jul3-08, 01:03 PM
P: 1,294
What you need is a java decompiler, and there are some available:

http://members.fortunecity.com/neshkov/dj.html
chroot
chroot is offline
#3
Jul3-08, 01:18 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,424
Well, Java is not normally compiled to an .exe, it's usually compiled to a .class. The class files contain JVM bytecode and can be decompiled into Java source.

If you're trying to decompile a Java program that has been compiled all the way to an .exe (using JET, for example), you're out of luck.

- Warren

jaredmt
jaredmt is offline
#4
Jul3-08, 08:00 PM
P: 123

how to decompile .exe to java


ok, so basically there is no way to edit a .exe file? i thought maybe there was a way the code could be translated to java or pseudocode or something
CRGreathouse
CRGreathouse is offline
#5
Jul3-08, 11:07 PM
Sci Advisor
HW Helper
P: 3,680
Quote Quote by jaredmt View Post
ok, so basically there is no way to edit a .exe file? i thought maybe there was a way the code could be translated to java or pseudocode or something
To edit an exe file, you'd need to use a disassembler and know the assembly language.

There are various ways in which an exe can be moved into something higher than assembly, but they're usually either:
* Really hard to do, and not much easier to read than the assembly; or
* Total cheats, and exactly as hard to follow as the assembly.
dwahler
dwahler is offline
#6
Jul3-08, 11:07 PM
P: 12
You can use a disassembler to help you decode the machine-level instructions, but that's about it. AFAIK, there is currently no way to reliably and automatically reverse-engineer machine code to a high-level language; it's a much more complex problem than you might think.
CRGreathouse
CRGreathouse is offline
#7
Jul4-08, 01:07 AM
Sci Advisor
HW Helper
P: 3,680
Quote Quote by dwahler View Post
AFAIK, there is currently no way to reliably and automatically reverse-engineer machine code to a high-level language; it's a much more complex problem than you might think.
Yep. You can imagine storing the executable in an array, dereferencing, and jumping to that point -- any strong enough language (C/C++ not FORTRAN or Java, though C# could do it in unsafe mode) should be able to do that, but it's hardly understandable. Likewise, you could imagine turning a few commands into basic C commands and leaving the rest in asm blocks -- but that's no better either.

A sufficiently unstructured language could probably be a target for the disassembled code, but it would be nearly impossible to read -- all GOTOs and weird pointer math.


Register to reply

Related Discussions
java q Computing & Technology 3
new to java Programming & Computer Science 7
Java help Computing & Technology 15
Help in Java 3D Computing & Technology 0
Java Introductory Physics Homework 13