Link to home
Start Free TrialLog in
Avatar of mmilan
mmilan

asked on

Automatic start program

Can I make program which will be start evry time when computer is turn on (I am using Windows 98 as operating system, and don't tell me to put command in AUTOEXEC.BAT).

Thank's
Avatar of kschang
kschang

So WIN.INI or STARTUP group is not acceptable either?
Avatar of mmilan

ASKER

No. I want to make program which will be start before Windows is start. Something like starting AUTOEXEC.BAT.
You need to register your program as a SERVICE.
You can use a program that comes in the NT resource kit called SRVANY.EXE.   For a detailed explanation, check out
http://acs.neu.edu/~mcknight/srvany.html
Avatar of mmilan

ASKER

I asked about Windows 98 or MS-DOS, not Windows NT!
Is it a program that should stay resident, or something like password checking that should be executed, and when terminated the windows is starting?


You should put the address of your program in the registry under the key (string):
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\Run\Whatevernameyouwish

There is no other way.
There is not such a thing as there is no other way :-)
Okay, this is the easiest (?) way to make a program start up before other Win-programs, and it can't be removed by a user, like when it was in the folder Startup. Furthermore, it's not user-dependent.
The only catch is that you can't edit the registry with TP. You need (an installer in )Delphi to do that.
BEFORE Windows start... Like a boot sector virus?  :-)
Avatar of mmilan

ASKER

Yes kschang something like this, but it's not virus. I want to make password protection.
Avatar of simonet
Add your program to the Registry (Win 9x, but not NT), under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices

The name of the entry will be any name you want to give, like "PwdChecker" and the value of the entry will be the fully qualified name of your EXE. This way your program will run *before* the is given access to the password dialog box.

Yours,

Alex
Athena's Place: http://www.bhnet.com.br/~simonet


Avatar of mmilan

ASKER

People I know all that you said. Lets little change question: MY PROGRAM IS WRITTEN IN TURBO PASCAL FOR DOS, AND I WANT TO START IT FROM MS-DOS (FOR EXAPLE MS-DOS 6.0). HOW, HOW CAN I DO THAT?
Add it to config.sys then.

Alex
Avatar of mmilan

ASKER

I know that. I want to make something that work like boot sector virus. Do you know how?
Ohohoho.. now you said what you really want!!! Yes I know how to do that, but that's not the kinda information I give away. First of all, I don't know what your intentions are, and, second, even if I were willing to give away this sort of information, 200 points wouldn't pay for it.

This is very dangerous information and, if fallen in wrong hands, can be quite destructive. See what a guy did when he learned how to create word macros? He wrote Melissa. Now, boot sector initialization is a lot more delicate issue.

Well, sorry, but I am not answering this one.

Alex
Avatar of mmilan

ASKER

Hey man, you think if I want to write virus I ask you for help. You are crazy. I want to make program for password protection of enter if computer (if I start my protection program from AUTOEXEC.BAT or something like that people can easy bypass it. I am looking for better way of starting protection program and I thought that way I said is good. Do you have any other idea? If so, let me know!

Thank's.
  OK, this is possible. You need to change file Command.com in Win95. Using a little assembler. You add something like a "call" function to jump to another address. This command takes at least 6 bytes (I'm sure how large it is). You also need to move the first 6 bytes to the new address. This is a structure:
 + Old Command.com:

0100: PUSH ES  
....: POP  SS
....: ...
....: ...
....: ...

 + New Command.com:
   
0100: CALL ????                ; "????" is the new address that
....: ...                      ; you can make your own function to call a .exe file
....: ...
....: ...

????: ...                      ; Now, you can do your work
      ...                      ; Remember that you need to do anything again before
      ...                      ; return to that main part of Command.com

   That was what I know. I'm so lazy to write the whole thing. This is the hard one. You must spend a lot of time to finish it.
Good luck.
>>...if I start my protection program from AUTOEXEC.BAT or something like that people can easy bypass it...

You're right about that, but:

>>You should put the address of your program in the registry under the key (string):         HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\Run\Whatevernameyouwish

Then when before windows start somebody can press "Shift" key or go to F8 "safe mode" and bye bye your proggy

What's the matter with you people, if you want password protection go to setup and place a password after turn on the machine. Now if you're obstinate in do it the other way, the god help you.

PS: why the heck did you post this question in here, when you could post it in the windows 95 section???
No need to muck with command.com. BOOT SECTOR contains a program that bootstraps the rest of the O/S. If you modify the boot sector to load YOUR program first (obviously this program would have to be QUITE SMALL), THEN pass control to COMMAND.COM then you would accomplish what you want.

HOWEVER, it's still quite easy to bypass this: boot disk.
Suppose he/she have a disk of more than 2 (and fractions) Gb. as we know those disk can be accessed.
Avatar of mmilan

ASKER

For whatboy: I am making program in Turbo PAscal 6.0! Is this good reason?
Avatar of mmilan

ASKER

Hey kschang, do you know how can I do that?
>>Suppose he/she have a disk of more than 2 (and fractions) Gb. as we know those disk can be accessed.

What i mean is, if you or who ever intend to boot before the OS (DOS v7.0 or win95 in the same case) he/she has to do a routine for the proggy to see all the drive (in the case the drive is more than 2.xxGb). or am i wrong???

>>...This is very dangerous information and...

Hey man cut the crap, the only morons how do virus are sick people who have no other thing to do in life but to do what they do, Be a virus. and i don't think mmilan is a frustrated geek (well may be he/she is frustrated but i don't think he/she is a geek).

does any body know of a word to write insted of "HE/SHE"???
I use s/he. :-)  As for HOW you write a program like that... You got the right equipment. However, you need a few months studying the DOS interrupts and DOS API calls, and boot sector, and some such. Sorry, can't tell you more than that. :-) Though books like "DOS internals" or soemthing like that should help.

