| 3 | SDK sdk; |
| 4 | |
| 5 | DWORD WINAPI MainThread(HMODULE hModule) |
| 6 | { |
| 7 | sdk.InitCPython(); |
| 8 | Py_SetProgramName(L"PyInjector"); |
| 9 | PyEval_InitThreads(); |
| 10 | |
| 11 | PyGILState_STATE s = PyGILState_Ensure(); |
| 12 | PyRun_SimpleString("import os\nwith open(\"code.py\",\"r\") as file:\n data = file.read()\nexec(data)"); // more easy to execute wanted code this way |
| 13 | PyGILState_Release(s); |
| 14 | FreeLibraryAndExitThread(hModule, 0); |
| 15 | CloseHandle(hModule); |
| 16 | } |
| 17 | |
| 18 | BOOL APIENTRY DllMain( HMODULE hModule, |
| 19 | DWORD ul_reason_for_call, |
nothing calls this directly
no test coverage detected