Merge pull request #19 from kevrocks67/master

Change ASM module to default to 32 bit and add 64 bit executor
This commit is contained in:
Brian Seymour 2020-10-03 04:21:21 -05:00 committed by GitHub
commit 58f4088007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 177 additions and 169 deletions

View File

@ -78,6 +78,7 @@ func Execute(res http.ResponseWriter, req *http.Request) {
"julia", "jl", "julia", "jl",
"kotlin", "kotlin",
"nasm", "asm", "nasm", "asm",
"nasm64", "asm64",
"node", "javascript", "js", "node", "javascript", "js",
"perl", "pl", "perl", "pl",
"php", "php",
@ -151,6 +152,8 @@ func launch(request Inbound, res http.ResponseWriter) {
execlang = "elixir" execlang = "elixir"
case "asm": case "asm":
execlang = "nasm" execlang = "nasm"
case "asm64":
execlang = "nasm64"
case "js", "javascript": case "js", "javascript":
execlang = "node" execlang = "node"
case "jl": case "jl":

View File

@ -78,6 +78,9 @@ case "$lang" in
"nasm" | "asm") "nasm" | "asm")
bin=nasm bin=nasm
;; ;;
"nasm64" | "asm64")
bin=nasm64
;;
"node" | "js" | "javascript") "node" | "js" | "javascript")
bin=node bin=node
;; ;;

View File

@ -1,4 +1,4 @@
cd /tmp/$2 cd /tmp/$2
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code timeout -s KILL 10 nasm -f elf32 -o binary.o code.code
timeout -s KILL 10 ld binary.o -o binary timeout -s KILL 10 ld -m elf_i386 binary.o -o binary
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary" runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"

View File

@ -23,8 +23,10 @@ echo 'testing js'
../execute js test.js ../execute js test.js
echo 'testing kotlin' echo 'testing kotlin'
../execute kotlin test.kt ../execute kotlin test.kt
echo 'testing asm' echo 'testing asm 32 bit'
../execute asm test.nasm ../execute asm test.nasm
echo 'testing asm 64 bit'
../execute asm64 test64.nasm
echo 'testing php' echo 'testing php'
../execute php test.php ../execute php test.php
echo 'testing perl' echo 'testing perl'