Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:21:25+00:00 2026-06-03T11:21:25+00:00

I would like to have a small application loader program that receives other binary

  • 0

I would like to have a small “application loader” program that receives other binary application files over TCP from an external server and runs them.

I could do this by saving the transmitted file to the hard disk and using the system() call to run it. However, I am wondering if it would be possible to launch the new application from memory without it ever touching the hard drive.

The state of the loader application does not matter after loading a new application. I prefer to stick to C, but C++ solutions are welcome as well. I would also like to stick to standard Linux C functions and not use any external libraries, if possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:21:26+00:00Added an answer on June 3, 2026 at 11:21 am

    Short answer: no.

    Long answer: It’s possible but rather tricky to do this without writing it out to disk. You can theoretically write your own elf loader that reads the binary, maps some memory, handles the dynamic linking as required, and then transfers control but that’s an awful lot of work, that’s hardly ever going to be worth the effort.

    The next best solution is to write it to disk and call unlink ASAP. The disk doesn’t even have to be “real” disk, it can be tmpfs or similar.

    The alternative I’ve been using recently is to not pass complete compiled binaries around, but to pass LLVM bytecode instead, which can then be JIT’d/interpreted/saved as fit. This also has the advantage of making your application work in heterogeneous environments.

    It may be tempting to try a combination of fmemopen, fileno and fexecve, but this won’t work for two reasons:

    1. From fexecve() manpage:

      “The file descriptor fd must be opened read-only, and the caller must have permission to execute the file that it refers to“

      I.e. it needs to be a fd that refers to a file.

    2. From fmemopen() manpage:

      “There is no file descriptor associated with the file stream returned by these functions (i.e., fileno(3) will return an error if called on the returned stream)”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a small application that I would like to try and sell
I have a small web.py Python application that I would like to serve under
I have made a small application in Java and I would like to make
Hey guys, I have developed a small site that i would like to embed
I have a small working application in ASP.NET and C#, and I would like
I am building a small Swing application that I would like to embed a
I currently have a small Java program which I would like to run both
I have a small class hierarchy where I would like to have a child
I have a small JSF app and would like to keep some state on
I have a small problem with url rewriting on apache. I would like it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.