Original Post
🔒 Locked
Unregister Process
Advertisement
Ok, let me explain, I've been trying to figure this out for a while, so maybe someone can help. My question was probably not the right question to ask.
NOTE: This is what I came up with as an answer to my problem, if it's dumb, excuse me. : )
I'm writing a screesaver manager for a my screensavers. Some of my screensavers will be trial versions, so instead of just putting the .scr files there and having to store reg info in the registry or somewhere else, I wrap that info around the mainframe for a screensaver and put all that info into the a file with another extension(one that my manager will use).
When my manager runs a screensaver, it gets the info, copies the mainframe of the screensaver into memory, then deposits it into a file in the temp folder, then runs it from there, deletes it when it's done.
The problem is that someone can go into the temp folder and get the file while the screensaver is running(in preview mode or config mode), rename it to an .scr file, and they have the full version(the main screensaver manager is the one that stops a screensaver from running if it's a trial version).
So basically, I need some way to either run the screensaver from memory(i've been told this is about impossible), or else someway to make the file in the temp folder more secure.
Any suggestions. And sorry if my explanation wasn't that clear. Ask if you have questions.
Levi
NOTE: This is what I came up with as an answer to my problem, if it's dumb, excuse me. : )
I'm writing a screesaver manager for a my screensavers. Some of my screensavers will be trial versions, so instead of just putting the .scr files there and having to store reg info in the registry or somewhere else, I wrap that info around the mainframe for a screensaver and put all that info into the a file with another extension(one that my manager will use).
When my manager runs a screensaver, it gets the info, copies the mainframe of the screensaver into memory, then deposits it into a file in the temp folder, then runs it from there, deletes it when it's done.
The problem is that someone can go into the temp folder and get the file while the screensaver is running(in preview mode or config mode), rename it to an .scr file, and they have the full version(the main screensaver manager is the one that stops a screensaver from running if it's a trial version).
So basically, I need some way to either run the screensaver from memory(i've been told this is about impossible), or else someway to make the file in the temp folder more secure.
Any suggestions. And sorry if my explanation wasn't that clear. Ask if you have questions.
Levi
If you're using Win32 ensuring that your app doesnt show in the taskbar is easy. Make sure that your window does not have the WS_EX_APPWINDOW extended style. Or, if this works with your design, make your window a tool window with the WS_EX_TOOLWINDOW extended style.
The only sure way to have it not show up anywhere is to create a thread, which I believe will keep running even IF you close a program. Someone correct me if I'm wrong though...
Anyways, you could always make the program a .dll and tell windows to load it up when you start the system. It would mask it as rundll32.exe I believe...
Anyways, you could always make the program a .dll and tell windows to load it up when you start the system. It would mask it as rundll32.exe I believe...
What I really need is some way to stop people from accessing the file I run from(in the temp folder). There must be some way easier than creating them as .dlls. Is there some protection method where you make a file unreadable execpt to a specific process?
Thanks so much to all who help, helped, will helped, and will have helped.
[smile]
Levi
Thanks so much to all who help, helped, will helped, and will have helped.
[smile]
Levi
Quote:
Original post by levjs
Is there some protection method where you make a file unreadable execpt to a specific process?
Maybe if you use CreateFile() to open the file and specify dwShareMode as 0. You'll have to leave the file open for as long as you dont want others to access it.
This however, wont stop people. You can always grab one of the nice programs from Sysinterals, kill the file handle owned by your program, then rename the temp file right under you.
If you make a file on the user's computer while running as that user then the user can do whatever they want with the file.
Windows needs exclusive access to a file it's executing, since it doesn't have to load all of the executable into memory to execute it. It has the right to load parts of the file at any time during execution.
Modifying the file, which includes encryption which requires exclusive access, while running would give disastrous results.
I'm unsure, but I believe that the Windows API has some kind of temporary file creation, which would delete the file automagically when all handles are removed to it.
Modifying the file, which includes encryption which requires exclusive access, while running would give disastrous results.
I'm unsure, but I believe that the Windows API has some kind of temporary file creation, which would delete the file automagically when all handles are removed to it.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement