Jump to content




how do you make a program to modify if your os is craftos?



  • You cannot reply to this topic
62 replies to this topic

#1 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 01 May 2013 - 12:47 PM

Hey guys i need help that how do you make a program to modify if your os is craftos??? because i needed you my program. :)

#2 cogilv25

  • Members
  • 38 posts
  • LocationScotland

Posted 01 May 2013 - 12:58 PM

I'm not sure what you are asking what do you want to modify?

#3 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 01 May 2013 - 10:47 PM

i want to modify if your current os is craftos.... Because GAV doesn't compatible with craftos.

#4 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 01 May 2013 - 11:43 PM

Hi everyone! How do you make a program to modify that has a virus?? Do you use fs api or io api??

like in fs api in

local h=fs.open("virus", "r")
print(h.readLine("Shell.run("virus")"))
h.close()


#5 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 02 May 2013 - 12:14 AM

How to copy a code using fs api??

#6 Zoinky

  • Members
  • 144 posts
  • LocationWellington, New Zealand

Posted 02 May 2013 - 12:27 AM

You can use fs.copy().

#7 Sora Firestorm

  • Members
  • 89 posts

Posted 02 May 2013 - 12:30 AM

First off, that is so amazingly vague, I have no clue what you want to be accomplished, but I'll take a guess.

Use the fs.copy function.

EDIT : Niiiinjas!

#8 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 02 May 2013 - 05:25 AM

You mean you want to detect if someone just uses the vanilla CraftOS?

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 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 02 May 2013 - 05:48 AM

View Postthegreatstudio, on 01 May 2013 - 11:43 PM, said:

make a program to modify that has a virus

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 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

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 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 02 May 2013 - 06:25 AM

View PostGravityScore, on 02 May 2013 - 05:48 AM, said:

View Postthegreatstudio, on 01 May 2013 - 11:43 PM, said:

make a program to modify that has a virus

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 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 May 2013 - 06:40 AM

View Postthegreatstudio, on 02 May 2013 - 06:25 AM, said:

Yes GravityScore! how to detect if a program has a virus, because malicious programs?
Well that is a very hard question to answer. Why? Because you need to detect particular code that could be malicious. However what to class as malicious. For example this is part of my update script...
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 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 02 May 2013 - 07:42 AM

View Posttheoriginalbit, on 02 May 2013 - 06:40 AM, said:

So you need to be careful with how you detect malicious code.

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 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 02 May 2013 - 08:27 AM

Hey guys i have a question.. How do you use an fs api to strings like this code!!
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 The_Awe35

  • Members
  • 71 posts
  • LocationNerdfightaria Island

Posted 02 May 2013 - 08:33 AM

I don't know much about the fs api, but I think you did that right. The one thing is that a multiline shouldn't have brackets around it (I think). I would suggest using a regular bracket around string.

#16 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 May 2013 - 08:39 AM

dont call it string, call it input or something, by calling it string you are overriding the string api. other than that (and the 2 random 'end's) the code is fine. NOTE: You can also use \n inside strings to get a new line instead of doing a multiline string with [[ ]]

#17 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 02 May 2013 - 09:45 AM

View Posttheoriginalbit, on 02 May 2013 - 08:39 AM, said:

dont call it string, call it input or something, by calling it string you are overriding the string api. other than that (and the 2 random 'end's) the code is fine. NOTE: You can also use \n inside strings to get a new line instead of doing a multiline string with [[ ]]

Like what?? can you please show a code please..

#18 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 02 May 2013 - 10:49 AM

Hey guys can you help me to this code please.

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 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 02 May 2013 - 10:55 AM

well for one you need to move scantrue to the top
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