Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re: Embedding an Executable file in Perl program

by peacemaker1820 (Pilgrim)
on Mar 26, 2003 at 18:13 UTC ( #246027=note: print w/replies, xml ) Need Help??

in reply to Re: Embedding an Executable file in Perl program
in thread Embedding an Executable file in Perl program

Thanks for the answer but I do not understand a couple of things.
What does the sub getexe() do, what are those wierd characters, what should I put in the getexe() because u specified  ##(more data here); ?


Replies are listed 'Best First'.
Re: Re: Re: Embedding an Executable file in Perl program
by meetraz (Hermit) on Mar 31, 2003 at 22:51 UTC
    Your original request asked how to "embed an executable file". The easiest way to do this is to convert your binary executable into a text-based string. One such way is to escape each byte using \xNN syntax. If your binary executable is 30k, you will have a string made up of 30,000 variations of "\xNN". The getexe() function is just returning this binary data to the main part of the program so it can be extracted to disk. You don't have to do it this way - I just thought it made it easier to read. I put the ##(more data here) in there because the post would have been really huge if I posted all 30k. Your executable code will be different anyway.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://246027]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-12-03 19:39 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (57 votes). Check out past polls.