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

Bypass Disk Startup

Started by Imque, 15 April 2013 - 04:16 PM
Imque #1
Posted 15 April 2013 - 06:16 PM
Hai!

How can I bypass disk startup when a disk drive is attached. Not for stopping a program but instead for my boot loader.
Spongy141 #2
Posted 15 April 2013 - 06:20 PM
I don't think you can. But there's always the Computercraft wiki :P/>
SuicidalSTDz #3
Posted 15 April 2013 - 06:21 PM
You cannot.. You would have to edit the bios :P/>
JokerRH #4
Posted 16 April 2013 - 10:25 AM
You can. If you insert a disk it will cause an event to appear. All you have to do is create a coroutine that waits for that event and then renames disk/startup to something else.
Spongy141 #5
Posted 16 April 2013 - 11:21 AM
^
No, the disk will override the computers startup, so no mater what, the computers startup wont load, as long as the disk has a file called "startup", so nothing you do to "created" computer startup file will have an affect.
Kingdaro #6
Posted 16 April 2013 - 11:27 AM
The best way to override startups from other disks is to have a startup disk on the top of the computer, then hide it somehow.
Sariaz #7
Posted 16 April 2013 - 06:41 PM
A way I've found that will fool most people but not good coders is when disk placed in disk drive if it has a startup file i eject it you can get around by shutting off computer and putting disk in while shut down, but no way to make disk startup not run unless using different disks startup as kingdaro suggested but.
JokerRH #8
Posted 17 April 2013 - 03:11 AM
^ No, the disk will override the computers startup, so no mater what, the computers startup wont load, as long as the disk has a file called "startup", so nothing you do to "created" computer startup file will have an affect.

Read my post again…Where would be the point of renaming the computer startup file on disc insertion? It should have been obvious that i meant to rename disk/startup to something like disk/notstartup
Spongy141 #9
Posted 17 April 2013 - 03:44 AM
^
*Face palm*
If someone is trying to bypass your password on your computer, and they just use a disk, what makes you think you could edit there startup files to rename itself, that is one of the dumbest ideas I have ever heard of. You would need to edit the actual startup in the rom folder so it tells the computer to load first.
theoriginalbit #10
Posted 17 April 2013 - 03:47 AM
You would need to edit the actual startup in the rom folder so it tells the computer to load first.
Nope. Not the rom/startup… rom/shell is the one that runs the disks.
the other option is to have your password system on a floppy on the top of the computer, that is the first drive checked, so any other drive is ignored.
Dlcruz129 #11
Posted 17 April 2013 - 04:09 AM
^ No, the disk will override the computers startup, so no mater what, the computers startup wont load, as long as the disk has a file called "startup", so nothing you do to "created" computer startup file will have an affect.

Read my post again…Where would be the point of renaming the computer startup file on disc insertion? It should have been obvious that i meant to rename disk/startup to something like disk/notstartup

Ctrl-S, insert disk, power on. Boom, hacked. The computer can't respond to events when it's off.
JokerRH #12
Posted 17 April 2013 - 06:47 AM
^
*Face palm*
If someone is trying to bypass your password on your computer, and they just use a disk, what makes you think you could edit there startup files to rename itself, that is one of the dumbest ideas I have ever heard of. You would need to edit the actual startup in the rom folder so it tells the computer to load first.

What are you talking about…?
If the shell runs disk/startup first that is fine if there is no disk/startup
An api that doesn't exist can't be run, right?
Spongy141 #13
Posted 17 April 2013 - 11:51 AM
^
Look either way your way wont work. If someone is trying to hack into your computer, theres a very low chance you have access to there disk/startup file, so like you said "Have the startup rename the disk/startup to something else" well you would need to add the code in the disk/startup… And this topic is about bypassing the disks startup..
Sariaz #14
Posted 17 April 2013 - 12:00 PM
^
Look either way your way wont work. If someone is trying to hack into your computer, theres a very low chance you have access to there disk/startup file, so like you said "Have the startup rename the disk/startup to something else" well you would need to add the code in the disk/startup… And this topic is about bypassing the disks startup..

