Re: Bash: How to extract an executable from within?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/14/2009 06:46 PM, Patrick O'Callaghan wrote:
> On Mon, 2009-09-14 at 17:48 -0700, Daniel B. Thurman wrote:
>   
>> outname=selfextractExe.$$
>>
>> function unWrapExe() {
>> cat <<'EOF'
>> <executable>
>> EOF
>> }
>>
>> # Do pre-shell stuff
>>
>> unWrapExe > $outname
>> ./outname
>>     
> A few comments on this (I realize it's only a sketch of the code):
>
> 1) Why declare a function if it has no argument? Just put the code
> inline.
> 2) You need to make the output file executable ("chmod ...")
> 3) The executable isn't ./outname, it's $outname
>
> poc
>   
Yeah, I messed up for sure but as you said,
I was conveying the idea.

Still - I wondered why cat/echo would not work
under such a scenario when there is ELF code
involved.  I attempted to look at 'printf' but
could not figure it out.

How would you do it, really?

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux