LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   convert binary file to source code (https://www.linuxquestions.org/questions/programming-9/convert-binary-file-to-source-code-4175535241/)

Mallem kondaiah 02-26-2015 10:12 PM

convert binary file to source code
 
Hi,i have compiled binary file but i don't have source code for that binary.how can i get source code from binary file.if any one knows let me know(my main intention is i have a vxworks compiled binary but i don't have source code,how can i get source code)

danielbmartin 02-26-2015 10:24 PM

Quote:

Originally Posted by Mallem kondaiah (Post 5324058)
Hi,i have compiled binary file but i don't have source code for that binary.how can i get source code from binary file.if any one knows let me know(my main intention is i have a vxworks compiled binary but i don't have source code,how can i get source code)

Perhaps you seek a decompiler.
http://en.wikipedia.org/wiki/Decompiler
I have no idea if a decompiler exists for vxworks.

Daniel B. Martin

pan64 02-27-2015 12:52 AM

if it was an open source app you can find the source on the net and you can download it. But in some cases it is simply forbidden (to do that).

knudfl 02-27-2015 02:29 AM

@Mallem kondaiah.
Quote:

but i don't have source code for that binary
Which binary ? A file name, please. And what is it used for ?

Do you know the application name ?

NevemTeve 02-27-2015 03:02 AM

Neither possible nor legal.

veerain 02-27-2015 03:14 AM

It's possible using decompilers and also assembly source can be get by objdump.

There are few decompilers (to c language and assembly language) around. Use Wikipedia and web search to find them.

It's illegal in some place but legal in others and also depends on license terms of the binary.

Reverse Engineering is legal in many places.

sundialsvcs 02-27-2015 07:33 AM

The object-files produced by some language systems (e.g. Java) can sometimes be decompiled with marginal results, although, even then, the outcome is "worse than minify'd." All variable names and so-forth are gone.

If the compiler performed optimization, as most compilers do, there's no longer a 1:1 correspondence between the source-code tht went in, and the object-code that came out. The optimized code is functionally equivalent, but not identical.

Pragmatically, though, the answer to your question is: "no."

TB0ne 02-27-2015 09:39 AM

Quote:

Originally Posted by veerain (Post 5324129)
It's possible using decompilers and also assembly source can be get by objdump.

There are few decompilers (to c language and assembly language) around. Use Wikipedia and web search to find them.

Please don't just tell people to go look things up as an answer. If you're going to say this, provide examples.
Quote:

It's illegal in some place but legal in others and also depends on license terms of the binary. Reverse Engineering is legal in many places.
Sorry, wrong..it is NOT legal ANYPLACE to do this, unless you OWN THE RIGHTS TO THE SOURCE CODE TO START WITH. When you buy ANY software, the licence is for you to USE IT, as is...NOT to decompile it. Reverse engineering is permissible, only in the broadest sense; if you know you put in XXX and get out YZX, you can write your OWN code, using their software as a road map only. The only way this is 'legal' is if the software in question is open source to start with...and if it was, you wouldn't need to decompile it, would you??

OP, vxworks is NOT open source. If you want the source code for a valid reason, and you've purchased a license, you may (emphasis on MAY), be able to contact Wind River and ask them for it. They may require you to sign an NDA, and let you have the pieces you need. You may also be able to contact them and ask them to do a custom build for your company.

veerain 03-03-2015 03:52 AM

Quote:

Originally Posted by TB0ne (Post 5324279)
Sorry, wrong..it is NOT legal ANYPLACE to do this, unless you OWN THE RIGHTS TO THE SOURCE CODE TO START WITH.

Is Berne Copyright convention ( or any other copyright law) followed by all countries of the world?

It's time to improve your knowledge.

And what if that particular binary software does allows decompilation.

TB0ne 03-03-2015 08:44 AM

Quote:

Originally Posted by veerain (Post 5326061)
Is Berne Copyright convention ( or any other copyright law) followed by all countries of the world?

There is so much wrong with that one sentence that I'd have to spend a LONG time explaining it all, and I doubt you'd get it. To sum things up:
Whether a country accepts a 'copyright convention' is immaterial. That just means that COPYRIGHT violations may not be an offense that can be prosecuted. It DOES NOT make it 'legal', shield you from civil lawsuits, or protect you from theft of intellectual property. Not to mention the fact that if you violate the EULA of the software you're decompiling, you CAN be prosecuted for THAT, regardless of 'copyright conventions'.
Quote:

It's time to improve your knowledge.
And it's time for you to stop personal attacks, and time for you to stop posting things that are incorrect or misleading. Post reported to moderators.
Quote:

And what if that particular binary software does allows decompilation.
...which was addressed in the previous posts, wasn't it???

jeremy 03-03-2015 02:26 PM

A few comments (and reminders from the LQ rules):

* Personal attacks on others will not be tolerated.
* Do not post if you do not have anything constructive to say in the post.
* Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great.
* We understand there is a gray area with the legality of many things and that different jurisdictions have vastly different rules. We try to strike a balance between freedom of speech / the desire for knowledge with keeping LQ clear of any legal issues in our jurisdiction / not helping with actions that are clearly illegal or unethical. It's a difficult line to walk sometimes, which is why we assess each instance on an individual basis.

--jeremy

veerain 03-04-2015 06:19 AM

Quote:

Originally Posted by jeremy (Post 5326407)
A few comments (and reminders from the LQ rules):

* Personal attacks on others will not be tolerated.
* Do not post if you do not have anything constructive to say in the post.
* Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great.
* We understand there is a gray area with the legality of many things and that different jurisdictions have vastly different rules. We try to strike a balance between freedom of speech / the desire for knowledge with keeping LQ clear of any legal issues in our jurisdiction / helping with actions that are clearly illegal or unethical. It's a difficult line to walk sometimes, which is why we assess each instance on an individual basis.

--jeremy

Thanks for LQ rules issues.

In the start I felt TBone's post to my posts as making personal attacks on me. Though some were right. But I just ignored rest. It continued then I started commenting back. And he nows thinks I am making personal attacks on him. He uses some words which I feel are personal attacks.

TB0ne 03-04-2015 08:36 AM

Quote:

Originally Posted by veerain (Post 5326705)
Thanks for LQ rules issues.

In the start I felt TBone's post to my posts as making personal attacks on me. Though some were right. But I just ignored rest. It continued then I started commenting back. And he nows thinks I am making personal attacks on him. He uses some words which I feel are personal attacks.

I don't 'think' you are, I know it. Read the above statement that you made. If you feel like being corrected when you post something that's either blatantly wrong or misleading is a 'personal attack', then you should take the advice that unSpawn gave you, and do a bit more research before answering.

Guttorm 03-04-2015 10:42 AM

Back on topic: Decompiling and reverse engineering is not illegal by itself - anywhere, as far as I know.

http://en.wikipedia.org/wiki/Reverse_engineering

Lots of motivations there. "Creation of unlicensed/unapproved duplicates" - one of the many things. But how can decompiling be a copyright violation when you don't copy anything? It's the distribution that's illegal. However, you could be breaking some rule in some EULA, so someone could sue you. I'd maybe worry if I was in the USA.


All times are GMT -5. The time now is 11:09 PM.