I think he means make a startup program that will look at floppies when they are inserted an if the floppy has a startup file rename it.
SuicidalSTDz #15
Posted 17 April 2013 - 12:06 PM
What are you talking about…?
If the shell runs disk/startup first that is fine if there is no disk/startup
An api that doesn't exist can't be run, right?
The program will error if the api is not loaded. It will call functions that are non-existent. This allows the 'hacker' access.
Spongy141 #16
Posted 17 April 2013 - 12:12 PM
^
Look either way your way wont work. If someone is trying to hack into your computer, theres a very low chance you have access to there disk/startup file, so like you said "Have the startup rename the disk/startup to something else" well you would need to add the code in the disk/startup… And this topic is about bypassing the disks startup..

I think he means make a startup program that will look at floppies when they are inserted an if the floppy has a startup file rename it.
Best way I can put this.
Sariaz #17
Posted 17 April 2013 - 01:44 PM
^
Look either way your way wont work. If someone is trying to hack into your computer, theres a very low chance you have access to there disk/startup file, so like you said "Have the startup rename the disk/startup to something else" well you would need to add the code in the disk/startup… And this topic is about bypassing the disks startup..

I think he means make a startup program that will look at floppies when they are inserted an if the floppy has a startup file rename it.
Best way I can put this.

How so, I mean its not full proof. If the computers of it wont work but it is still possible to check for floppy then rename startup to bypass.


os.pullEvent = os.pullEventRaw
while true do
e = os.pullEvent()
if e == "disk" then
  if fs.exists("disk/startup") then
   fs.move("disk/startup","disk/startu")
  end
end
end


This would do just that when a floppy is inserted if there is a startup file it renames it sure its not full proof but it does work. So if you would care to explain how my working code is imposible be my guest. :P/>
Spongy141 #18
Posted 17 April 2013 - 01:50 PM
^
So please explain how a computer startup with that code will even run if a disk have a startup file?
MudkipTheEpic #19
Posted 17 April 2013 - 01:51 PM
Alright, how to bypass ANY disk prevention.

1:Shutdown computer.

2:Insert disk.

3:Start up computer.
Spongy141 #20
Posted 17 April 2013 - 01:53 PM
Its how to bypass the disks startup, not the computers startup.
Sariaz #21
Posted 17 April 2013 - 01:53 PM
^
So please explain how a computer startup with that code will even run if a disk have a startup file?

If its already running then the code then when the disk is inserted the disk no longer has startup file like mudkip said this obviously has the flaw that if you shutdown computer then run insert it does not work but there is no way around that without changing computercraft itself or if theres someway to make ctrl+s not work.
Espen #22
Posted 17 April 2013 - 01:54 PM
@Sariaz:
I'll try to explain why it won't work:
If the disk is in the drive when the computer reboots, then it will boot from the disk.
When the computer boots up bios.lua controls the boot-process.
Per default disk-booting has a higher priority than booting from the computer.
So no matter what program you have in your computer's startup file, a disk-boot will always have a higher priority.

The only way to change that is to change the bios.lua

Edit: Ninja'd by yourself.^^
It seems you understand it now. :)/>
Sariaz #23
Posted 17 April 2013 - 02:04 PM
I understand how startup works and how disks run startup instead my point was that spongy said you cant detect a disk and rename the startup in no uncertain terms so I made code that did exactly that.

This was one really big communication error wasn't it sorry for any annoyance or aggravation cause to lack of communication

Also +1 to espen for good explanation and trying to help with this whole mess.
Edited on 17 April 2013 - 02:53 PM
Spongy141 #24
Posted 17 April 2013 - 04:19 PM
^
BUT the disks startup will always override the computers startup, which I'm guessing would be your code, so it will and without doings kings way, will not work.
Sariaz #25
Posted 17 April 2013 - 04:50 PM
^
BUT the disks startup will always override the computers startup, which I'm guessing would be your code, so it will and without doings kings way, will not work.