And finally... This can EASILY be bypassed by a boot disk... Wait, I already said that...
>This can EASILY be bypassed by a boot disk...

Right. Not to mention FDISK /MBR.
Avatar of mmilan

ASKER

Any other suggestion for making protection of enter to system?
 Why don't you use CMOS to protect your computer if you want to do that ??
Quanghoc is right; if what you're looking for is a password protection system, ¿why don't use the BIOS password to assure nobody will access the machine?.

With that, no matter where you attempt boot from, it's always activated just BEFORE booting process starts, and the only way to remove its protection is by disconnecting the battery, which implies to open the machine and work enough there.
Avatar of mmilan

ASKER

It's very easy to bypass CMOS password! Just to switch on jumper on main board :-)
 If so, Why don't you take your hard-disk out when you go away from your computer ? There are thousands of ways to protect. Actually, you can delete some important file of Win98. Nobody know that ...
>>Why don't you use CMOS to protect your computer if you want to do that ??

>>Quanghoc is right; if what you're looking for is a password protection system...

Hey people i think i already told that...

>>What's the matter with you people, if you want password protection go to setup and place a password after turn on the machine. Now if you're obstinate in do it the other way, the god help you.

>>It's very easy to bypass CMOS password! Just to switch on jumper on main board :-)

Some machines came with locks, if not, and you really want some protection the try putting a "MASTER" lock, those locks are tough to break.
>>It's very easy to bypass CMOS password! Just to switch on
>>jumper on main board :-)

But that requires the machine to be opened, and you must deal with battery jumpers and all that. Of course, if anyone wants to access your disk, he can also remove the disk and install it on another machine. There's always a way to skip protection systems; but the goal is to make things so difficult as possible.

If it's only a acouple of files you want to protect, why don't you just encrypt them... and decrypt them again whenever you want to use them? It could be like this:
Your program forces the user to enter a password if he want those files to be readable (decrypted). if he don't enter a password the files will never be decrypted/dechiffered.


 Nobody can answer your question just only by Pascal programming.
 Nobody can answer your question just only by Pascal programming.
> HOWEVER, it's still quite easy to baypasss this: boot disk.
Not if the program encripts all the FAT/ROOT/DISK... like some virused did.
But this is much harder to achive, and information can permamently lost easily.
As previously suggested... Pick up some old DOS programming books, like DOS internals, Pascal System Programming, something like that. One of the old books I have was Norton's Programmer's Handbook.. :-)
I wasn't talking about encrypting the whole physical Fat sector, My suggestion was if he only had a few files wich should be protected, encrypring them is a good suggestion. Cuz then there are no bypass, you can either enter the correct password wich will decrypt the files correct, or you could choose not to enter a password wich would reasult in encrypted files. If you enter the wrong password the files will be decrypted wrong.
This is leading nowhere.

In order to protect a machine from intrusion, one can do many things. As suggested, CMOS password could be used. This can be circumvented, like the rest of the stuff.

The best thing to do if you're up to it - and Pascal is gonna get you nowhere now - is to rewrite the bootsector of your harddisk.

The new bootsector would act like the infamous OS selectors like Lilo and System Commander. Adding functionality like a password protection, and disabling access to all other disk partitions by algorithmly destroying and rebuilding parts of all partitions.

This requires a very serious amount of knowledge and understanding of the DOS internals, as well as deep knowledge of BIOS and harddisk data encoding schemes.

I think that these prerequisites are not within your grasp.

Face it: you'd better put your computer in some bunker, lock the door and throw away the key. Best solution so far is to use your CMOS password and you rejected that.

