aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib/sys/linux.ey
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-01-07 22:24:25 +0100
committerDrahflow <drahflow@gmx.de>2015-01-07 22:24:25 +0100
commitb9b7577a39d294b3856f787e3eec3869bd65f3bb (patch)
tree2a7286732551be8c20057e5f313bf9866478dda5 /elymas/lib/sys/linux.ey
parentb84800e369887115aaba407630375f94b2be0908 (diff)
Usable execve(2) wrapper
Diffstat (limited to 'elymas/lib/sys/linux.ey')
-rw-r--r--elymas/lib/sys/linux.ey12
1 files changed, 11 insertions, 1 deletions
diff --git a/elymas/lib/sys/linux.ey b/elymas/lib/sys/linux.ey
index a155d9a..f5ce570 100644
--- a/elymas/lib/sys/linux.ey
+++ b/elymas/lib/sys/linux.ey
@@ -333,7 +333,17 @@
{ 0 0 0 0 DUP2 } /dup2 defStdSyscall
- { 0 0 0 0 0 EXECVE } /exec defStdSyscall
+ # { 0 0 0 0 0 EXECVE } /exec defStdSyscall
+
+ # 0 -> an array of strings determining the environment
+ # 1 -> an array of strings determining argv
+ # 2 -> path to executable
+ # 0 <- raw return value (if it returns at all, naturally)
+ { ==env ==arg # ==path
+ [ arg { sys .asm .rawAddress 24 add bin .produce .u64 } each "\0\0\0\0\0\0\0\0" ] |cat fold
+ [ env { sys .asm .rawAddress 24 add bin .produce .u64 } each "\0\0\0\0\0\0\0\0" ] |cat fold
+ 0 0 0 EXECVE
+ } /execve defStdSyscall
{ 0 0 0 0 0 0 FORK } /fork defStdSyscall