diff --git a/traffic-duck.sln b/traffic-duck.sln new file mode 100644 index 0000000..673c94f --- /dev/null +++ b/traffic-duck.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31605.320 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traffic-duck", "traffic-duck\traffic-duck.vcxproj", "{81025C95-9AFF-45AC-A560-D52D03D9BA8A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Debug|x64.ActiveCfg = Debug|x64 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Debug|x64.Build.0 = Debug|x64 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Debug|x86.ActiveCfg = Debug|Win32 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Debug|x86.Build.0 = Debug|Win32 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Release|x64.ActiveCfg = Release|x64 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Release|x64.Build.0 = Release|x64 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Release|x86.ActiveCfg = Release|Win32 + {81025C95-9AFF-45AC-A560-D52D03D9BA8A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {74D493F4-BB97-494B-9E43-C2C002D55B1E} + EndGlobalSection +EndGlobal diff --git a/traffic-duck/traffic-duck.cpp b/traffic-duck/traffic-duck.cpp new file mode 100644 index 0000000..a32a651 --- /dev/null +++ b/traffic-duck/traffic-duck.cpp @@ -0,0 +1,40 @@ + +#include +#include +#include + +#include +#include + +#define SLEEP_TIME 120000 +#define INTERVAL_TIME SLEEP_TIME - 2000 +void WriteFile(std::string pName, std::string pBody) { + std::ofstream ofile(pName); + ofile << pBody; + ofile.close(); +} +HANDLE EasyCreateThread(void* pFunctionAddress, void* pParams) { + return CreateThread( + NULL, NULL, reinterpret_cast(pFunctionAddress), + static_cast(pParams), NULL, NULL); +} +void ThreadRoute(HANDLE pEventHandle) { + //其实不需要sleep的否则会被某些沙箱标记为"sleep"已经加速 + //我只是为了写文件才sleep的.正常情况直接WaitForSingleObjectEx等{{SLEEP_TIME}}就行 + Sleep(SLEEP_TIME); + SetEvent(pEventHandle); +} +int main() { + const auto eventHandle = CreateEventW(NULL, FALSE, FALSE, L""); + if (eventHandle) { + EasyCreateThread(static_cast(ThreadRoute), + static_cast(eventHandle)); + const auto singleStatus = + WaitForSingleObjectEx(eventHandle, INTERVAL_TIME, false); + singleStatus != WAIT_TIMEOUT + ? WriteFile("block.txt", "{64D8DECE-0F4C-4601-84E2-A6B154FDD155}") + : WriteFile("pass.txt", "{E8415AFE-0126-428C-ACF9-EA035D6362C4}"); + CloseHandle(eventHandle); + } + return 0; +} diff --git a/traffic-duck/traffic-duck.vcxproj b/traffic-duck/traffic-duck.vcxproj new file mode 100644 index 0000000..8565d25 --- /dev/null +++ b/traffic-duck/traffic-duck.vcxproj @@ -0,0 +1,148 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {81025c95-9aff-45ac-a560-d52d03d9ba8a} + trafficduck + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + false + + + + + + + + + \ No newline at end of file diff --git a/traffic-duck/traffic-duck.vcxproj.filters b/traffic-duck/traffic-duck.vcxproj.filters new file mode 100644 index 0000000..df80a08 --- /dev/null +++ b/traffic-duck/traffic-duck.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file