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

Format - Format your computer

Started by logsys, 01 May 2014 - 07:22 AM
logsys #1
Posted 01 May 2014 - 09:22 AM
Format Utility

A really simple utility! Just run and it deletes everything!(Except Read-Only files)
Good for OS uninstall and hidden files erasing(including virus)

Download: pastebin run ze5FEEU7

THIS UTILITY IS USELESS:
Issue "rm *" in the shell to do the same thing as this.
The utility only stays in forums because it can be useful for some users to learn. Thanks for your support
Edited on 21 May 2014 - 05:39 PM
wilcomega #2
Posted 01 May 2014 - 11:58 AM
remove label
break computer
place computer

no http required.
i dont mean to be negative but to tyhis is pretty useless,
BUT its cool anyways :)/>
logsys #3
Posted 01 May 2014 - 12:04 PM
break will change ID's, for some rednet stuff you might not want that
Konlab #4
Posted 18 May 2014 - 12:14 PM
Cool, now I don't have to write my own OS-uninstaller (you saved up my 2 minutes).
ardera #5
Posted 18 May 2014 - 12:35 PM
break will change ID's, for some rednet stuff you might not want that
well that rednet stuff is deleted anyway then.
I never needed this, no one ever needed this, this shouldn't be even called a program. You think people are gonna search your forum thread to download some code snippet to erase all their data? No. No one will. Your program can be replicated in 10 seconds.
Konlab #6
Posted 18 May 2014 - 05:15 PM
break will change ID's, for some rednet stuff you might not want that
well that rednet stuff is deleted anyway then.
I never needed this, no one ever needed this, this shouldn't be even called a program. You think people are gonna search your forum thread to download some code snippet to erase all their data? No. No one will. Your program can be replicated in 10 seconds.
In 10 seconds?
Download is 2 seconds :-)
But you're right, this program is useless.
logsys #7
Posted 18 May 2014 - 10:22 PM
break will change ID's, for some rednet stuff you might not want that
well that rednet stuff is deleted anyway then.
I never needed this, no one ever needed this, this shouldn't be even called a program. You think people are gonna search your forum thread to download some code snippet to erase all their data? No. No one will. Your program can be replicated in 10 seconds.
In 10 seconds?
Download is 2 seconds :-)
But you're right, this program is useless.
I built this program for newbies who don't know this, you already were one of them, weren't you?
apemanzilla #8
Posted 19 May 2014 - 01:52 PM
Format Utility

A really simple utility! Just run and it deletes everything!(Except Read-Only files)
Good for OS uninstall and hidden files erasing(including virus)

Download: pastebin run ze5FEEU7

A well coded virus could easily hide itself and prevent deletion of itself.
logsys #9
Posted 19 May 2014 - 03:28 PM
Format Utility

A really simple utility! Just run and it deletes everything!(Except Read-Only files)
Good for OS uninstall and hidden files erasing(including virus)

Download: pastebin run ze5FEEU7

A well coded virus could easily hide itself and prevent deletion of itself.

Those virus would not be able to be removed in anyway, but deleting on the world folder or just breaking the computer, although that will change the ID as mentioned before
apemanzilla #10
Posted 19 May 2014 - 04:50 PM
Format Utility

A really simple utility! Just run and it deletes everything!(Except Read-Only files)
Good for OS uninstall and hidden files erasing(including virus)

Download: pastebin run ze5FEEU7

A well coded virus could easily hide itself and prevent deletion of itself.

Those virus would not be able to be removed in anyway, but deleting on the world folder or just breaking the computer, although that will change the ID as mentioned before
Not true. A smart user could easily remove said virus with a disk.
logsys #11
Posted 19 May 2014 - 05:18 PM
Format Utility

A really simple utility! Just run and it deletes everything!(Except Read-Only files)
Good for OS uninstall and hidden files erasing(including virus)

Download: pastebin run ze5FEEU7

A well coded virus could easily hide itself and prevent deletion of itself.

Those virus would not be able to be removed in anyway, but deleting on the world folder or just breaking the computer, although that will change the ID as mentioned before
Not true. A smart user could easily remove said virus with a disk.

