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

Crash!!! #25

Open
warsark opened this issue Mar 27, 2023 · 3 comments
Open

Crash!!! #25

warsark opened this issue Mar 27, 2023 · 3 comments

Comments

@warsark
Copy link

warsark commented Mar 27, 2023

test.exe a normal exe with not use mmpp
i comment this line:// const NTSTATUS Initializer = Initialize();
a.dll build with mmpp static libirary,export loaddll func
void loaddll()
{
Initialize();
mmload("b.dll");
}

b.dll is a normal dll

test.exe
void main()
{
hmodule hmod=loadlibrary(a.dll)
call hmod.loaddll();
call freelibrary(hmod);
//now everything is ok!

while(true)
{
sleep(1000);
}
}

a few moment ,the test.exe will crash!!!

@bb107
Copy link
Owner

bb107 commented Mar 27, 2023

Hi, thanks for your feedback. Since MMPP hooks ntdll!RtlUserThreadStart and ntdll!LdrShutdownThread, once the Initialize function is called, this module (that is, a.dll) cannot be released.

@warsark
Copy link
Author

warsark commented Mar 27, 2023

if comment this line://call freelibrary(hmod);
the test.exe is ok
Add one func do the uninitialize, will be ok
the b.dll loaded,the a.dll call unitialize
then freelibrary,will be ok

@bb107
Copy link
Owner

bb107 commented Mar 28, 2023

If b.dll does not use tls, you only need to comment the statement that initializes MmpTls (Initialize.cpp line 465). Otherwise, when a.dll is released, the program will inevitably crash.

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