|
@@ -104,7 +104,7 @@ LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|
|
BOOL APIENTRY DllMain(HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
|
|
|
{
|
|
|
g_hCurModule = hModule;
|
|
|
-#if 1 // 获取dll的目录;
|
|
|
+ // 获取dll的目录;
|
|
|
TCHAR szDrive[MAX_PATH] = { 0 };
|
|
|
TCHAR szDir[MAX_PATH] = { 0 };
|
|
|
TCHAR szExt[MAX_PATH] = { 0 };
|
|
@@ -112,51 +112,45 @@ BOOL APIENTRY DllMain(HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserve
|
|
|
_tsplitpath_s(g_szCurModulePath, szDrive, szDir, g_szFna, szExt);
|
|
|
_tcscpy_s(g_szCurModulePath, szDrive);
|
|
|
_tcscat_s(g_szCurModulePath, szDir);
|
|
|
-#endif
|
|
|
-
|
|
|
-#ifdef _DEBUG
|
|
|
- Sleep(5000);
|
|
|
-#endif
|
|
|
|
|
|
switch (ul_reason_for_call)
|
|
|
{
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
{
|
|
|
- std::thread t([]() {
|
|
|
- DWORD dwThreadId = 0;
|
|
|
- GetProcInfo(dwThreadId);
|
|
|
+ DWORD dwThreadId = 0;
|
|
|
+ GetProcInfo(dwThreadId);
|
|
|
+ if (ghk_CBT == NULL)
|
|
|
+ {
|
|
|
+ ghk_CBT = SetWindowsHookEx(WH_CBT, CBTProc, HINSTANCE(0x000604F4), dwThreadId);
|
|
|
if (ghk_CBT == NULL)
|
|
|
- {
|
|
|
- ghk_CBT = SetWindowsHookEx(WH_CBT, CBTProc, HINSTANCE(0x000604F4), dwThreadId);
|
|
|
- if (ghk_CBT == NULL)
|
|
|
- WriteTextLog(_T("hook api失败"));
|
|
|
- else
|
|
|
- WriteTextLog(_T("hook api成功:%ld,%p"), GetLastError(), HINSTANCE(0x000604F4));
|
|
|
- }
|
|
|
+ WriteTextLog(_T("hook api失败"));
|
|
|
+ else
|
|
|
+ WriteTextLog(_T("hook api成功:%ld,%p"), GetLastError(), HINSTANCE(0x000604F4));
|
|
|
+ }
|
|
|
|
|
|
- WriteTextLog(_T("dll已成功注入:【当前线程id=%d, 目标线程id=%d,进程id=%d】"), ::GetCurrentThreadId(), dwThreadId, ::GetCurrentProcessId());
|
|
|
- WxInfo wxInfo;
|
|
|
- GetWxInfo(wxInfo);
|
|
|
+ WriteTextLog(_T("dll已成功注入:【当前线程id=%d, 目标线程id=%d,进程id=%d】"), ::GetCurrentThreadId(), dwThreadId, ::GetCurrentProcessId());
|
|
|
+ WxInfo wxInfo;
|
|
|
+ GetWxInfo(wxInfo);
|
|
|
|
|
|
- CCurlClient curl;
|
|
|
- if (curl.Initialize() == CURLE_OK)
|
|
|
+#if 0
|
|
|
+ CCurlClient curl;
|
|
|
+ if (curl.Initialize() == CURLE_OK)
|
|
|
+ {
|
|
|
+ std::string strData;
|
|
|
+ if (curl.Get(wxInfo.strWxSImgAddr, strData) == CURLE_OK)
|
|
|
{
|
|
|
- std::string strData;
|
|
|
- if (curl.Get(wxInfo.strWxSImgAddr, strData) == CURLE_OK)
|
|
|
+ FILE* pf = NULL;
|
|
|
+ TCHAR szWxImage[MAX_PATH] = { 0 };
|
|
|
+ _stprintf_s(szWxImage, _T("%s%s\\%s.jpg"), g_szCurModulePath, _T("image"), wxInfo.strWxID.c_str());
|
|
|
+ pf = _tfopen(szWxImage, _T("w+"));
|
|
|
+ if (pf)
|
|
|
{
|
|
|
- FILE *pf = NULL;
|
|
|
- TCHAR szWxImage[MAX_PATH] = { 0 };
|
|
|
- _stprintf_s(szWxImage, _T("%s%s\\%s.jpg"), g_szCurModulePath, _T("image"), wxInfo.strWxID.c_str());
|
|
|
- pf = _tfopen(szWxImage, _T("w+"));
|
|
|
- if (pf)
|
|
|
- {
|
|
|
- fwrite(strData.c_str(), strData.size(), 1, pf);
|
|
|
- fclose(pf);
|
|
|
- }
|
|
|
+ fwrite(strData.c_str(), strData.size(), 1, pf);
|
|
|
+ fclose(pf);
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- t.detach();
|
|
|
+ }
|
|
|
+#endif
|
|
|
}
|
|
|
break;
|
|
|
case DLL_THREAD_ATTACH:
|