MCPcopy Create free account
hub / github.com/call-042PE/PyInjector / MainThread

Function MainThread

PyInjector/dllmain.cpp:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3SDK sdk;
4
5DWORD 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
18BOOL APIENTRY DllMain( HMODULE hModule,
19 DWORD ul_reason_for_call,

Callers

nothing calls this directly

Calls 1

InitCPythonMethod · 0.80

Tested by

no test coverage detected