LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   reverse engineering (https://www.linuxquestions.org/questions/programming-9/reverse-engineering-41930/)

walterw 01-18-2003 11:16 AM

reverse engineering
 
Are there programs that let you produce source code from a compiled binary? If I wrote a program in java, c, or c++, is there a way to get the source code back?

I lost some of the source code for programs that I wrote and need to modify the programs.

NSKL 01-18-2003 11:38 AM

Well, the only thing i know about, from windows world, is a dissasmbler. It will give you machine, AKA Assembly, code from a compiled program, and you can hack it and modify it if you are a uber geek and know assembly.
I don't think there are any programs that can give you source code from a binary.
-NSKL

lackluster 01-18-2003 03:31 PM

even if they did it would be horrible. just think about it. you'd have variable names like a1 a2 b1 b2 ... they'd be horrible.

Bert 01-18-2003 04:15 PM

Not strictly true. Not for Java anyway.

Class files are in an intermediate form, which is why you need a virtual machine to read them. Try this:

strings AnyJavaFile.class

see the variable names are retained by the bytecode. There are many decompilers available for Java. Reverse engineering of code has never really been legal for commercial puposes (despite the DMCA - eugh!) but yeah sure, you can find out the source code at least for Java.

An easier way to find the source code for an Java applet on a website is to find the path to the class file and replace .class with .java - the original java file is usually kept right in the same directory as the class file. Free as in free beer! Hehe.

Bert


All times are GMT -5. The time now is 01:12 PM.