Thats also true, but let's not consider a disk as a method to engage the "anti-virus" cause there is no possible way of tricking the anti-virus, unless you know what anti-virus you are dealing with and then possibly mutate you code so it doesn't detect it.. also, if it had an AI, it could manage to not being deleted
Edited on 19 May 2014 - 03:20 PM
apemanzilla #12
Posted 19 May 2014 - 05:30 PM
Thats also true, but let's not consider a disk as a method to engage the "anti-virus" cause there is no possible way of tricking the anti-virus, unless you know what anti-virus you are dealing with and then possibly mutate you code so it doesn't detect it.. also, if it had an AI, it could manage to not being deleted
1. You mean virus.
2. If you boot it from a disk with a blank startup, the virus can't do crap unless you run it manually.
3. It can't touch your code unless you start it manually, see above.
4. Why would there be an AI again?
Edited on 19 May 2014 - 03:31 PM
logsys #13
Posted 19 May 2014 - 05:41 PM
Thats also true, but let's not consider a disk as a method to engage the "anti-virus" cause there is no possible way of tricking the anti-virus, unless you know what anti-virus you are dealing with and then possibly mutate you code so it doesn't detect it.. also, if it had an AI, it could manage to not being deleted
1. You mean virus.
2. If you boot it from a disk with a blank startup, the virus can't do crap unless you run it manually.
3. It can't touch your code unless you start it manually, see above.
4. Why would there be an AI again?
1. True
2. Also true, but again, that overrides the main startup, where in a normal computer(irl) it doesn't.
3. "mutate your code so it doesn't detect it"
4. The AI would mutate the code so, if ran a anti-virus(instead of a blank startup) it would survive the "murder" attempt
Edited on 19 May 2014 - 03:42 PM
apemanzilla #14
Posted 19 May 2014 - 08:22 PM
Thats also true, but let's not consider a disk as a method to engage the "anti-virus" cause there is no possible way of tricking the anti-virus, unless you know what anti-virus you are dealing with and then possibly mutate you code so it doesn't detect it.. also, if it had an AI, it could manage to not being deleted
1. You mean virus.
2. If you boot it from a disk with a blank startup, the virus can't do crap unless you run it manually.
3. It can't touch your code unless you start it manually, see above.
4. Why would there be an AI again?
1. True
2. Also true, but again, that overrides the main startup, where in a normal computer(irl) it doesn't.
3. "mutate your code so it doesn't detect it"
4. The AI would mutate the code so, if ran a anti-virus(instead of a blank startup) it would survive the "murder" attempt
2. This is computercraft, and a disk with a startup file ALWAYS takes priority over the built in startup. So, make a new disk with a blank computer, attach it, and boot the computer and you've got normal shell with unrestricted access again.
3. Hiding files from the code involves overriding the fs and io APIs, which is not reboot-safe so it requires code to be re-run very time it boots. If you boot from an uninflected disk, you don't have that problem.
4. That wouldn't be an AI. An AI learns as it is exposed to new things generally. This is simply an automated task that runs whenever a disk is connected.

Additionally, running "rm *" in the shell should accomplish the same task as this.
Edited on 19 May 2014 - 06:23 PM
logsys #15
Posted 19 May 2014 - 09:54 PM
Thats also true, but let's not consider a disk as a method to engage the "anti-virus" cause there is no possible way of tricking the anti-virus, unless you know what anti-virus you are dealing with and then possibly mutate you code so it doesn't detect it.. also, if it had an AI, it could manage to not being deleted
1. You mean virus.
2. If you boot it from a disk with a blank startup, the virus can't do crap unless you run it manually.
3. It can't touch your code unless you start it manually, see above.
4. Why would there be an AI again?
1. True
2. Also true, but again, that overrides the main startup, where in a normal computer(irl) it doesn't.
3. "mutate your code so it doesn't detect it"
4. The AI would mutate the code so, if ran a anti-virus(instead of a blank startup) it would survive the "murder" attempt
2. This is computercraft, and a disk with a startup file ALWAYS takes priority over the built in startup. So, make a new disk with a blank computer, attach it, and boot the computer and you've got normal shell with unrestricted access again.
3. Hiding files from the code involves overriding the fs and io APIs, which is not reboot-safe so it requires code to be re-run very time it boots. If you boot from an uninflected disk, you don't have that problem.
4. That wouldn't be an AI. An AI learns as it is exposed to new things generally. This is simply an automated task that runs whenever a disk is connected.

