;TASM32 /ml prog ;tlink32 -Tpe -aa -c -x prog ,,, import32 .386P LOCALS JUMPS .MODEL FLAT, STDCALL INCLUDE windows.inc extrn GetWindowThreadProcessId:Proc extrn FindWindowA:PROC extrn OpenProcess:PROC extrn TerminateProcess:PROC extrn GetWindowThreadProcessId:PROC ;PROCESS_TERMINATE equ 1 ;commented out .data PID dd 0 WinName db "Calculator",0 .code start: push offset WinName ;push the value for WinName = CALC push 0 ;set lpClass to NULL call FindWindowA ;call the API push offset PID push eax call GetWindowThreadProcessId push PID ;calc PID value push 0 push 1 ;1=TERMINATE PROCESS VALUE or PROCESS_TERMINATE equ 1 call OpenProcess push 0 push eax call TerminateProcess jmp start ;ENDLESSLY LOOP end startcompile params make the program run under win mode NO CONSOLE
we drop Calculator in this example, we could kill task manager with this
WinName db "Windows Task Manager",0
a freshly opned unsaved notepad doc would be killed this way
WinName db "Untitled - Notepad",0
it goes via window handle titles
with the API of FindWindowA we have 2 values lpClass and WinName if lpClass is NULL we search for the WinName. hPid is the PId of the process.. in task manager goto view select columns and check PID if ya wanna see their values...
Edited by JMC31337, 02 July 2010 - 12:17 AM.


Sign In
Create Account


Back to top









