Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C#: unkillable process

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Traps
Cheater
Reputation: 0

Joined: 26 Mar 2007
Posts: 35

PostPosted: Sat Apr 28, 2007 10:47 pm    Post subject: C#: unkillable process Reply with quote

How can I make a process unkillable(like for example through taskmanager)

I thought about creating a couple seperate processes that monitor each other, and my main program. If my main program dies, one of the seperate process's will relaunch it, and if one of the serperate process's dies, the cooresponding sister process will relaunch it.

This is kinda lame in my opinion. Is there a way to hook the kernal level terminateprocess(). That would be the best route to go, but I have no clue how to do this in c#.
Back to top
View user's profile Send private message
Poent
Cheater
Reputation: 0

Joined: 24 Apr 2007
Posts: 32

PostPosted: Mon Apr 30, 2007 8:30 pm    Post subject: Reply with quote

One of the ways I can think of to hide it would be to use a root-kit, I dont know too much about them, but I do know that many viruses use them to hide themselves and their files.

P.S.

.NET is the devil
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Apr 30, 2007 8:47 pm    Post subject: Reply with quote

WRONG way: Enumerate the processes and restart if you find missing. This makes your process vulnerable to a suspend-kill attack.

RIGHT way: Use thread synchronization objects or a pipe to constantly verify that the sibling process is active and OK. This is not lame, and much more cleaner than hooking TerminateProcess (and there are many many ways to terminate a process, terminateprocess is just the easiest)
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Mon Apr 30, 2007 8:51 pm    Post subject: Reply with quote

And named pipes in .NET are incredibly simple. More so than in anything else.
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Apr 30, 2007 8:56 pm    Post subject: Reply with quote

They can be anonymous (easier than named), if one process is to launch another, there are many ways they can share handles.
Back to top
View user's profile Send private message
linden
Master Cheater
Reputation: 0

Joined: 10 Mar 2006
Posts: 319

PostPosted: Mon Apr 30, 2007 9:11 pm    Post subject: Reply with quote

Two process monitoring each other...too lame...
hooking terminateprocess is not good...one can still kill the process if he can open a process handle to it (i.e. inject buggy code to the victim process, nopping the code area, etc.).

The best way is still the rootkit technique... hook any one of these in the kernel: NtOpenProcess, PsLookupProcessByProcessId, ObOpenObjectByPointer, ObReferenceObjectByPointer; but can't be realized using c# Sad

EDIT:
Ah! I came up with another idea! You really need a process?
If not, you might try implement everything into a DLL (a C# DLL?)
and then inject that DLL into winlogon.exe and run under the process context of winlogon.exe. Nobody would dare to terminate winlogon.exe, since terminating winlogon.exe means crashing windows Very Happy
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Mon Apr 30, 2007 9:28 pm    Post subject: Reply with quote

Youre gonna have to write that DLL in something else :S
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites