Results 1 to 5 of 5

Thread: Source Code and Machine Code

  1. #1

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Wink Source Code and Machine Code

    Hi all,

    Using a compiler we can translate source code in to machine code. As an example in Java we can translate source code in to machine code using compiler called javac.

    Is there any way to translate machine code into source code?
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Source Code and Machine Code

    It depends on the language and the compiler. For VB6 it is not possible, and for others it is dubious at best.

    See the article about it in our Classic VB FAQ (link in my signature) for a fuller explanation.

  3. #3

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Source Code and Machine Code

    Thanks si_the_geek.

    Do you know any such compiler for Java.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Source Code and Machine Code

    They're called decompilers. Since during compilation, quite a bit of information is lost, and since source->bytecode is not a 1:1 mapping, they can only ever guess at what the original code was.

    With this information, you could Google for it.

    Why didn't you post this in the Java forum, when it's apparently about Java?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Wink Re: Source Code and Machine Code

    Quote Originally Posted by CornedBee
    They're called decompilers. Since during compilation, quite a bit of information is lost, and since source->bytecode is not a 1:1 mapping, they can only ever guess at what the original code was.

    With this information, you could Google for it.

    Why didn't you post this in the Java forum, when it's apparently about Java?

    Ya, it's true. This should post in Java forum. I used that javac compiler here just as an example.

    Anyway thanks for your advice.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width