Jump to content




RamKick

lua computer

6 replies to this topic

#1 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

Posted 24 February 2017 - 10:52 PM

Hi!
So I thought I would take a break and make a very simple program:
RamKick
It's simple
Usage: ramkick <file>
It takes a program and shoves it into ram.
Source Code:
pastebin:
pastebin get 1mAL6VXN ramkick

BUGS:
After launching a program, your computer
will crash and you will need to restart it.

Enjoy!
(I don't know why I made this but, ok! :P )

#2 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 24 February 2017 - 11:12 PM

One possible source of the crashes - your parallel call is working with the output of the f1 and f2 functions instead of working with the functions themselves...which I don't think is what you intended. You should remove the brackets after f1 and f2 within the parallel call. Also, unless I'm misunderstanding the code, this will run rk_tmp (f1) and then immediately delete rk_tmp (f2) since you're using parallel - the delete call won't wait until the shell.run call has completed to do its thing. That, too, could be part of why the computer crashes.

#3 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

Posted 25 February 2017 - 08:04 PM

View PostDog, on 24 February 2017 - 11:12 PM, said:

One possible source of the crashes - your parallel call is working with the output of the f1 and f2 functions instead of working with the functions themselves...which I don't think is what you intended. You should remove the brackets after f1 and f2 within the parallel call. Also, unless I'm misunderstanding the code, this will run rk_tmp (f1) and then immediately delete rk_tmp (f2) since you're using parallel - the delete call won't wait until the shell.run call has completed to do its thing. That, too, could be part of why the computer crashes.
Actually, the entire point of the program is to put the file into ram without a trace.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 February 2017 - 09:35 AM

"Without a trace" how? In what way is this meant to differ from simply running the target script directly?

#5 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 26 February 2017 - 12:02 PM

Your program doesn't actually store anything in RAM. It basically copies the file to a different location.

#6 Exerro

  • Members
  • 801 posts

Posted 26 February 2017 - 05:15 PM

View Posthouseofkraft, on 26 February 2017 - 12:02 PM, said:


Your program doesn't actually store anything in RAM. It basically copies the file to a different location.
Well, technically, by loading and running the program it's in RAM. The wording is certainly misleading though.

I have to ask, why have you made a program that just runs a program like typing it into the prompt would?

#7 minebuild02

  • Members
  • 97 posts

Posted 09 March 2017 - 10:21 AM

My reply to this will not be critique, but rather an improved version of the program which properly loads a file from a URL and executes it in RAM.
local tArgs = {...}

if tArgs[1] == nil then error("no URL") end

local handlex = http.get(tArgs[1])
local contents = handlex.readAll()
handlex.close()
return loadstring(contents)

Edited by minebuild02, 09 March 2017 - 10:22 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users