Update readme

This commit is contained in:
Robin Malley 2021-01-04 03:05:50 +00:00
parent 44ad323f31
commit 01448dbe34
2 changed files with 9 additions and 15 deletions

View File

@ -31,7 +31,9 @@ If you want to contribute to this repository:
* lua-zlib - Data compression
5. You may need to modify conf/build.conf, I use Lua 5.1 on my development machine,
but everything should still work with later versions.
6. Clone this repository into the smr folder, cd into the root, and run `make`!
6. Install [spp](https://github.com/radare/spp)
7. Clone this repository into the smr folder, cd into the root, and run `make`!
* You may need to modify the configuration in the Makefile, add test.monster 127.0.0.1 to your `/etc/hosts`, modify command invocation, ect.
## Misc notes.
@ -39,7 +41,9 @@ SMR requires a slightly modified version of Kore to run. See [my kore patches](h
for the changes I needed to make to get the JIT compiler playing nice with
Kore's seccomp restrictions. There are a few other changes, like modified kore
to accept any text as input for things like file upload.
**UPDATE (12/18/2020)**
Kore 4.0 no longer needs the seccomp changes, as those have been exposed to
library users, and smr has been updated appropriately. It still needs the
allow-multiline-input patch though.

View File

@ -19,28 +19,18 @@ local pagenames = {
"search",
}
local pages = {}
local function load1(page)
local path = string.format("pages/%s.etlua",page)
for k,v in pairs(pagenames) do
local path = string.format("pages/%s.etlua",v)
local parser = et.Parser()
local f = assert(io.open(path,"r"))
local fdata = assert(f:read("*a"))
local code = assert(parser:parse(fdata))
local func = assert(parser:load(parser:chunks_to_lua(),path))
f:close()
return function(...)
buf = assert(parser:run(func,...))
pages[v] = function(...)
local buf = assert(parser:run(func,...))
return table.concat(buf)
end
end
local function load2(page)
local path = string.format("pages/%s.etlua",page)
local f = assert(io.open(path,"r"))
local ret = assert(et.compile(f:read("*a")))
f:close()
return ret
end
for k,v in pairs(pagenames) do
pages[v] = load1(v)
end
return pages