Function at 0x140020490
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push rbx
push rbp
push rsi
sub rsp, 0x50
mov rbx, rcx
xor ecx, ecx
mov rsi, rdx
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x40], rcx
mov byte [rsp + 0x80], cl
mov dword [rsp + 0x20], ecx
mov rcx, rdx
mov dword [rsp + 0x28], 0xffffffff
call fcn.1400190b0
test rax, rax
jne 0x1400204f8
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x1400204ed
or r8d, 0xffffffff
xor edx, edx
mov rcx, rbx
add rsp, 0x50
pop rsi
pop rbp
pop rbx
jmp fcn.14001f670
or eax, 0xffffffff
add rsp, 0x50
pop rsi
pop rbp
pop rbx
ret
mov rbp, qword [rsp + 0x40]
mov qword [rsp + 0x70], rdi
lea rdx, [rsi - 1]
nop word [rax + rax]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rsi
repne scasb al, byte [rdi]
not rcx
dec rcx
add rcx, rdx
cmp rcx, rsi
jbe 0x14002053d
nop dword [rax]
dec rcx
cmp byte [rcx], 0x2f
je 0x140020540
cmp rcx, rsi
ja 0x140020530
dec rcx
movzx eax, byte [rcx + 1]
lea rdi, [rcx + 1]
mov byte [rsp + 0x88], al
mov qword [rsp + 0x48], rdi
mov byte [rdi], 0
test rbp, rbp
je 0x140020567
movzx ecx, byte [rsp + 0x80]
mov byte [rbp], cl
mov rcx, rbx
mov rbp, rdi
mov byte [rsp + 0x80], al
call fcn.14001e3c0
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x14002058c
lea rdx, [rsi - 1]
cmp rdi, rsi
ja 0x140020510
lea rcx, [rdi + 1]
mov edx, 0x2f
mov qword [rsp + 0x40], rdi
call fcn.140019860
or rcx, 0xffffffffffffffff
mov rdx, rax
mov qword [rsp + 0x80], rax
test rax, rax
je 0x1400205e5
inc rdx
mov byte [rax], 0
xor eax, eax
mov rdi, rdx
mov qword [rsp + 0x80], rdx
repne scasb al, byte [rdi]
mov rdi, rbx
not rcx
lea rdx, [rcx - 1]
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
not rcx
lea rcx, [rdx + rcx + 0x100]
jmp 0x1400205f4
mov rdi, rbx
repne scasb al, byte [rdi]
not rcx
add rcx, 0xff
mov rsi, qword [rsp + 0x38]
mov ebp, dword [rsp + 0x28]
test rsi, rsi
je 0x140020795
call fcn.140022488
mov rdi, rax
mov qword [rsp + 0x30], rax
test rax, rax
je 0x140020795
mov rdx, rax
sub rdx, rbx
movzx ecx, byte [rbx]
inc rbx
mov byte [rdx + rbx - 1], cl
test cl, cl
jne 0x140020622
or rcx, 0xffffffffffffffff
xor eax, eax
repne scasb al, byte [rdi]
mov rax, qword [rsp + 0x40]
not rcx
dec rcx
mov qword [rsp + 0x28], rcx
test rax, rax
je 0x140020657
movzx edx, byte [rsp + 0x88]
mov byte [rax], dl
mov rcx, rax
call fcn.1400190b0
test rax, rax
jne 0x14002066b
or ebp, ebp
jmp 0x1400207b6
mov rcx, rsi
call fcn.14001e570
mov rbx, rax
test rax, rax
je 0x1400207b6
nop
lea rdi, [0x140047600]
mov rsi, rbx
mov ecx, 2
repe cmpsb byte [rsi], byte [rdi]
je 0x14002077a
lea rdi, [0x14004af08]
mov rsi, rbx
mov ecx, 3
repe cmpsb byte [rsi], byte [rdi]
je 0x14002077a
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
mov rdx, rbx
call fcn.14001a540
test eax, eax
je 0x14002077a
mov rcx, qword [rsp + 0x28]
mov r9, qword [rsp + 0x30]
sub rcx, rbx
add rcx, r9
nop word [rax + rax]
movzx eax, byte [rbx]
inc rbx
mov byte [rcx + rbx - 1], al
test al, al
jne 0x1400206e0
mov rsi, qword [rsp + 0x80]
test rsi, rsi
je 0x140020742
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, r9
repne scasb al, byte [rdi]
not rcx
lea rdi, [rcx - 1]
mov byte [rcx + r9 - 1], 0x2f
mov rcx, rsi
lea rdx, [rdi + r9 + 1]
sub rdx, rsi
nop
movzx eax, byte [rcx]
inc rcx
mov byte [rdx + rcx - 1], al
test al, al
jne 0x140020720
lea rdx, [rdi + r9 + 1]
mov rcx, r9
call fcn.140020490
mov rsi, qword [rsp + 0x38]
jmp 0x140020755
mov rsi, qword [rsp + 0x38]
xor edx, edx
mov rcx, r9
mov r8d, dword [rsi + 0xc]
call fcn.14001f670
mov rbx, qword [rsp + 0x30]
mov ebp, eax
mov rax, qword [rsp + 0x28]
mov byte [rax + rbx], 0
test ebp, ebp
jne 0x140020773
mov dword [rsp + 0x20], 1
jmp 0x14002077f
cmp ebp, 0xffffffff
jne 0x1400207bb
jmp 0x14002077f
mov rsi, qword [rsp + 0x38]
mov rcx, rsi
call fcn.14001e570
mov rbx, rax
test rax, rax
jne 0x140020680
jmp 0x1400207b6
mov rax, qword [rsp + 0x40]
test rax, rax
je 0x1400207a9
movzx edx, byte [rsp + 0x88]
mov byte [rax], dl
or ebp, ebp
mov eax, 4
test rsi, rsi
cmovne ebp, eax
mov rbx, qword [rsp + 0x30]
mov rdi, qword [rsp + 0x70]
test rsi, rsi
je 0x1400207d6
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_FindClose]
mov rcx, rsi
call fcn.140021628
mov rax, qword [rsp + 0x80]
test rax, rax
je 0x1400207e7
mov byte [rax - 1], 0x2f
test rbx, rbx
je 0x1400207f4
mov rcx, rbx
call fcn.140021628
cmp ebp, 0xffffffff
jne 0x140020806
cmp dword [rsp + 0x20], 0
mov eax, 0
cmovne ebp, eax
mov eax, ebp
add rsp, 0x50
pop rsi
pop rbp
pop rbx
ret