首页 > 其他分享 >运行后闪退请前辈们看看

运行后闪退请前辈们看看

时间:2023-01-16 08:44:24浏览次数:35  
标签:return vnsec hModule 前辈 DWORD64 time xtm 闪退 运行

Text.

这是一段c++的if判断源码,不加判断正常运行,加上判断运行就报错,希望前辈们帮忙指点一二

 1 __declspec(safebuffers)BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD reason, [[maybe_unused]] LPVOID reserved)
 2 {
 3 
 4     xtime_vnsec_t xtm_vnsec = time_vnsec();
 5     //xtm_vnsec =+ 1;
 6     time_t xt = (time_t)xtm_vnsec;
 7     DWORD64 BeginTIME = (DWORD64)time(&xt);//拿到时间戳
 8     DWORD64 ENDTIME = 1673829212;//到期时间,现在的时间戳加上数值,单位秒
10 
11     if (ENDTIME > BeginTIME)
12     {
13         //正常执行程序
14         DisableThreadLibraryCalls(hModule);
15 
16         if (reason != DLL_PROCESS_ATTACH)
17             return FALSE;
18 
19         HideThread(hModule);
20         std::setlocale(LC_ALL, ".utf8");
21 
22         ::_beginthreadex(nullptr, 0u, reinterpret_cast<_beginthreadex_proc_type>(DllAttach), nullptr, 0u, nullptr);
23         ::CloseHandle(hModule);
24         return true;
25     }
26 
27     if (ENDTIME < BeginTIME)
28     {
29         return 0;
30     }
31 }

 

标签:return,vnsec,hModule,前辈,DWORD64,time,xtm,闪退,运行
From: https://www.cnblogs.com/RuanYZ/p/17054646.html

相关文章