how to prevent other .exe to call my .exe

checkingrandom 206 Reputation points
2022-05-18T05:41:01.787+00:00

Hi Basically this question is for safety purpose. I have my own application(.exe files) stored in a folder.

I want to prevent the calling of my .exe files by third party applications.

Example: I have three application(.exe files) I want to open all the three application only by myself (i.e the opening right of those exe should be my own .exe alone) no third party application should open it.

is that possible to do so?

Let me give my attempt details, I used signature check of the parent process, it achieved but the drawback is when the parent is terminated the pid is also terminated or reused so at that time we cant able to find the signature.

Note: all the calling process acts as a thread so parent is needed to get the signature.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,411 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,520 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Guido Franzke 2,196 Reputation points
    2022-05-18T06:11:34.773+00:00

    Hello,
    you cannot prevent other apps to start your exe files.

    Since your exes are called within your self-written apps, you could use the paramter list and provide a special "startup-key" (just a parameter string which no-one knows, e.g. "myexe.exe -l2kfeii2fncx84mxa4"). If this is not present when starting main, then you can exit your exe programmatically.
    Here's how to use the parameter list of main:
    pass-arguments-into-c-program-from-command-line
    For WinMain, MFC apps etc there are special operations to get the values in the parameter list.
    Regards, Guido

    1 person found this answer helpful.