From 615e4ee61cbabfd55fbc302e9a70c5d583e566b4 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 20 Nov 2020 18:45:46 +0000 Subject: In progress FossilOrigin-Name: c06532c4cb721b06699233c4045bf084b1c800ae --- src/c_bsdsetsid.S | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/c_bsdsetsid.S b/src/c_bsdsetsid.S index 70556a5..c7061f9 100644 --- a/src/c_bsdsetsid.S +++ b/src/c_bsdsetsid.S @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * bsdsetsid: src/c_bsdsetsid.S - * 2020-11-20 19:30 + * 2020-11-20 19:45 * Joe * * This is the entrypoint of the program. @@ -95,10 +95,13 @@ c_parent: xor %rax, %rax movb $0x7, %al /* SYS_wait4 */ syscall - mov %rsi, %rax + movq (%rsi), %rax + and $0xff00, %rax + shr $0x8, %rax + push %rax jmp c_hex_dec c_parent_next: - mov %r10, %rdi + pop %rdi movb $0x7, %al xor %rax, %rax movb $0x1, %al /* SYS_exit */ @@ -119,8 +122,6 @@ c_child: movb $0x3b, %al /* SYS_execve */ syscall jc e_execve - test %rax, %rax - js e_execve c_exit: xor %rdi, %rdi -- cgit v1.2.3