Spongy it comes down to weather they are smart person or average person if average then they usually put disk in first i have found then reboot if they put disk in before shutting down then my code runs before the reboot and therefore no startup on disk when rebooted. This is the point im making it is possible to do what I'm saying if they put disk in before shutting down computer therefore it is possible. Also if you can do kings way you can also just hide computer then you cant force reboot anyways so its a nul point. I get it spongy that if they do it properly my code will work but when you say it is impossible to to something consider all instances.
Sariaz #26
Posted 17 April 2013 - 04:52 PM
@ imque hope in all the arguing and such you found a way to bypass the disk that will work for you if you didn't let us know because someone should be able to figure out something.
MudkipTheEpic #27
Posted 17 April 2013 - 04:57 PM
Edit: Oops derp
Spongy141 #28
Posted 17 April 2013 - 05:01 PM
@ imque hope in all the arguing and such you found a way to bypass the disk that will work for you if you didn't let us know because someone should be able to figure out something.
Well its obvious you haven't used computercraft that long, since in fact a disks startup will and probably always (When I say probably I mean that dan probably wont change it) start before the computers startup, so in fact your code if named startup on the computer, will do nothing to the disks startup file. Try it, if I'm wrong then I'll leave this forums forever, and I'm making such a statement because I know I am right.
Dlcruz129 #29
Posted 17 April 2013 - 05:05 PM
There is no way to bypass disk startup without editing the rom. Period. It doesn't matter if you have extremely complex code on the computer's startup file, it will never run if the computer finds a disk startup first.
Spongy141 #30
Posted 17 April 2013 - 05:19 PM
There is no way to bypass disk startup without editing the rom. Period. It doesn't matter if you have extremely complex code on the computer's startup file, it will never run if the computer finds a disk startup first.
Thank you. My point exactly.
Sariaz #31
Posted 17 April 2013 - 05:20 PM
My point is not that disks don't run before computers.

Correct me if I'm wrong but if i have a start up program on a loop to do something and I insert a disk with a startup program I have to then reboot the computer before the disks startup will run, or does a program named startup on a disk automatically run just by having the disk inserted into the drive and nothing else? First before continuing figure out weather you agree that I would have to reboot to have the disk's startup file run.

Assuming you agree wouldn't it be true in the time it takes after putting in the disk to exit the disk drive gui open the computer and reboot the code running on the computer already will have renamed the disks startup file so when I then reboot the disk will not have a startup file therefore my code will run. Now do you agree with this?

Lastly I understand your point that if I first shut off the computer then put my disk in before turning back on the computer my code would not run.

It all comes down to weather or not the disk is inserted while the computer is running or not. If it is inserted while shutdown you are correct if it is inserted while computer is on I'm correct.
If you think you are correct even while computer is running when you insert the floppy I will make a video of me running my code and inserting disk while computer is running if you like to see who is right.
Spongy141 #32
Posted 17 April 2013 - 05:31 PM
Most of the time the computer is off while you put in the disk, at least if your not stupid, so yes, if the computer is on and detecting a disk then it could rename it, but if someone sees a computer not responding, they will see that something is up, OR if there smart enough, they will bypass that by shutdown the computer first.
Sariaz #33
Posted 17 April 2013 - 05:38 PM
^
Look either way your way wont work. If someone is trying to hack into your computer, theres a very low chance you have access to there disk/startup file, so like you said "Have the startup rename the disk/startup to something else" well you would need to add the code in the disk/startup… And this topic is about bypassing the disks startup..

I think he means make a startup program that will look at floppies when they are inserted an if the floppy has a startup file rename it.
Best way I can put this.

As you can see in the quote you said it was impossible to detect a floppy and rename startup my only point was that it is possible under certain circumstances a smart person will not let happen. Although you would be surprised by the number of people that don't do this.
Imque #34
Posted 17 April 2013 - 06:42 PM
In the poccess of all of this I have found:
  • A computer wil boot from the disk drive even if the disk was inserted while the computer was turned off.
  • To get a computer to boot from a disk drive you need to "force" it (Edit BIOS, Fake shutdown, etc…)
I have left my project until further support for this is added. (Cloudy..)


Spoiler
Cloudy #35
Posted 17 April 2013 - 08:41 PM
This is intended behaviour and isn't going to change.
Espen #36
Posted 17 April 2013 - 10:20 PM
In the poccess of all of this I have found:
  • A computer wil boot from the disk drive even if the disk was inserted while the computer was turned off.
  • To get a computer to boot from a disk drive you need to "force" it (Edit BIOS, Fake shutdown, etc…)
I have left my project until further support for this is added. (Cloudy..)
???
Do you mean: to get a computer to boot ONLY from the disk drive?
Because just being able to boot from there is possible without any modifications.