diff options
author | Malfurious <m@lfurio.us> | 2023-01-14 21:44:22 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-01-14 21:44:22 -0500 |
commit | 7e8e439a6940bde2c11d30e45b950dd3ed789e60 (patch) | |
tree | 62ef5e0124e98875676350c0496d37f63fd124dd | |
parent | 658c9a0d0d5c01b28bd7c7f52b79d304cc97dfdf (diff) | |
download | lace-7e8e439a6940bde2c11d30e45b950dd3ed789e60.tar.gz lace-7e8e439a6940bde2c11d30e45b950dd3ed789e60.zip |
Write to stdout instead of stdin
The previous version breaks if stdin is directed from a file, such as
/dev/null.
Signed-off-by: Malfurious <m@lfurio.us>
-rw-r--r-- | lace_x86.asm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lace_x86.asm b/lace_x86.asm index ee615ea..687b8e0 100644 --- a/lace_x86.asm +++ b/lace_x86.asm @@ -116,10 +116,11 @@ _start: pop edi ; recover socket fd sub esp, 0xff ; alloc data buffer - xor esi, esi ; pipe(sock, stdin) + xor esi, esi ; pipe(sock_fd, stdin) call pipe - xchg edi, esi ; pipe(stdin, sock) + inc esi ; pipe(stdout, sock_fd) + xchg edi, esi call pipe xor ebx, ebx ; exit(0) |