FreeLibrary crashes on protected DLL
Posted: Wed Feb 26, 2014 7:29 pm
Hi,
My C# program calls a function from an unmanaged C++ DLL. If I use my program without protecting it, everything works fine. If I protect the DLL with Enigma (even with all the options turned off), the program executes correctly but when I exit, I get a message from Windows telling me that my application has stopped working (due to my DLL):
Problem signature:
Problem Event Name: APPCRASH
Application Name: MyApp.exe
Application Version: 5.1.0.0
Application Timestamp: 530d077f
Fault Module Name: MyDLL.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 530d0772
Exception Code: c0000005
Exception Offset: 000000000004a59a
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 3b44
Additional Information 2: 3b4467ad1186f26b412ef9412cee674f
Additional Information 3: 5a24
Additional Information 4: 5a242cfe5b29586c09d5dedab7843d15
After some debugging, it seems that it crashes on function FreeLibrary from kernel32.dll. Again, if I don't protect the DLL, this function works fine and return true. I tried using a different C# mechanism for calling DLLs, and the result is the same: exiting the application makes the DLL crash.
Any suggestion to fix that?
Thank you,
My C# program calls a function from an unmanaged C++ DLL. If I use my program without protecting it, everything works fine. If I protect the DLL with Enigma (even with all the options turned off), the program executes correctly but when I exit, I get a message from Windows telling me that my application has stopped working (due to my DLL):
Problem signature:
Problem Event Name: APPCRASH
Application Name: MyApp.exe
Application Version: 5.1.0.0
Application Timestamp: 530d077f
Fault Module Name: MyDLL.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 530d0772
Exception Code: c0000005
Exception Offset: 000000000004a59a
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 3b44
Additional Information 2: 3b4467ad1186f26b412ef9412cee674f
Additional Information 3: 5a24
Additional Information 4: 5a242cfe5b29586c09d5dedab7843d15
After some debugging, it seems that it crashes on function FreeLibrary from kernel32.dll. Again, if I don't protect the DLL, this function works fine and return true. I tried using a different C# mechanism for calling DLLs, and the result is the same: exiting the application makes the DLL crash.
Any suggestion to fix that?
Thank you,