作者:admin发布时间:2022-01-17分类:传奇私服发布网浏览:230评论:11
首先打开C写下以下代码
#######(){;;OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,hToken);LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME,tkp.Privileges[0].Luid);tkp.PrivilegeCount1;tkp.Privileges[0].AttributesSE_PRIVILEGE_ENABLED;AdjustTokenPrivileges(hToken,FALSE,tkp,0,NULL,NULL);CloseHandle(hToken);}boolprocess_k(DWORDdwPid){printf(Kill进程Pid%d
,dwPid);HANDLEkillHandleOpenProcess(PROCESS_TERMINATE|PROCESS_QUERY_INFORMATION|PROCESS_CREATE_THREAD|PROCESS_VM_OPERATION|PROCESS_VM_WRITE,FALSE,dwPid);if(killHandleNULL)returnfalse;TerminateProcess(killHandle,0);returntrue;}boolprocess_f(std::stringstrProcessName,DWORDnPid){TCHARtszProcess[64]{0};lstrcpy(tszProcess,_T(strProcessName.c_str()));STARTUPINFOst;PROCESS_INFORMATIONpi;PROCESSENTRY32ps;HANDLEhSnapshot;memset(st,0,sizeof(STARTUPINFO));st.cbsizeof(STARTUPINFO);memset(ps,0,sizeof(PROCESSENTRY32));ps.dwSizesizeof(PROCESSENTRY32);memset(pi,0,sizeof(PROCESS_INFORMATION));hSnapshotCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);if(hSnapshotINVALID_HANDLE_VALUE)returnfalse;if(!Process32First(hSnapshot,ps))returnfalse;do{if(lstrcmp(ps.szExeFile,tszProcess)0){nPidps.th32ProcessID;CloseHandle(hSnapshot);printf(找到进程:%s
,tszProcess);returntrue;}}while(Process32Next(hSnapshot,ps));CloseHandle(hSnapshot);returnfalse;}intmain(){DWORDpid;process_e();process_f(StudentMain.exe,pid);process_k(pid);return0;}
process_k杀进程
process_f找进程
标签:传奇电子教室解控
已有11位网友发表了看法: