bool inject(DWORD pID, char* path)
{
path = cHexCode;
HANDLE proc_handle;
LPVOID RemoteString;
LPVOID LoadLibAddy;
if (pID == 0)
return false;
proc_handle = OpenProcess(PROCESS_ALL_ACCESS, false, pID);
if (proc_handle == 0)
return false;
LoadLibAddy = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
RemoteString = VirtualAllocEx(proc_handle, NULL, strlen(path), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(proc_handle, RemoteString, path, strlen(path), NULL);//запись DLL в память игры
CreateRemoteThread(proc_handle, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, RemoteString, NULL, NULL);
CloseHandle(proc_handle);
return true;
}