LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   binary files (https://www.linuxquestions.org/questions/linux-newbie-8/binary-files-753832/)

earlysame55 09-09-2009 06:40 AM

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

unSpawn 09-09-2009 07:00 AM

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?

earlysame55 09-09-2009 10:42 PM

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

chrism01 09-10-2009 12:22 AM

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.

earlysame55 09-14-2009 12:44 PM

Quote:

Originally Posted by chrism01 (Post 3676828)
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

salasi 09-14-2009 03:11 PM

Quote:

Originally Posted by earlysame55 (Post 3676761)
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...


All times are GMT -5. The time now is 10:40 PM.