Merge pull request #20 from kevrocks67/master

Create nasm64 executor and test file
This commit is contained in:
Brian Seymour 2020-10-03 12:18:45 -05:00 committed by GitHub
commit 5e71027b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

4
lxc/executors/nasm64 Executable file
View File

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

18
lxc/tests/test64.nasm Normal file
View File

@ -0,0 +1,18 @@
SECTION .data
good: db "good", 0x0a, 0x0
txtlen: equ $ - good
SECTION .text
GLOBAL _start
_start:
;sys_write
mov rax, 1
mov rdi, 1
mov rsi, good
mov rdx, txtlen
syscall
;sys_exit
mov rax, 60
mov rdi, 0
syscall