MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / InitializeMainCheckThread

Method InitializeMainCheckThread

Source/Client/NM_Engine/NM_MainThread.cpp:168–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166#endif
167
168bool CNM_App::InitializeMainCheckThread()
169{
170 DEBUG_LOG(LL_SYS, "Thread creation has been started!");
171
172 auto ulFuncSize = g_nmApp->ThreadManagerInstance()->GetThreadFuncSize((LPBYTE)NoMercyClientMainRoutine);
173 if (!ulFuncSize || ulFuncSize > 1024)
174 {
175 DEBUG_LOG(LL_ERR, "Not valid thread func size: %u", ulFuncSize);
176 return false;
177 }
178
179 auto thread = g_nmApp->ThreadManagerInstance()->CreateCustomThread(SELF_THREAD_NMMAINROUTINE, NoMercyClientMainRoutine, ulFuncSize, nullptr, 15000 + 1000, true);
180 if (!IS_VALID_SMART_PTR(thread) || thread->IsCorrect() == false)
181 {
182 DEBUG_LOG(LL_ERR, "Thread can NOT created! Error: %u", g_winapiApiTable->GetLastError());
183 return false;
184 }
185
186 DEBUG_LOG(LL_SYS, "Info - %u[%p->%p][%d-%s] - Completed! Shared:%p Custom:%p",
187 thread->GetId(), thread->GetHandle(), thread->GetStartAddress(), thread->GetCustomCode(), thread->GetThreadCustomName().c_str(), thread, thread.get());
188
189 return true;
190}

Callers

nothing calls this directly

Calls 10

GetThreadFuncSizeMethod · 0.80
ThreadManagerInstanceMethod · 0.80
CreateCustomThreadMethod · 0.80
IsCorrectMethod · 0.80
GetHandleMethod · 0.80
GetStartAddressMethod · 0.80
GetCustomCodeMethod · 0.80
GetThreadCustomNameMethod · 0.80
GetIdMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected