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 7851317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:08:41+00:00 2026-06-02T19:08:41+00:00

I am doing some reverse engineering with a binary executable without sources. On Windows

  • 0

I am doing some reverse engineering with a binary executable without sources. On Windows what I can do is load an executable file (EXE) with LoadLibrary, just as it was a DLL file. If the loaded file is not relocatable I can simply relocate my loader code to “make space” for the other module. When I have the binary loaded, I can call it’s functions (assuming I where where they are, of course), and do other stuff.

Is there some way to do the same or similar on Mac? I have a mach-o executable, and I’d like to load it as it was a dynamic library (DYLIB). Or is there some way to convert an executable into a DYLIB? What are the real differences between an executable and a DYLIB?

  • 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-02T19:08:43+00:00Added an answer on June 2, 2026 at 7:08 pm

    OK, so I did some experiments, and see this. File “bin1.c” contains:

    #include <stdio.h>
    int main() {
        printf("I am bin1.\n");
        return 0;
    }
    

    and “bin2.c” is:

    #include <stdio.h>
    #include <dlfcn.h>
    int main() {
        printf("I am bin2.\n");
    
        void *l = dlopen("bin1", RTLD_NOW);
        if (l == NULL) {
            printf("dlopen failed: %s\n", dlerror());
            return -1;
        }
    
        void *f = dlsym(l, "main");
        if (f == NULL) {
            printf("dlsym failed: %s\n", dlerror());
            return -1;
        }
    
        int (*main)() = f;
        main();
    
        return 0;
    }
    

    On my Mac, all compiles fine and indeed loads the other executable as it was a loadable library, and I can call the main function in the other binary:

    Johanka:Desktop newacc$ uname -a
    Darwin Johanka.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
    Johanka:Desktop newacc$ gcc bin1.c -o bin1 && ./bin1
    I am bin1.
    Johanka:Desktop newacc$ gcc bin2.c -o bin2 && ./bin2
    I am bin2.
    I am bin1.
    

    Not sure though, whether there are limitations on this and if this can be done with non-relocatable binaries. But this example show that at least in some cases, it’s possible.

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

Sidebar

Related Questions

I am doing some reverse engineering on a 3rd party program that is making
Ok so I've recently started doing some reverse engineering, and I keep coming across
I'm doing some practise questions. This one needs to reverse a stack without using
Some background to the problem: Reverse Engineering the DOM, Javascript events & "what's going
I was reverse engineering some code and came across this... /************************************************************************/ /* */ /*
Doing some jquery animation. I have certain divs set up with an attribute of
Doing some homework here (second assignment, still extremely green...). The object is to read
While doing some JavaScript performance tests I came up with the following piece of
While doing some random experimentation with a factorial program in C, Python and Scheme.
While doing some refactoring I've found that I'm quite often using a pair or

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.