diff options
| author | Drahflow <drahflow@gmx.de> | 2015-01-07 22:24:25 +0100 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-01-07 22:24:25 +0100 |
| commit | b9b7577a39d294b3856f787e3eec3869bd65f3bb (patch) | |
| tree | 2a7286732551be8c20057e5f313bf9866478dda5 | |
| parent | b84800e369887115aaba407630375f94b2be0908 (diff) | |
Usable execve(2) wrapper
| -rw-r--r-- | elymas/lib/sys/linux.ey | 12 |
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 |