Sorry Mmilan, but I just don't think anybody can help you any further....
Chain the machine to a croc, if someone goes near it, it'll bite the head off of that sucker. Hee Hee.  =;)
 Not so funny ... Actually, there is no way to protect your computer absolutely. And the hardest way is to do with BOOT SECTOR or COMMAND.COM. If you want some source codes about this, I can send to you. But if you don't understand anything about programming with assember, these will be useless.
Hey, the croc is funny, more funny than:

>>...But if you don't understand anything about programming with assember, these will be useless.

Yo don't have HUMOR :P
>> ...like the infamous OS selectors like Lilo and System Commander.
Why infamous?? I'm using both SystemCommander and Linuxloader in the same machine!
i did't read every comment, so i don't know if it was mention. but why don't you write a small asm-prog an attach it to the bootsector? in the mbr is a call to the entry point of the bootroutine. place yout prog there and call the bootroutine from your prog.

i'll give you more information if you want.
i wrote such a prog.

-Phrator
To FuzzyLogic: Ehr, infamous might not be the correct word. I tried to say famous in superlative. EN is not my native language :)
 So, what is this ? Answer a question ???
Apology accepted ;) (and EN is not my native language too).
What's this... mmilan, you should accept someone answer or delete this ?.
 mmilan cannot delete this question. So, there is only one way : accept somebody's answer ...
I think that can write a program like COMPAQ computer. It have a partition but with strange partition code. So DOS and Windows cannot recognize that partition. ==> It is hide.

So i think that we should:
- Make a partition (about 2 MB). And it is a bootable partition (code 80). All other partition must change to new code (just partition code).
- Write a program with need a password, rewrite partition code and then restart.
- Write a program with need a password too, to change your partition (2MB) boot table for next time you start.

Is it OK?

Pff, and what an answer that is, mSH. Shame on you.

mmilan: once upon a time (no fairytale) I croshed the path of a little program called disklock. That little program does exactly what you want to achieve, only there's no source code available.

Another option: can't system commander do what you want to accomplish ? If it can, why not use it instead of writing it yourself ? Although I must say that writing such a thing yourself is quite statisfying.
Wow, this has been fun to read... i like the bunker idea
There is a special program for password protection, it's called pcpassword. It works on your partitions table and it starts before dos/win is loaded at all. If anyone will start your computer from the floppydisk he won't be able to access the hard-disk since they won't be exist for him.

If you would like to get the program, please accept the answer.

thanks.
 That was so funny when accepting answer go first and then the answer after ...
Avatar of mmilan

ASKER

I want to make program for it not to use some program :-)

Can we get rid of this thing?
Hi mmilan,

there's a wild chatting about encrypting files, hiding partitions, installing BIOS passwords, manipulating the COMMAND.COM, adding Windows registry keys, and so on ...
But I think we have just to make clear what's your intention. Do you want
 - to prevent other people from using your PC with its Windows operating system?
 - to deny users the permission to access some (perhaps private) data?
 - to make sure that nobody performs any changes to your system?
or
 - to show others that you're able to write a security program that cannot be bypassed?

Regards,
Hamilton

Or what about:

 - Take absolute control of all the machines in the world so that mmilan can be the only one who knows the passord... NOOOOOOOOOOoooooooooo·········· :P
Well I have never messed up with the Boot sector to make an application to start when you turn on your pc, but i know you have to modify it and maybe this book could be useful to you it's name is PC Intern and i'm sure it has something about dealing with the BOOT sector of a Hard Disk
You can use the original sofrware to protect you computer, try PGPDisk, www.pgpi.com
I Think what has everybody said in the past is true. there's nothing we can do to totaly take full control of your computer / system by being access by someone else If you wish to share your computer to others....

Of course you can't expect someone NOT to break your security, NOT to use your computer, NOT to read your data at the same time at one moment. (It's impossible to allow someone to use your computer and disallow someone to enter your system (by blocking him/her by password protection))

If you only try to protect some data that are confidential (means very important to you) and you wish to hide it from others but you still want other users to use your computer and its system, perhaps you could use MagicFolder that can hide directory from being accessed by someone else without Password.

This of course NOT the way to make your own program, but you can considerate this if your time is limitted. (I think MagicFolder has pretty good protection to do this )


Mmilan,

why don't you just use the config.sys to start your prog, and add as first line in you config.sys switches=/f /u or something like that, it's even better then this "before login" stuff or that Bios thing. The safest way to secure your computer is a removable hdd or secure your power supply by using a pincode.

Rob.
No no no, i insist, buy your self a CROC, a big one, no better yet a HUGE one, chained to the machine, then no one will get close by, not even you... :)
ASKER CERTIFIED SOLUTION
Avatar of htam
htam

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mmilan

ASKER

I'll give you points before I check if this work. I want to stop this discution. Thank's to all of you. It was very interesting....
 Well, this is so simple to crack, too. Don't be so hurry next time . OK !