Question: Can you get the correct password to get your flag? .LC0: .string password: .LC1: .string %d .LC2: .string Correct!! .LC3: .string flag{_0x%x_} .LC4: .string

Can you get the correct password to get your flag?
.LC0:
.string "password: "
.LC1:
.string "%d"
.LC2:
.string "Correct!!"
.LC3:
.string "flag{_0x%x_}"
.LC4:
.string "Wrong, Try Harder!!"
validate:
push rbp
mov rbp, rsp
mov DWORD PTR [rbp-20], edi
mov eax, DWORD PTR [rbp-20]
and eax, 15
mov DWORD PTR [rbp-4], eax
mov eax, DWORD PTR [rbp-20]
sar eax, 4
mov DWORD PTR [rbp-8], eax
cmp DWORD PTR [rbp-4], 13
jne .L2
cmp DWORD PTR [rbp-8], 12
jne .L3
mov eax, 0
jmp .L4
.L3:
mov eax, -1
jmp .L4
.L2:
mov eax, -1
.L4:
pop rbp
ret
main:
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], 10
jmp .L6
.L9:
mov edi, OFFSET FLAT:.LC0
mov eax, 0
call printf
lea rax, [rbp-12]
mov rsi, rax
mov edi, OFFSET FLAT:.LC1
mov eax, 0
call scanf_s
mov eax, DWORD PTR [rbp-12]
mov edi, eax
call validate
mov DWORD PTR [rbp-8], eax
cmp DWORD PTR [rbp-8], 0
jne .L7
mov edi, OFFSET FLAT:.LC2
call puts
mov eax, DWORD PTR [rbp-12]
mov esi, eax
mov edi, OFFSET FLAT:.LC3
mov eax, 0
call printf
mov DWORD PTR [rbp-4], 0
jmp .L8
.L7:
mov edi, OFFSET FLAT:.LC4
call puts
.L8:
mov edi, 10
call putchar
.L6:
cmp DWORD PTR [rbp-4], 0
jne .L9
mov eax, 0
leave
ret

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!