-
Terminating Proccesses
sometimes when im testing my hacks the game window freezes so im trying to make a program that terminates the process
Code:
#include <tlhelp32.h>
int main()
{
HANDLE SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL,NULL);
if (SnapShot != NULL)
{
PROCESSENTRY32 PE;
PE.dwSize = sizeof(PROCESSENTRY32);
HRESULT r = Process32First (SnapShot,&PE);
while(r != NULL)
{
if(strstr((char*)&PE.szExeFile,"globalops.exe") )
{
HANDLE GO = OpenProcess (PROCESS_TERMINATE,0,PE.th32ProcessID);
TerminateProcess (GO,0);
}
r = Process32Next (SnapShot,&PE);
}
}
}
how would i fix these errors
Code:
Compiling...
main.cpp
c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2146: syntax error : missing ';' before identifier 'WINAPI'
c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2501: 'HANDLE' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
-
Heres a hint: Its around line 26 of the header file
-
wtf a error with a precompiled header file how am i supposed to fix that
-
It's not likely to be a problem with the code in the tlhelp32 file as such, but with the syntax the function/whatever, at line 26 is expecting, and not getting. In particular, I suspect the problem is that tlhelp32 is a windows header and is expecting something from a windows file that it's not getting. Maybe you need to include the windows.h file if you are trying to use windows functions in a console program, but I think it more likely that you are attempting to write a windows program but are using the console entry point int main() rather than a windows entry point like int WINAPI WinMain(). Telling us what type of program you are trying to write will help us help you better.
-
Most likely elad had it right with "Maybe you need to include the windows.h file".
HANDLE is a windows defined typedef and is unrecognised without windows.h.
-
Hum, 1st you wanted to hide task manager, then you wanted to delete registry keys,now you want to end processes, but as I can see your having serious trouble programmming, so I believe your little worm or whatever wont affect anyone. But it should be interesting learning basics about programming using a high-level API. 1st I advise you to learn to read and understand compiler warnings... Anyway good luck ;)
-
no i dont want to write a virus ...
im just trying to find a way to hide some programs from being detected by an anti cheat
everyone has to start from somewhere i have only been programming for 2 months and since i am only 10 i think i am doing well
-
You should be outside playing with friends instead of coding and playing computer games - you'll have the rest of your life to do that.
gg
-
You're only 10??? !!!
Well you're trying to write programs to be undetected by a computer usar, because any process can be easily detected in memory.