LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2015, 10:12 PM   #1
Mallem kondaiah
LQ Newbie
 
Registered: Apr 2013
Location: bangalore
Posts: 6

Rep: Reputation: Disabled
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)
 
Old 02-26-2015, 10:24 PM   #2
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,879

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
Quote:
Originally Posted by Mallem kondaiah View Post
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
 
Old 02-27-2015, 12:52 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275
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).
 
Old 02-27-2015, 02:29 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@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 ?
 
Old 02-27-2015, 03:02 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Neither possible nor legal.
 
Old 02-27-2015, 03:14 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
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.
 
Old 02-27-2015, 07:33 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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."

Last edited by sundialsvcs; 02-27-2015 at 07:37 AM.
 
Old 02-27-2015, 09:39 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by veerain View Post
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.
 
Old 03-03-2015, 03:52 AM   #9
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by TB0ne View Post
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.
 
Old 03-03-2015, 08:44 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by veerain View Post
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???
 
Old 03-03-2015, 02:26 PM   #11
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597

Rep: Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080
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
 
1 members found this post helpful.
Old 03-04-2015, 06:19 AM   #12
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by jeremy View Post
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.
 
Old 03-04-2015, 08:36 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by veerain View Post
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.
 
Old 03-04-2015, 10:42 AM   #14
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,450

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want Linux source code for FAT file system in user readable form not in binary for anandyadav Linux - Newbie 1 04-22-2014 03:30 AM
Convert binary file in to ascii file using shell script scream Linux - Newbie 5 05-24-2011 07:59 PM
"convert source code into bin file" kandhakumar Linux - Software 2 05-26-2009 03:15 PM
I want Linux source code for FAT file system in user readable form not in binary form ramya272 Linux - Newbie 5 02-05-2004 07:54 PM
How would one convert a file into binary? MasterC General 8 01-21-2003 10:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration