Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,169 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,916 people online right now. Registration is fast and FREE... Join Now!




"Blocking/Disallowing" applications from opening

 
Reply to this topicStart new topic

"Blocking/Disallowing" applications from opening

ItsaMystery
3 Dec, 2007 - 03:20 PM
Post #1

New D.I.C Head
*

Joined: 3 Sep, 2007
Posts: 8


My Contributions
Hi there -

My friend give me a small (yet interesting) programming project as a challenge. Essentially, he asked me to try and make a program that would disallow him to open x, y, and z applications (i.e. solitare, firefox, and winamp) before a certain time. If possible, you would be able to choose which apps to disallow and specify what time the applications would become "unlocked".

Is it possible to make a C# program that would run in the background and do this? If so, does anyone know of any tutorials to help me get started?

Thanks for your help.

- Itsa
User is offlineProfile CardPM
+Quote Post

ericode
RE: "Blocking/Disallowing" Applications From Opening
11 Dec, 2007 - 08:59 PM
Post #2

D.I.C Head
Group Icon

Joined: 9 Dec, 2006
Posts: 89


Dream Kudos: 75
My Contributions
Perhaps you could run this process in a loop with the System.Diagnostics

TASKKILL /FI "IMAGENAME eq winamp.exe"
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: "Blocking/Disallowing" Applications From Opening
12 Dec, 2007 - 02:16 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,906



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
You could place a 0xC3 byte (which stands for retn in Assembly Language) at the entrypoint location and save the original byte someplace.

This would lock the program. The second the program is opened to run, it will quit. Technically, the program still runs but quits before it can do anything. We're just modifying the executable file to make something that I'd like to call a SmartLock.

To unlock the program replace the 0xC3 byte at the entrypoint location with the original byte.
User is offlineProfile CardPM
+Quote Post

ItsaMystery
RE: "Blocking/Disallowing" Applications From Opening
12 Dec, 2007 - 02:46 AM
Post #4

New D.I.C Head
*

Joined: 3 Sep, 2007
Posts: 8


My Contributions
Thanks so much both of you. smile.gif

I will research these methods further and see what I can come up with!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:29AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month