Additionally, running "rm *" in the shell should accomplish the same task as this.
3. If you programmed you virus to appear to be a program that wouldn't be suspicious, if a anti-virus was ran it would not detect, because the anti-virus ill check if the code matches, changing a bit will confuse the anti-virus.
5…. I didn't know that, but its always a challenge to make this program
CometWolf #16
Posted 19 May 2014 - 10:48 PM
3. If you programmed you virus to appear to be a program that wouldn't be suspicious, if a anti-virus was ran it would not detect, because the anti-virus ill check if the code matches, changing a bit will confuse the anti-virus.
This would still require you to override the fs API, meaning you'd be better off just preventing acess to it through fs at all.
apemanzilla #17
Posted 20 May 2014 - 01:44 PM
3. If you programmed you virus to appear to be a program that wouldn't be suspicious, if a anti-virus was ran it would not detect, because the anti-virus ill check if the code matches, changing a bit will confuse the anti-virus.
This would still require you to override the fs API, meaning you'd be better off just preventing acess to it through fs at all.
…and to override the fs API you would need to have code run before the user starts messing with it, which means a disk with a blank startup still comes out on top.
Konlab #18
Posted 21 May 2014 - 07:14 AM
Just unload fs API:
os.unloadAPI("fs")
And unload os API:
os.unloadAPI("os") (XD)
And done… You can't reboot the computer, the edit don't works, you can't do anything to delete it…
theoriginalbit #19
Posted 21 May 2014 - 10:05 AM
Just unload fs API:
os.unloadAPI("fs")
And unload os API:
os.unloadAPI("os") (XD)
And done… You can't reboot the computer, the edit don't works, you can't do anything to delete it…
Disk drive on top with a black startup disk. bypassed.
apemanzilla #20
Posted 21 May 2014 - 01:26 PM
Also, you could attempt to override the top level coroutine to get access to this functions again (unless I'm forgetting how os.unloadAPI works)
Konlab #21
Posted 21 May 2014 - 01:35 PM
For me os.unloadAPI worked.
apemanzilla #22
Posted 21 May 2014 - 01:39 PM
For me os.unloadAPI worked.
Not what I meant, I meant I couldn't remember if it unloaded the APIs globally or for the current environment only.
Konlab #23
Posted 21 May 2014 - 01:41 PM
Globally, naturally :-)
os.loadAPI loads the API globally
os.unloadAPI unloads the API globally
logsys #24
Posted 21 May 2014 - 01:45 PM
Globally, naturally :-)
os.loadAPI loads the API globally
os.unloadAPI unloads the API globally
The virus I found has to do with that, but it can't be bypassed after correctly triggered(log out and log in or chunk unloading should work to bypass). It also can prevent other computers from turning on even. So I guess, now that I am thinking, the virus I found will, probably, not be getting fix, just the vm crash, which disabled the bypass
apemanzilla #25
Posted 21 May 2014 - 01:49 PM
Globally, naturally :-)
os.loadAPI loads the API globally
os.unloadAPI unloads the API globally
Are you sure? By globally I mean across all function environments. Because, arguably, as long as any one environment has access to the unloaded functions and the current one has access to getfenv, setfenv, and pcall, you can always get access to the APIs again.
Konlab #26
Posted 21 May 2014 - 02:02 PM
If you unload an API that computer can't use that API to next API loading.
I don't know what is getfenv or setfenv, but as I know pcall() is a Lua function, and as I know you can't unload Lua's functions.
apemanzilla #27
Posted 21 May 2014 - 02:05 PM
If you unload an API that computer can't use that API to next API loading.
I don't know what is getfenv or setfenv, but as I know pcall() is a Lua function, and as I know you can't unload Lua's functions.
You're not understanding it. If you unload it for only that ENVIRONMENT, the coroutine or function cannot access it but others can. If you unload it GLOBALLY, NOTHING can access it.

