[Solved] How to create multiplethreads each with different ThreadProc() function using CreateThread()

Try this: DWORD WINAPI ThreadProc1( LPVOID lpParameter) { … return 0 ; } DWORD WINAPI ThreadProc2( LPVOID lpParameter) { … return 0 ; } … typedef DWORD (WINAPI * THREADPROCFN)(LPVOID lpParameter); THREADPROCFN fntable[4] = {ThreadProc1, ThreadProc2, …} ; //Start the threads for (int i = 0; i < max_number; i++) { DWORD ThreadId ; CreateThread( … Read more

[Solved] Why iisn’t my function working when it’s called? [closed]

int hitDaEnterKey() { INPUT ip; // Set up a generic keyboard event. ip.type = INPUT_KEYBOARD; ip.ki.wScan = 0; // hardware scan code for key ip.ki.time = 0; ip.ki.dwExtraInfo = 0; // Press and release Enter Key ip.ki.wVk = 0x0D; ip.ki.dwFlags = 0; SendInput(1, &ip, sizeof(INPUT)); // release ip.ki.dwFlags = KEYEVENTF_KEYUP; SendInput(1, &ip, sizeof(INPUT)); return 0; … Read more

[Solved] DLLImport of the origin function in the DLL

If only kernel32.dll is being changed you could call ntdll.dll!NtReadVirtualMemory (ReadProcessMemory itself calls this function). If ntdll.dll is also seems to be changed by 3rd party process you could copy ntdll.dll to another temporary file (ntdll_copy.dll), and use it: [DllImport(“ntdll_copy.dll”, EntryPoint = “NtReadVirtualMemory”)] private static extern bool NtReadVirtualMemory(IntPtr hProcess, UIntPtr lpBaseAddress, [Out] byte[] lpBuffer, UIntPtr … Read more

[Solved] stopping a thread in windows [closed]

Using the TerminateThread function. The function you posted does: PostThreadMessage(hookThreadId, WM_QUIT, (WPARAM) NULL, (LPARAM) NULL); WaitForSingleObject(hookThreadHandle, 5000); So it sends a quit message to that thread, and then waits for it to close. 6 solved stopping a thread in windows [closed]