This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Stormkrow's profile picture

[Question]Protect against Ctrl+R and saving a password for future use

Started by Stormkrow, 04 June 2012 - 09:30 AM
Stormkrow #1
Posted 04 June 2012 - 11:30 AM
So i wanna know if anyone knows how to protect the startup program from a Ctrl+r to stop viruses?

Then also does anyone know how to make a program ,that will ask you for a password , when you have activated it for the first time or when there is no password stored? So from there next time you boot your pc it will ask for that password?

Please lemme know!

Thanks
my_hat_stinks #2
Posted 04 June 2012 - 02:56 PM
There is no way to override ctrl+R or ctrl+S


For the password thing, save your password to a file. Make the script check if the file exists, and if it has a password
If it doesn't, run a function to get a new password

You'll want to use the filesystem api for it
Lolgast #3
Posted 04 June 2012 - 03:06 PM
Preventing ctrl+r or ctrl+s isn't really needed. The computer will run the startup program again when it's shutdown/rebooted.
my_hat_stinks #4
Posted 04 June 2012 - 03:14 PM
Preventing ctrl+r or ctrl+s isn't really needed. The computer will run the startup program again when it's shutdown/rebooted.

Unless someone puts a disk drive next to it

Any computer the end user can use is easily overridden :P
Stormkrow #5
Posted 04 June 2012 - 04:35 PM
Ok well i can only get up to the "if a file exists part"
How would i check if that file has a script stored that i want?
and if it doesnt how would i manage to make it so that it will create one that i can access?

Sorry for inconvenience, i've sat for an hour with nothing working so far
D3matt #6
Posted 04 June 2012 - 06:05 PM
Preventing ctrl+r or ctrl+s isn't really needed. The computer will run the startup program again when it's shutdown/rebooted.

Unless someone puts a disk drive next to it

Any computer the end user can use is easily overridden :)/>/>
You can either use a modified rom that has a disk boot password (there's one laying around here somewhere), or put a hidden disk drive behind the computer with the startup program on it. This should take precedence over any newly added disks. Or you could include in your startup file an event that catches "disk" events and automatically ejects the disk if it contains a file named startup, although that one could be circumvented by shutting it down first.
Lolgast #7
Posted 04 June 2012 - 07:38 PM
Preventing ctrl+r or ctrl+s isn't really needed. The computer will run the startup program again when it's shutdown/rebooted.

Unless someone puts a disk drive next to it

Any computer the end user can use is easily overridden :)/>/>
You can either use a modified rom that has a disk boot password (there's one laying around here somewhere),
Yup, it's this one: http://www.computercraft.info/forums2/index.php?/topic/103-stop-disk-booting/
D3matt #8
Posted 04 June 2012 - 10:57 PM
Yes, that one. Thanks for finding it. Only problem with it is that if somebody manages to terminate your program somehow they can make a virus that's impossible to clean of an infection because you can't disk boot to fix it.