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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:43:27+00:00 2026-05-17T06:43:27+00:00

Currently, I have a C++ exe project, which dynamic load N DLLs. Those DLLs

  • 0

Currently, I have a C++ exe project, which dynamic load N DLLs.

Those DLLs will perform calling to the functions which is re-inside exe project.

Now, within my exe project, I wish to know the callers are coming from which DLLs.

Is it possible to do so using any available Windows API?

  • 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-17T06:43:27+00:00Added an answer on May 17, 2026 at 6:43 am

    It depends on what your actual goal is. You cannot do it if you’re expecting the DLLs to be possibly malicious (that is, if you’re expecting them to try to trick you). But if it’s just for debugging or logging or something relaitvely harmless like that, you can look at the stack and get the address that the ret instruction will use to return to the caller, enumerate through the loaded DLLs and test which of them that address is inside of.

    To get the “return address”, you can use the _ReturnAddress intrinsic in Visual C++, and then you can use the GetModuleHandleEx function, passing in GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS to get a handle to the DLL that the address is inside of.

    But I must repeat: you cannot base security decisions off the results of this test. It is very easy for malicious code to fake and “trick” your program into thinking it’s a “trusted” or “safe” DLL. As I said, if it’s just for debugging or logging or something, then go right ahead.

    Also, this will obviously only tell you the DLL the immediate caller is inside of. You can’t do it if you’re 5 levels deep or something….

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

Sidebar

Related Questions

I use TeamCity which in turn invokes msbuild (.NET 4). I have a strange
I have a basic SOAP service that I generated from a provided WSDL. The
In my application there is a loader executable (let's call it Loader.exe). It searches
I've made a Visual Studio Setup Project with Visual Studio 2008 (SP1) for an
Visual Studio database edition comes with a tool, vsdbcmd.exe, that should allow someone to
I am using JNI to wrap a few native functions in a closed-source PDF
I'm getting this error when I run my app (not at compile time): Could
I realize that this question has been asked before - but none of the
I'm trying to debug a static library using MFC in Visual Studio 2008. When
I am trying to use NAnt in order to compile and sign an assembly

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.