f11f7520b5
The ctrl-c hack used before didn't actually seem to work. No haskell libraries expose TerminateProcess. I tried just calling it via FFI, but got segfaults, probably to do with the wacky process handle not being managed correctly. Moving it all into one C function worked. This was hell. The EvilLinker hack was just final icing on the cake. We all know what the cake was made of.
10 lines
176 B
C
10 lines
176 B
C
#include <windows.h>
|
|
|
|
void terminatepid (DWORD pid) {
|
|
HANDLE h;
|
|
h = OpenProcess(PROCESS_TERMINATE, 0, pid);
|
|
if (h != NULL) {
|
|
TerminateProcess(h, 1);
|
|
}
|
|
CloseHandle(h);
|
|
}
|