To "unload" a function you can just set it to nil.
Konlab #28
Posted 21 May 2014 - 02:11 PM
One ENVIRONMENT is one terminal?
apemanzilla #29
Posted 21 May 2014 - 02:12 PM
One ENVIRONMENT is one terminal?
Absolutely not. On environment is one set of functions for a thread or function to use.
Konlab #30
Posted 21 May 2014 - 02:12 PM
Sorry, I thought Environment = Integrated Development Environment
apemanzilla #31
Posted 21 May 2014 - 02:15 PM
Sorry, I thought Environment = Integrated Development Environment
No, and even if it did it would still have nothing to do with a CC terminal.
Konlab #32
Posted 21 May 2014 - 02:16 PM
Then if you unload an API globally than you delte it?
theoriginalbit #33
Posted 21 May 2014 - 02:16 PM
-snip unload in env statements-
doesn't matter. run this code

print(getfenv(0)['fs']) --# bios.lua env
print(getfenv(1)['fs']) --# shell env
print(getfenv(2)['fs']) --# program env
getfenv(2)['fs'] = nil
print(getfenv(0)['fs'])
print(getfenv(1)['fs'])
print(getfenv(2)['fs'])
doesn't matter what env you nil it, whether its the bios env or the program env, its gone. why do you think that when newbies override a function like read the shell and/or bios gets effected?
Edited on 21 May 2014 - 12:17 PM
apemanzilla #34
Posted 21 May 2014 - 02:26 PM
-snip unload in env statements-
doesn't matter. run this code

print(getfenv(0)['fs']) --# bios.lua env
print(getfenv(1)['fs']) --# shell env
print(getfenv(2)['fs']) --# program env
getfenv(2)['fs'] = nil
print(getfenv(0)['fs'])
print(getfenv(1)['fs'])
print(getfenv(2)['fs'])
doesn't matter what env you nil it, whether its the bios env or the program env, its gone. why do you think that when newbies override a function like read the shell and/or bios gets effected?
I'd also want to point out that this should only happen because tables are passed via pointer. If you take a hard copy of the table, it should be safe from environment hacks like the above.
ardera #35
Posted 21 May 2014 - 02:47 PM
I'd also want to point out that this should only happen because tables are passed via pointer. If you take a hard copy of the table, it should be safe from environment hacks like the above.
Thats true, tables are passed byref, and it's good that they're passed like that. Any type of synced thing would require global environments otherwise, which CC doesn't like it seems. (Global table is "read-only" (rawset!), has a protected metatable, every program modifies it's own environment instead of _G, and the environment has _G as an index)

As the "developer" said this program is for cc noobs: People are using CC because they want to program. Not because they want stuff to delete their virusses, or because they want to watch their OS doin' nothing (many OSes have the same usefulness as this program)
apemanzilla #36
Posted 21 May 2014 - 03:08 PM
I'd also want to point out that this should only happen because tables are passed via pointer. If you take a hard copy of the table, it should be safe from environment hacks like the above.
Thats true, tables are passed byref, and it's good that they're passed like that. Any type of synced thing would require global environments otherwise, which CC doesn't like it seems. (Global table is "read-only" (rawset!), has a protected metatable, every program modifies it's own environment instead of _G, and the environment has _G as an index)

As the "developer" said this program is for cc noobs: People are using CC because they want to program. Not because they want stuff to delete their virusses, or because they want to watch their OS doin' nothing (many OSes have the same usefulness as this program)
And the functionality of this program can be recreated with five key presses in CraftOS anyways.
logsys #37
Posted 21 May 2014 - 07:36 PM
Being that way, I will change the home screen to say a possibility instead of downloading all of this, after that, I might as to lock this thread.
Cranium #38
Posted 22 May 2014 - 03:58 AM
Locked upon request.
For future reference, logsys, please use the report option on your topic, instead of PM'ing a moderator.