Kill one runing program
Kill one runing program
How we can Force to kill one runing process?
Hi omid-xp.
There is probably an example somewhere on this board (find via search).
You are building (or getting people here to build for you) a self-modifying exe that runs in stealth mode, has the ability to install another exe, has the ability to send emails from the installed machine, can kill processes (like anti-virus?) and etc.
I have a favour to ask.
If that thing you are building ever escapes, can it look for purebasic on the machine it lands on and kill itself if it finds pure? That way at least we don't get infected.
This is a fairly relaxed board, and you are getting the benefit of the doubt. On a more responsible board you would have been asked, by now, to show your code and if not shown you would have been banned.
Just out of curiosity - care to post what you have done so far?
There is probably an example somewhere on this board (find via search).
You are building (or getting people here to build for you) a self-modifying exe that runs in stealth mode, has the ability to install another exe, has the ability to send emails from the installed machine, can kill processes (like anti-virus?) and etc.
I have a favour to ask.
If that thing you are building ever escapes, can it look for purebasic on the machine it lands on and kill itself if it finds pure? That way at least we don't get infected.
This is a fairly relaxed board, and you are getting the benefit of the doubt. On a more responsible board you would have been asked, by now, to show your code and if not shown you would have been banned.
Just out of curiosity - care to post what you have done so far?
to me this sounds very suspicious as I am familiar with how trojans work and every question he has asked is a feature of some of the trojans we have all heard about. if you _are_ writing an ANTI-TROJAN app like you stated in another topic why the need to hide your app's window/process?
why the need to download a picture from a webcam? no anti-trojan program I have used has ever hidden itself from me? why would it do that? Or maybe you _are_ just trying to learn how they work so you can handle them better (with your anti-trojan app) but programming is also about learning on your OWN (it is ok to ask a few questions) but don't make other people give you every single piece of code for you app.
I am not saying it is wrong to code what you *might* be coding.. imo you can do what you want.. just don't bring it here.
why the need to download a picture from a webcam? no anti-trojan program I have used has ever hidden itself from me? why would it do that? Or maybe you _are_ just trying to learn how they work so you can handle them better (with your anti-trojan app) but programming is also about learning on your OWN (it is ok to ask a few questions) but don't make other people give you every single piece of code for you app.
I am not saying it is wrong to code what you *might* be coding.. imo you can do what you want.. just don't bring it here.
Hi Dare2.
i am sorry for this some topics i making.
but i say before " i am a beginner in PB " need to help for start.
i search the forums for this topic just find one topic , that's kill one process by process id , i want kill by process name.
can you find in this forums one "kill process by name" topic?
i can't can you?
i love purebasic and like write all my apps by this language.
if you or anybody don't like my topics i delete my posts in all topics and don't try send one more topics for my problems.
i am sorry for this some topics i making.
but i say before " i am a beginner in PB " need to help for start.
i search the forums for this topic just find one topic , that's kill one process by process id , i want kill by process name.
can you find in this forums one "kill process by name" topic?
i can't can you?
i love purebasic and like write all my apps by this language.
if you or anybody don't like my topics i delete my posts in all topics and don't try send one more topics for my problems.

I have some source code to do what you want but your posts are a little concerning, if you could show us what your tring to do by posting your code i would be glad to help if it's not going to hurt other computers(if your not making a virus)
just post what your doing and everyone would be glad to help.
Sean

Sean
Hi scurrier.
i never before this no making one virus , and don't know how making that.
all my topics not for one app , it's for some app.
i now work on the one email sender program.
users add custom email , smtp and file list and then build it.
server when run send email with attach that files.
it's not virus and not a trojan.
sample of this program is "Beee" ( Better Email Enable Everything ) at http://www.iOpus.com.
but that have very bugs and size is very big.
i now work for make one better email sender.
i like write utilitis in PB but i'm one beginner in PB , and very glad if someone help me in this work.
thank you and all for help to beginners.
i never before this no making one virus , and don't know how making that.
all my topics not for one app , it's for some app.
i now work on the one email sender program.
users add custom email , smtp and file list and then build it.
server when run send email with attach that files.
it's not virus and not a trojan.
sample of this program is "Beee" ( Better Email Enable Everything ) at http://www.iOpus.com.
but that have very bugs and size is very big.
i now work for make one better email sender.
i like write utilitis in PB but i'm one beginner in PB , and very glad if someone help me in this work.
thank you and all for help to beginners.
okay maybe no-one on this forum thinked about that you may are programming multible apps. But it is a fact, that if you bring all the functions you are asking for in 1 program, it might become evil...
But okay, splittet up in multible programs (task lister, computer lock, webcam security program, email sender or whatever), it is not evil.
But of course we are worried when a new user come and ask for functions that *might* become a virus/trojan.
But anyway, i see that some/a lot of the things you are asking about might need windows API. I suggest you read about API in the docs of PB, download API-GUIDE from www.allapi.net and looks in the api example in pb's example folder. Maybe that will save you from writing a lot of these posts.
But okay, splittet up in multible programs (task lister, computer lock, webcam security program, email sender or whatever), it is not evil.
But of course we are worried when a new user come and ask for functions that *might* become a virus/trojan.
But anyway, i see that some/a lot of the things you are asking about might need windows API. I suggest you read about API in the docs of PB, download API-GUIDE from www.allapi.net and looks in the api example in pb's example folder. Maybe that will save you from writing a lot of these posts.
ok here is the code to kill a program i use it to kill bearshare at 7:30Am everyday
hope this helps
Sean
Code: Select all
Structure PROCESSENTRY32
dwSize.l
cntUsage.l
th32ProcessID.l
th32DefaultHeapID.l
th32ModuleID.l
cntThreads.l
th32ParentProcessID.l
pcPriClassBase.l
dwFlags.l
szExeFile.b [#MAX_PATH]
EndStructure
;--- Procedures ---
Procedure KillProcess (pid)
phandle = OpenProcess_ (#PROCESS_TERMINATE, #FALSE, pid)
If phandle <> #NULL
If TerminateProcess_ (phandle, 1)
result = #TRUE
EndIf
CloseHandle_ (phandle)
EndIf
ProcedureReturn result
EndProcedure
NewList Process32.PROCESSENTRY32 ()
; Add processes to Process32 () list...
restart:
If OpenLibrary (#PROCESS32LIB, "kernel32.dll")
snap = CallFunction (#PROCESS32LIB, "CreateToolhelp32Snapshot", #TH32CS_SNAPPROCESS, 0)
If snap
DefType.PROCESSENTRY32 Proc32
Proc32\dwSize = SizeOf (PROCESSENTRY32)
If CallFunction (#PROCESS32LIB, "Process32First", snap, @Proc32)
AddElement (Process32 ())
CopyMemory (@Proc32, @Process32 (), SizeOf (PROCESSENTRY32))
While CallFunction (#PROCESS32LIB, "Process32Next", snap, @Proc32)
AddElement (Process32 ())
CopyMemory (@Proc32, @Process32 (), SizeOf (PROCESSENTRY32))
Wend
EndIf
CloseHandle_ (snap)
EndIf
CloseLibrary (#PROCESS32LIB)
EndIf
ResetList (Process32 ())
While NextElement (Process32 ())
; addtem( PeekS (@Process32 ()\szExeFile)
proc$=(PeekS (@Process32 ()\szExeFile))
If proc$="BearShare.exe"
Threadid = Process32 ()\th32ProcessID
Debug "Killing Thread "+proc1$+" it's ID is "+Str(Threadid)
KillProcess (Threadid)
EndIf
Wend
End
Sean