LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2009, 06:40 AM   #1
earlysame55
LQ Newbie
 
Registered: Feb 2008
Posts: 24

Rep: Reputation: 15
binary files


Dear all,

how can i view the code of a file which is of type:

ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

Is there anything better or which gives a comprehensive output than strings ?

cheers
 
Old 09-09-2009, 07:00 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
To get back something that vaguely represents code means trying to disassemble it. Depending on the license you may or may not be allowed to try to reverse engineer it. Is there a specific reason why you need to do this? Is the source code not readily available? Is it an unknown binary you found on your machine?
 
Old 09-09-2009, 10:42 PM   #3
earlysame55
LQ Newbie
 
Registered: Feb 2008
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks unSpawn,

Yes, this has been a script that a previous collegue has developed, now we need to do some changes in it. This script has been converted to a binary.

cheers
 
Old 09-10-2009, 12:22 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Ask him for the source code.

Do you know what lang the src is in?
In any case, reverse engineering back to human readable src is a non-trivial operation.
If you haven't got the src anywhere, it's prob quicker to re-write it.
 
Old 09-14-2009, 12:44 PM   #5
earlysame55
LQ Newbie
 
Registered: Feb 2008
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
Ask him for the source code.

Do you know what lang the src is in?
In any case, reverse engineering back to human readable src is a non-trivial operation.
If you haven't got the src anywhere, it's prob quicker to re-write it.
Nope, there is no way i could. Any tools that U folks know which i could use. It's a shell script that this guy has sealed in with some tool.

cheers folks
 
Old 09-14-2009, 03:11 PM   #6
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,061

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Quote:
Originally Posted by earlysame55 View Post
This script has been converted to a binary.
If you mean 'as a bash script', that would be an odd thing to do; maybe your colleague had a premonition and tried to protect things...

On the other hand, if you mean 'in a interpreted scripting language', there sometimes an option to compile to an intermediate form that is non-ascii, and that might be what you have got.

You could try looking at what you have got in a hex editor like Ghex and see if anything is apparent about the form of the code. You might find out something about the language there, for example.

In general though, don't underestimate the difficulty of working with it, given just the code (no comments, or anything that helps you to understand what is going on). It might be quite workable on something trivial, but then on something trivial, it could be trivial just to start again...
 
  


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
Binary Files ashraf786 Linux - Server 4 08-08-2007 07:49 AM
Binary Files? Teralon 9 Linux - General 2 02-10-2004 10:36 PM
Binary files sodaforce Linux - Software 1 09-07-2003 05:31 PM
Using binary files KDE4me Linux - Newbie 1 04-24-2003 08:00 AM
binary files walterw Programming 7 01-27-2003 08:27 AM


All times are GMT -5. The time now is 08:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration