case WM_TIMER:
int n;
char str2[260];
char str[260];
char ntname[256];
if(OS.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
ZeroMemory(str,sizeof(str));
ZeroMemory(proce.szExeFile,sizeof(proce.szExeFile));
hndl=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,NULL);
proce.dwSize = sizeof(PROCESSENTRY32);
Process32First(hndl,&proce);
hcount = 0;
nmc=0;
ZeroMemory(hs,sizeof(hs));
while(Process32Next(hndl,&proce))
{
ZeroMemory(str2,sizeof(str2));
strncpy(str2,proce.szExeFile,strlen(proce.szExeFile));
hs[hcount]=OpenProcess(PROCESS_ALL_ACCESS,false,proce.th32ProcessID);
hcount++;
strcpy(names[nmc],str2);
nmc++;
for (i = 0; i < pcount; i++)
{
SendMessage(norl,LB_GETTEXT,i,(LRESULT)str);
n = SendMessage(norl,LB_GETTEXTLEN,i,NULL);
if (strstr(strlwr(str2), strlwr(str)))
{
if(TerminateProcess(OpenProcess(PROCESS_ALL_ACCESS,false,proce.th32ProcessID),0) != 0)
{
time (timer);
tmr = localtime (timer);
out<<str2<<" - Process Killed at ";
out<<tmr->tm_mday<<"/"<<tmr->tm_mon<<"/"<<tmr->tm_year+1900<<" in time "<<tmr->tm_hour<<":"<<tmr->tm_min<<":"<<tmr->tm_sec<<"\n";
Sleep(2000);
}
}
}
}
lastnmc=nmc;
}
if(OS.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{
DWORD ntspace;
DWORD ntspace2;
HANDLE Process;
ZeroMemory(str,sizeof(str));
ZeroMemory(names,sizeof(names));
hcount = 0;
nmc=0;
HMODULE hMod;
DWORD cbNeeded;
if(EnumProcesses(ntpid,sizeof(ntpid),&ntspace))
{
for(int n = 0; n != ntspace/4;n++)
{
//hs[hcount]=OpenProcess(PROCESS_ALL_ACCESS,false,ntpid[n]);
hcount++;
nmc++;
Process = OpenProcess(PROCESS_ALL_ACCESS,false, ntpid[n]);
for (i = 0; i < pcount; i++)
{
SendMessage(norl,LB_GETTEXT,i,(LRESULT)str2);
ZeroMemory(ntname,sizeof(ntname));
if ( Process )
{
if (EnumProcessModules(Process, &hMod, sizeof(hMod),
&ntspace2) )
{
GetModuleBaseName(Process, hMod, ntname, sizeof(ntname));
strcpy(names[n],ntname);
if(strstr(ntname,str2))
{
if(TerminateProcess(Process,0))
{
time (timer);
tmr = localtime (timer);
out<<ntname<<" - Process Killed at ";
out<<tmr->tm_mday<<"/"<<tmr->tm_mon<<"/"<<tmr->tm_year+1900<<" in time "<<tmr->tm_hour<<":"<<tmr->tm_min<<":"<<tmr->tm_sec<<"\n";
goto lab;
}
else
{
MessageBox(hWnd,"Can not terminate Process","Error!!!",NULL);
exit(0);
}
}
}
}
/* else
{
MessageBox(hWnd,"Process == NULL","Error!!!",NULL);
exit(0);
}*/
}
}
lastnmc = nmc;
}
else
{
MessageBox(hWnd,"EnumProcess Error!","Error!!!",NULL);
exit(0);
}
}
else
{
// MessageBox(hWnd,"This program can not be run on M$ MuSTDiE 3.11,3.1,3.0 or younger","MaZDie 06JIoM!",NULL);
// exit(0);
}
lab:
break;
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 21