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

The Better Boot Loader - Safe And Sound

Started by wilcomega, 06 August 2013 - 02:04 PM
wilcomega #1
Posted 06 August 2013 - 04:04 PM
hello there, i am on vacation so i have the worst campsite internet acces in the world but i just wanted to throw this out there.

today, ladies and gentelmen, i have created a pretty nice bootloader if i do say so myself,
these are the features:
- most OS's are compatable with this boot loader
- anti-hax and virus protection
- if disk/startup exists it will eject the disk and reboot in safe mode
- in safe mode the os or any other "fake" os is prevented from moving or deleting certain files*
- custom environments are possible to load any os in
- boot order, you can specify in the BIOS(wip) what the load order is
- set custom title for the load screen
- set custom picture to display(wip)
- will search for any hardware attached and give that info to the OS**
- the os will receive info if the bootloader is loaded in safe mode**
*the preventing is ment to stop viruses not to prevent the bootloader from being deleted.
**the OS can receive the information by doing the default arguments code. the only thing is that the data types are different. boolean for the safemode and table for the hardware info

that are all the features
here is the download


pastebin get JTsGLzMv startup
PLEASE NOTE THAT YOU WILL HAVE TO INSTALL AN OS FIRST OR IT WILL JUST SHUTDOWN AGIAN. YOU CAN ALSO USE A FLOPPY DISK TO PREVENT THE BOOTLOADER

thx for reading and i am still making the BIOS and improving my code
TyDoesMC #2
Posted 06 August 2013 - 08:28 PM
Wow Copy Mine Much? :o/>
wilcomega #3
Posted 07 August 2013 - 06:20 AM
Listen, I didn't even know you had one. I just wrote it and threw it at ya all.
Engineer #4
Posted 07 August 2013 - 09:09 AM
This program does not deserve its name at this point. 'the better boot loader'

Because, I created a program that runs a program, but when a global variable is made, it is going to error. This is to prevent any odd coding styles in my computer and I ran this and it said it uses global variables. I want to say that localizing your variables is better practise in my opinion. Because then, any malicious content cannot reach your program and give odd errors and stuff.
Get into locals :P/> Then it is more 'anti-hax' too.

Localize you're program, and I will give it a go after that :)/>

SpoilerFor those who are interested, this is the code that I use to prevent global variables. I do not prevent from setting to _G table, because thats pointless.
Oh, and this can be considered malicious, but I will take responsibility for this. I want to say though I use this program to find out real quick if a program acceses global files.

local args = { ... }

if fs.exists( args[1] ) then
	local f = fs.open( args[1], "r" )
	local content = f.readAll()
	f.close()
	
	local func, err = loadstring( content, args[1] )
	if not func then error( "This file does not work properly: ".. err, 0 ) end
	
	local tArgs = {}
	for k, v in pairs( args ) do
		if k ~= 1 then
			tArgs[#tArgs + 1] = v
		end
	end
	
	setfenv( func, setmetatable( {}, { __index = _G; __newindex = function( t, k, v ) error( "Program sets global variables.", 0 ) end } ))
	func( unpack(tArgs) )
else
	error( "File does not exist", 0 )
end
wilcomega #5
Posted 07 August 2013 - 01:20 PM
Yeah, thx for the feedback. I just threw this together and called it the better boot loader because I could not really come up with a good name and "better" and "boot" both start with a "b" so that's also why. It's not like I feel like mine is much better than urs. But I will work on that when I get the chance.
lifewcody #6
Posted 07 August 2013 - 01:39 PM
It works but it comes up like a virus and blinks saying "false"
Mmmmm dat virus
TyDoesMC #7
Posted 07 August 2013 - 04:28 PM
Yeah, thx for the feedback. I just threw this together and called it the better boot loader because I could not really come up with a good name and "better" and "boot" both start with a "b" so that's also why. It's not like I feel like mine is much better than urs. But I will work on that when I get the chance.

Yours Is Better Then Mine :P/>

Link: http://www.computercraft.info/forums2/index.php?/topic/14458-clean-boot-disk/page__p__138586#entry138586
Dave-ee Jones #8
Posted 08 August 2013 - 02:08 AM
How do you know it's anti-hax when you haven't even let me test it? :P/>
Good job.

EDIT: When you put os.pullEvent = os.pullEventRaw it doesn't mean it's not hackable, it just means you cannot terminate the program.
I could just run a disk program and add os.pullEvent = os.pullEventRaw and set it as startup and BOOM! Instantly got past the boot loader.
Disks have more priority than a computer with the same settings.
wilcomega #9
Posted 08 August 2013 - 04:29 AM
The booting of the disk is programmed into the rom. I am not able to change that