From 7e8e439a6940bde2c11d30e45b950dd3ed789e60 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 14 Jan 2023 21:44:22 -0500 Subject: 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 --- lace_x86.asm | 5 +++-- 1 file 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) -- cgit v1.2.3