Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XIncludeFile("~\SetCriticalFlag.pb")
- ImportC "msvcrt.lib"
- memset_ ( *str, char.l, length.l ) As "_memset@12"
- EndImport
- OpenConsole()
- PrintN("Welcome, please enter the process that is set to critical...")
- pID = Val(Input())
- If SetCriticalFlag(pID, #False)
- PrintN(#Null$)
- PrintN("Process modified successfully! Would you like to kill the target process' tree using NtTerminateProcess? (y/n)")
- Select Input()
- Case "y"
- PrintN("Traversing target process tree...")
- Default
- PrintN("Very well, press enter to exit...")
- Input()
- Return
- EndSelect
- Pe.PROCESSENTRY32
- memset_(@pe, 0, SizeOf(PROCESSENTRY32))
- pe\dwSize = SizeOf(PROCESSENTRY32)
- hSnap = CreateToolhelp32Snapshot_(#TH32CS_SNAPPROCESS, 0)
- If Process32First_(hSnap, @pe)
- bContinue.b = #True
- While bContinue
- If pe\th32ParentProcessID = pID
- hChildProc = OpenProcess_(#PROCESS_ALL_ACCESS, #False, pe\th32ProcessID)
- If hChildProc
- PrintN("Child process found! Handle: " + Str(hChildProc))
- NtTerminateProcess_(hChildProc, 1)
- CloseHandle_(hChildProc)
- PrintN("Child process killed!")
- EndIf
- EndIf
- bContinue = Process32Next_(hSnap, @pe)
- Wend
- hProc = OpenProcess_(#PROCESS_ALL_ACCESS, #False, pID)
- If hProc
- PrintN("Host process found! Handle: " + Str(hProc))
- NtTerminateProcess_(hProc, 1)
- CloseHandle_(hProc)
- PrintN("Host process killed!")
- EndIf
- EndIf
- PrintN("Press any key to close the program...")
- Input()
- Else
- PrintN("Failed to modify process!")
- Input()
- Return
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement