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

  • SEARCH
  • Home
  • 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 3637348
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:08:50+00:00 2026-05-19T01:08:50+00:00

This is a little bit of weird problem here. Say I have a C++

  • 0

This is a little bit of weird problem here.

Say I have a C++ code, running on a specific platform. The only purpose of this code is to run files containing binary, NATIVE to that platform.

Now – my question is – HOW would I get the data from these files (could even be by bits, like 1024 bits a cycle) to the memory of machine running my code so that this data would be in the execution part?

In other words, can I get the data to somewhere where I can point the instruction pointer?

If yes, how?

I don’t mind if I have to use assembler for this – just so it would work.

EDIT: Sorry, I wasn’t specific enough.

Basically – the file data I want to load is in no format like .exe, Mach-O executable or ELF. It is just raw binary data (with some custom headers which my code removes). This binary data is machine code, specific and suited for the processor running on the current machine.

Technically this means I want to go around normal OS executors and load the binary directly. I could interpret it but that would be around 3x slower at best.

I would not mind at all if I need to run the data in another child process – but again, I can not use normal process openers, because the data is not in any format that the OS could run automatically (again – like .exe, Mach-O, ELF).

  • 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-05-19T01:08:51+00:00Added an answer on May 19, 2026 at 1:08 am

    You should just read file to memory, mark this memory as executable (it’s platform-specific, for example VirtualProtect() for Windows), and call it as function: ((void(*)())ptr)();

    Of course code in file should be position-independent.

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

Sidebar

Related Questions

I have run into a rather weird little problem. In the following code I
Say I have this little bit of code: public static void LoadSomething(Type t) {
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
its a little bit hard to understand. in the header.php i have this code:
Ok. I have this little bit of code that is supposed to use text
I'm having a little bit weird problem with my HTML. I never had this
I only read a little bit about this topic, but it seems that the
I have code a bit like this public class MyObject { private bool IsValidDay(ref
I'm having a little bit of problem with my derived class. Basically I have
It is looking like i have a major memory leak in this little bit

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.