How can I prevent a user from editing the time in a DOS console window?

Bye Tim
Posted on 2001-10-31 03:44:54 by Tim.2001
A VXD would probably be one way. Get Ralph Brown's interrupt
list and find the time/date related int21h calls (I believe they should
be under int21h? Most dos stuff is ;) ). Then write a VXD to trap
access to int21, and do nothing if the service wanted is time/date
modifying functions.

Or, write a TSR that's loaded before windows, which does the same,
this will be a little easier.
Posted on 2001-10-31 04:31:29 by f0dder
wasnt there an interrupt (2Eh if I remember correctly) that intercepts all command processor commands? So if you just want to prevent the user from using "time", this approach may be better.

Posted on 2001-10-31 05:02:55 by japheth
Japheth, you'd still have to either write a VXD or launch a TSR before
windows start your way. Plus, you would have the additional job
of text parsing to do. I think simply hooking file/date modifying apis
would be the easiest :). Btw, in w9x, the win32 time functions thunk
down to 16bit dos code...
Posted on 2001-10-31 05:24:37 by f0dder
Hex edit command.com!
Not the assembly solution, but a good one...

Its a great way to stop people using DOS, just change "TIME" to 13,10,0,8 that should stop it :D

You can change CD too (that really screws up people who like to mess around in DOS, if your serious though, remember CHDIR too).

You can even change executable extensions (.BAT, .COM, & .EXE).
I've only ever done it with DOS 6 & Win3.1 to stop people messing stuff up at school, I'm not sure 9x will be quite the same, but the DOS commands will be.

Posted on 2001-10-31 05:46:44 by Mirno
Bleh, mirno :(. That's not a very elegant way to do it ;). And what
if somebody brings a floppy with command.com ?
Posted on 2001-10-31 06:06:28 by f0dder
Yeah, people REALLY like changing the time on a PC :P

As its Win9x can't they just change the time by right clicking on the clock in the system tray?

If people really want to change the system time, they always will...
But I think if people are that determined to mess with your PC system time is least of your worries!


P.S. Changing the DOS commands was sooo funny back in the days when you had to use DOS....
Posted on 2001-10-31 06:42:30 by Mirno

I am glad to see there are still a few REAL men left who can code in hex. :tongue:

Its been too long since I patched command.com but I do remember running DOS 6.5 for a while when 6.22 had just been released. Somewhere in the dim distant past I remember an additional command in command.com that was never documented.


Posted on 2001-10-31 17:56:09 by hutch--