MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / ExecuteRemoteKernelFuntion

Function ExecuteRemoteKernelFuntion

emmy_tool/src/windows/utility.cpp:204–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204bool ExecuteRemoteKernelFuntion(HANDLE process, const char *functionName, LPVOID param, DWORD &exitCode) {
205 HMODULE kernelModule = GetModuleHandle("Kernel32");
206 FARPROC function = GetProcAddress(kernelModule, functionName);
207
208 if (function == nullptr) {
209 return false;
210 }
211
212 DWORD threadId;
213 HANDLE thread = CreateRemoteThread(process,
214 nullptr,
215 0,
216 (LPTHREAD_START_ROUTINE) function,
217 param,
218 0,
219 &threadId);
220
221 if (thread != nullptr) {
222 WaitForSingleObject(thread, INFINITE);
223 GetExitCodeThread(thread, &exitCode);
224
225 CloseHandle(thread);
226 return true;
227 }
228 return false;
229}
230
231bool IsBeingInjected(DWORD processId, LPCSTR moduleFileName) {
232 HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);

Callers 3

IsBeingInjectedFunction · 0.85
InjectDllFunction · 0.85
InjectDllForProcessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected