|
@@ -115,16 +115,18 @@ BOOL CInjection::InjectDynamicLibrary()
|
|
|
CloseHandle(m_hInjectThread);
|
|
|
m_hInjectThread = NULL;
|
|
|
|
|
|
- /* 注入成功后,不能释放内存否则微信会挂;
|
|
|
if (m_lpInjectData != NULL)
|
|
|
+ {
|
|
|
+ //VirtualFreeEx(m_hInjectProcess, m_lpInjectData, m_dwPathLen, MEM_DECOMMIT);
|
|
|
+ // 使用MEM_RELEASE,微信注入时出错;
|
|
|
VirtualFreeEx(m_hInjectProcess, m_lpInjectData, 0, MEM_RELEASE);
|
|
|
- */
|
|
|
+ }
|
|
|
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
BOOL CInjection::EjectDynamicLibrary()
|
|
|
-{
|
|
|
+{// 进程卸载还可以使用进程通讯,让DLL自动卸载更安全;
|
|
|
if(m_hInjectProcess==NULL)
|
|
|
return TRUE;
|
|
|
|