@@ -35,13 +35,13 @@ VOID DllInit()
3535 // StringCchPrintf(sz, _countof(sz), _T("DLL被加载!\t应用程序路径:%s"), szPath);
3636 // MyOutputDebugStringW(sz);
3737
38+ wchar_t sz[100 ];
39+ std::swprintf (sz, _countof (sz), _T (" 赋能模块注入成功\n 进程ID: %d" ), GetCurrentProcessId ());
3840 CAdvice::singleton->startListenThread ();
39- MessageBox (NULL , _T ( " 赋能模块注入成功 " ) , _T (" HelpUploadFiles" ), MB_ICONINFORMATION);
41+ MessageBox (NULL , sz , _T (" HelpUploadFiles" ), MB_ICONINFORMATION);
4042}
4143
4244// API 拦截
43-
44-
4545/* *
4646 * @brief 用于拦截百度网盘 上传文件,排除指定文件
4747 * @param hFindFile
@@ -53,11 +53,32 @@ BOOL WINAPI MyFindNextFileW(HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData)
5353 BOOL res = FindNextFileW (hFindFile, lpFindFileData);
5454
5555 CAdvice* pAdvice = CAdvice::singleton;
56- for (bool b = pAdvice->isMatch (lpFindFileData); b; b = pAdvice->isMatch (lpFindFileData)) {
56+ for (bool b = pAdvice->isMatch (lpFindFileData); b && res; b = pAdvice->isMatch (lpFindFileData)) {
57+ // MessageBox(NULL, lpFindFileData->cFileName, _T("提示"), MB_ICONINFORMATION);
5758 res = FindNextFileW (hFindFile, lpFindFileData); // 直接跳到下一个文件
5859 }
5960 return res;
6061}
62+
63+ /* *
64+ * @brief 拦截 FindFirstFileW
65+ * @param lpFileName
66+ * @param lpFindFileData
67+ * @return
68+ */
69+ HANDLE WINAPI MyFindFirstFileW (LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData)
70+ {
71+ HANDLE h = FindFirstFileW (lpFileName, lpFindFileData);
72+ // MessageBox(NULL, lpFindFileData->cFileName, _T("首个文件"), MB_ICONINFORMATION);
73+
74+ // CAdvice* pAdvice = CAdvice::singleton;
75+ // for (bool b = pAdvice->isMatch(lpFindFileData); b; b = pAdvice->isMatch(lpFindFileData)) {
76+ // FindNextFileW(h, lpFindFileData); // 直接跳到下一个文件
77+ // }
78+
79+ return h;
80+ }
6181// API 拦截
6282
63- CAPIHook g_MyFindNextFile (" Kernel32.dll" , " FindNextFileW" , (PROC)MyFindNextFileW);
83+ CAPIHook g_MyFindNextFile (" Kernel32.dll" , " FindNextFileW" , (PROC)MyFindNextFileW);
84+ CAPIHook g_MyFindFirstFile (" Kernel32.dll" , " FindFirstFileW" , (PROC)MyFindFirstFileW);
0 commit comments