	.file	"723573.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"flag.txt"
	.align 8
.LC2:
	.string	"Flag File is Missing. Problem is Misconfigured, please contact an Admin if you are running this on the shell server."
	.text
	.globl	win
	.type	win, @function
win:
.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, 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -88[rbp], rax
	cmp	QWORD PTR -88[rbp], 0
	jne	.L2
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	rdx, QWORD PTR -88[rbp]
	lea	rax, -80[rbp]
	mov	esi, 64
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	win, .-win
	.globl	global_canary
	.bss
	.type	global_canary, @object
	.size	global_canary, 4
global_canary:
	.zero	4
	.section	.rodata
.LC3:
	.string	"canary.txt"
	.align 8
.LC4:
	.string	"Canary is Missing. Problem is Misconfigured, please contact an Admin if you are running this on the shell server."
	.text
	.globl	read_canary
	.type	read_canary, @function
read_canary:
.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
	lea	rsi, .LC0[rip]
	lea	rdi, .LC3[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L5
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 4
	mov	esi, 1
	lea	rdi, global_canary[rip]
	call	fread@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_canary, .-read_canary
	.section	.rodata
	.align 8
.LC5:
	.string	"How Many Bytes will You Write Into the Buffer?\n> "
.LC6:
	.string	"%d"
.LC7:
	.string	"Input> "
	.align 8
.LC8:
	.string	"*** Stack Smashing Detected *** : Canary Value Corrupt!"
.LC9:
	.string	"Ok... Now Where's the Flag?"
	.text
	.globl	vuln
	.type	vuln, @function
vuln:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -88[rbp], 0
	mov	eax, DWORD PTR global_canary[rip]
	mov	DWORD PTR -84[rbp], eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L10:
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, -48[rbp]
	add	rax, rdx
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	movzx	eax, BYTE PTR -48[rbp+rax]
	cmp	al, 10
	je	.L13
	add	DWORD PTR -88[rbp], 1
.L7:
	cmp	DWORD PTR -88[rbp], 31
	jle	.L10
	jmp	.L9
.L13:
	nop
.L9:
	lea	rdx, -92[rbp]
	lea	rax, -48[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	lea	rax, -80[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	lea	rax, -84[rbp]
	mov	edx, 4
	lea	rsi, global_canary[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L11
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L11:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	vuln, .-vuln
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR stdout[rip]
	mov	ecx, 0
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	call	getegid@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, ecx
	mov	edi, eax
	mov	eax, 0
	call	setresgid@PLT
	mov	eax, 0
	call	read_canary
	mov	eax, 0
	call	vuln
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"723573.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"flag.txt\000"
	.align	2
.LC2:
	.ascii	"Flag File is Missing. Problem is Misconfigured, ple"
	.ascii	"ase contact an Admin if you are running this on the"
	.ascii	" shell server.\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	win
	.syntax unified
	.arm
	.fpu softvfp
	.type	win, %function
win:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L4+4
	ldr	r0, .L4+8
	bl	fopen
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L4+12
	bl	puts
	mov	r0, #0
	bl	exit
.L2:
	sub	r3, fp, #72
	ldr	r2, [fp, #-76]
	mov	r1, #64
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #72
	mov	r0, r3
	bl	puts
	ldr	r3, .L4+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	nop
	ldr	r3, .L4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	stdout
	.size	win, .-win
	.comm	global_canary,4,4
	.section	.rodata
	.align	2
.LC4:
	.ascii	"canary.txt\000"
	.align	2
.LC5:
	.ascii	"Canary is Missing. Problem is Misconfigured, please"
	.ascii	" contact an Admin if you are running this on the sh"
	.ascii	"ell server.\000"
	.text
	.align	2
	.global	read_canary
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_canary, %function
read_canary:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r1, .L8
	ldr	r0, .L8+4
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L7
	ldr	r0, .L8+8
	bl	puts
	mov	r0, #0
	bl	exit
.L7:
	ldr	r3, [fp, #-8]
	mov	r2, #4
	mov	r1, #1
	ldr	r0, .L8+12
	bl	fread
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	.LC4
	.word	.LC5
	.word	global_canary
	.size	read_canary, .-read_canary
	.section	.rodata
	.align	2
.LC6:
	.ascii	"How Many Bytes will You Write Into the Buffer?\012>"
	.ascii	" \000"
	.align	2
.LC7:
	.ascii	"%d\000"
	.align	2
.LC8:
	.ascii	"Input> \000"
	.align	2
.LC9:
	.ascii	"*** Stack Smashing Detected *** : Canary Value Corr"
	.ascii	"upt!\000"
	.align	2
.LC10:
	.ascii	"Ok... Now Where's the Flag?\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	vuln
	.syntax unified
	.arm
	.fpu softvfp
	.type	vuln, %function
vuln:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-80]
	ldr	r2, .L18+4
	sub	r3, fp, #76
	mov	r1, r2
	mov	r2, #4
	mov	r0, r3
	bl	memcpy
	ldr	r0, .L18+8
	bl	printf
	b	.L11
.L14:
	ldr	r3, [fp, #-80]
	sub	r2, fp, #40
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	mov	r0, #0
	bl	read
	sub	r2, fp, #40
	ldr	r3, [fp, #-80]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L17
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L11:
	ldr	r3, [fp, #-80]
	cmp	r3, #31
	ble	.L14
	b	.L13
.L17:
	nop
.L13:
	sub	r2, fp, #84
	sub	r3, fp, #40
	ldr	r1, .L18+12
	mov	r0, r3
	bl	__isoc99_sscanf
	ldr	r0, .L18+16
	bl	printf
	ldr	r3, [fp, #-84]
	mov	r2, r3
	sub	r3, fp, #72
	mov	r1, r3
	mov	r0, #0
	bl	read
	sub	r3, fp, #76
	mov	r2, #4
	ldr	r1, .L18+4
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r0, .L18+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L15:
	ldr	r0, .L18+24
	bl	puts
	ldr	r3, .L18+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	nop
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC11
	.word	global_canary
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	stdout
	.size	vuln, .-vuln
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, .L22
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	bl	getegid
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	setresgid
	bl	read_canary
	bl	vuln
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	stdout
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
