MCPcopy Create free account
hub / github.com/0xJs/RedTeaming_CheatSheet / FindThread

Function FindThread

coding/projects/WoW64/implant.cpp:181–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179
180
181HANDLE FindThread(int pid){
182
183 HANDLE hThread = NULL;
184 THREADENTRY32 thEntry;
185
186 thEntry.dwSize = sizeof(thEntry);
187 HANDLE Snap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
188
189 while (Thread32Next(Snap, &thEntry)) {
190 if (thEntry.th32OwnerProcessID == pid) {
191 hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thEntry.th32ThreadID);
192 break;
193 }
194 }
195 CloseHandle(Snap);
196
197 return hThread;
198}
199
200
201int InjectWOW64(HANDLE hProc, unsigned char * payload, unsigned int payload_len) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected