Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent program from exiting when calling MemoryCallEntryPoint #88

Open
illera88 opened this issue Sep 27, 2018 · 1 comment
Open

Prevent program from exiting when calling MemoryCallEntryPoint #88

illera88 opened this issue Sep 27, 2018 · 1 comment

Comments

@illera88
Copy link

In the code I can see this:

/**
 * Execute entry point (EXE only). The entry point can only be executed
 * if the EXE has been loaded to the correct base address or it could
 * be relocated (i.e. relocation information have not been stripped by
 * the linker).
 *
 * Important: calling this function will not return, i.e. once the loaded
 * EXE finished running, the process will terminate.
 *
 * Returns a negative value if the entry point could not be executed.
 */
int MemoryCallEntryPoint(HMEMORYMODULE);

Why does the program ends when calling MemoryCallEntryPoint? How can I prevent the program to do so? I want to call the Entry Point in a different thread and keep doing other stuff.

Thank you

@Elmue
Copy link

Elmue commented Jul 2, 2020

As far as I know an application calls TerminateProcess() or a similiar function when it is done.
Running the executable code in a thread brings the very probable risk of creating a huge memory leak.
Most applications do not care about freeing their memory properly when they exit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants