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

Help with Injecting Virus

Started by PixelFox, 11 April 2015 - 10:51 PM
PixelFox #1
Posted 12 April 2015 - 12:51 AM
I'm making a virus for learning purposes, and I can't inject the disks "startup" file into the "startup" file of the computer. I MEAN WHEN THE DISK IS OUT OF THE DISK DRIVE IT STILL WORKS.
I also want to know how to make it so people can not use Ctrl+T to get out of it.

Here is the code:

term.clear()
term.setCursorPos(1, 1)
print("CraftOS 1.7")
term.write("> ")
while true do
read()
print("No such program")
term.write("> ")
end
Edited on 11 April 2015 - 11:10 PM
KingofGamesYami #2
Posted 12 April 2015 - 01:08 AM
First off, we don't promote malicious code on the forums. However, I can answer your questions:

1) You don't need to inject the disks startup. Just place the disk in, ctrl+r the computer, and the startup on the disk will run. If you really need to edit files, look into the fs api

2) Put this at the top of your program:

os.pullEvent = os.pullEventRaw

Please note that it is impossible to brick a computer completely, you can always use ctrl+R to reboot or ctrl+S to run the startup script. This, combined with a disk drive, allows you to bypass any startup file.
PixelFox #3
Posted 12 April 2015 - 01:10 AM
First off, we don't promote malicious code on the forums. However, I can answer your questions:

1) You don't need to inject the disks startup. Just place the disk in, ctrl+r the computer, and the startup on the disk will run. If you really need to edit files, look into the fs api

2) Put this at the top of your program:

os.pullEvent = os.pullEventRaw

Please note that it is impossible to brick a computer completely, you can always use ctrl+R to reboot or ctrl+S to run the startup script. This, combined with a disk drive, allows you to bypass any startup file.
I mean when the disk is out of the disk drive it still works.
and I know that a disk drive can bypass it, I'm making an anti-virus using that technique, unless… I copy the startup file to the disk, before it runs….
Wait…
I could copy startup from the disk into a file, and startup, then, when a disk is put in, the virus would put the copy of itself into the floppy disc, and then, it would run the file. woah, then the virus would spread. (but I wouldn't do that.)
Edited on 11 April 2015 - 11:19 PM
PixelFox #4
Posted 12 April 2015 - 01:52 AM
Huh.
Lyqyd #5
Posted 12 April 2015 - 02:04 AM
We don't help with malicious code.