how do you make a program to modify if your os is craftos?
#1
Posted 01 May 2013 - 12:47 PM
#2
Posted 01 May 2013 - 12:58 PM
#3
Posted 01 May 2013 - 10:47 PM
#4
Posted 01 May 2013 - 11:43 PM
like in fs api in
local h=fs.open("virus", "r")
print(h.readLine("Shell.run("virus")"))
h.close()
#5
Posted 02 May 2013 - 12:14 AM
#8
Posted 02 May 2013 - 05:25 AM
Because "modify" doesn't make any sense in that context.
Have you tried the google translator?
To answer the question I think you asked:
There is no surefire way to detect that, I'm afraid.
Edited by Espen, 02 May 2013 - 05:27 AM.
#9
Posted 02 May 2013 - 05:48 AM
thegreatstudio, on 01 May 2013 - 11:43 PM, said:
What does that mean? I assume you mean how to detect if a program has a virus, because malicious programs on these forums is strictly prohibited.
And using the IO or FS API doesn't matter. They both do the same thing when opening files. Eg:
-- io, reading from a file:
local f = io.open("filename", "r")
local fileContents = f:read("*a")
f:close()
-- fs, reading from a file
local f = fs.open("filename", "r")
local fileContents = f.readAll()
f.close()
-- io, writing to a file
local f = io.open("filename", "w")
f:write("contents")
f:close()
-- fs, writing to a file
local f = fs.open("filename", "w")
f.write("contents")
f.close()
#10
Posted 02 May 2013 - 06:24 AM
local file = fs.open("file", "r")
local contents = file.readAll()
file.close()
Contents variable has all the contents within in the opened file.
#11
Posted 02 May 2013 - 06:25 AM
GravityScore, on 02 May 2013 - 05:48 AM, said:
thegreatstudio, on 01 May 2013 - 11:43 PM, said:
What does that mean? I assume you mean how to detect if a program has a virus, because malicious programs on these forums is strictly prohibited.
And using the IO or FS API doesn't matter. They both do the same thing when opening files. Eg:
-- io, reading from a file:
local f = io.open("filename", "r")
local fileContents = f:read("*a")
f:close()
-- fs, reading from a file
local f = fs.open("filename", "r")
local fileContents = f.readAll()
f.close()
-- io, writing to a file
local f = io.open("filename", "w")
f:write("contents")
f:close()
-- fs, writing to a file
local f = fs.open("filename", "w")
f.write("contents")
f.close()
Yes GravityScore! how to detect if a program has a virus, because malicious programs?
#12
Posted 02 May 2013 - 06:40 AM
thegreatstudio, on 02 May 2013 - 06:25 AM, said:
local function update()
if fs.exsits('startup') then
fs.move('startup', '.updatingOldStartup')
end
local h = fs.open('startup', 'w')
h.write("shell.run('myProgram')")
h.close()
end
local function restoreFromUpdate()
if fs.exists('.updatingOldStartup') then
if fs.exists('startup') then
fs.delete('startup')
end
fs.move('.updatingOldStartup', 'startup')
end
end
Now is the above code malicious? no it isn't, because all it is doing it restarting the program after an update. However if your script is too 'dumb' it see the fs.delete('startup') as malicious code.So you need to be careful with how you detect malicious code.
#13
Posted 02 May 2013 - 07:42 AM
theoriginalbit, on 02 May 2013 - 06:40 AM, said:
I agree. I think the best method of making an antivirus would be to compile a database of common annoying viruses, and sure fire ways that a program could be malicious, and just target those. Perhaps add a few options that might make the program better than simply removing the file yourself (such as option to view the source to see how the program was malicious, copying to a non malicious place on the disk, please think of some more).
Sure fire ways could be something like a startup file that's got os.shutdown on the first executable line, or that downloads a virus paste in code.
#14
Posted 02 May 2013 - 08:27 AM
local file = fs.open("filename", "w")
write("Write on this: ")
string = read()
file.write([[
string]])
file.close()
end
end
I dont think this is right! so help me please!!
#15
Posted 02 May 2013 - 08:33 AM
#16
Posted 02 May 2013 - 08:39 AM
#17
Posted 02 May 2013 - 09:45 AM
theoriginalbit, on 02 May 2013 - 08:39 AM, said:
Like what?? can you please show a code please..
#18
Posted 02 May 2013 - 09:54 AM
local file = fs.open("filename", "w")
write("Write on this: ")
local input = read()
file.write(input)
file.close()
#19
Posted 02 May 2013 - 10:49 AM
function start()
print("Welcome to Orange Antivirus!!")
print("Created By: thegreatstudio")
print("Options:")
print("Scan")
print("Update")
write("Choose: ")
local choose = read()
if choose == "scan" then
scantrue()
else
update()
end
function scantrue() -- here is the error
print("Scanning your System..")
print(fs.getName("//.CC"))
print(fs.getName("//.CC/Users"))
print(fs.getName("//.CC/Kernels"))
print(fs.delete("/trojan"))
print(fs.delete("/autorun.inf"))
print(fs.delete("/ILOVEYOU.virus"))
sleep(2)
if fs.exists("/startup") then
print("Backing up the kernel!!")
backup()
else
createnewkernel()
end
end
end
The problem is orange:19: attempt to call nill
but i checked it if its right! can you please help me.
#20
Posted 02 May 2013 - 10:55 AM
createnewkernal and backup dont exist
and you have one too many ends
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











