diff options
author | JozanLeClerc <JozanLeClerc@noemail.net> | 2020-11-20 19:29:34 +0000 |
---|---|---|
committer | JozanLeClerc <JozanLeClerc@noemail.net> | 2020-11-20 19:29:34 +0000 |
commit | 2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b (patch) | |
tree | 9b774112d91200d1f9ffad68b19de00d7032153c | |
parent | In progress (diff) | |
download | bsdsetsid-2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b.tar.gz bsdsetsid-2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b.tar.bz2 bsdsetsid-2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b.tar.xz bsdsetsid-2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b.tar.zst bsdsetsid-2e0a97ff3e251883d410d3b6e60e5dd4404f0e2b.zip |
Removed shit
FossilOrigin-Name: 1bee1969783453f85c17754a87a774e21cf3b95b
-rw-r--r-- | src/c_bsdsetsid.S | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/src/c_bsdsetsid.S b/src/c_bsdsetsid.S index c7061f9..2c2d158 100644 --- a/src/c_bsdsetsid.S +++ b/src/c_bsdsetsid.S @@ -51,29 +51,6 @@ status: .space 4, 0x0 .text .globl main -c_hex_dec: - xor %r10, %r10 - xor %r9, %r9 - xor %r8, %r8 - mov $0xa, %rbx - clc -.repeat: - xor %rdx, %rdx - idiv %rbx - or $0x0, %dl - mov $0x8, %rcx -.shift: - rcrb $0x1, %dl - rcr $0x1, %r10 - rcr $0x1, %r9 - rcr $0x1, %r8 - dec %rcx - and %rcx, %rcx - jnz .shift - and %rax, %rax - jnz .repeat - jmp c_parent_next - main: cmpb $0x1, %dil jle e_noarg @@ -88,30 +65,14 @@ main: jz c_child c_parent: - mov %rax, %rdi - lea status, %rsi - xor %rdx, %rdx - xor %rcx, %rcx - xor %rax, %rax - movb $0x7, %al /* SYS_wait4 */ - syscall - movq (%rsi), %rax - and $0xff00, %rax - shr $0x8, %rax - push %rax - jmp c_hex_dec -c_parent_next: - pop %rdi - movb $0x7, %al - xor %rax, %rax - movb $0x1, %al /* SYS_exit */ - syscall + jmp c_exit c_child: -# xor %rax, %rax -# movb $0x93, %al /* SYS_setsid */ -# syscall -# jc e_setsid + xor %rax, %rax + mov $0x93, %rax /* SYS_setsid */ + syscall + test %rax, %rax + js e_setsid xor %rax, %rax pop %rdx pop %rsi |