Function at 0x140031810
Capabilities:
Check if file exists

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x48]
sub rsp, 0x120
mov qword [rsp + 0x38], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x140320c20]
xor rax, rsp
mov qword [rbp + 0x18], rax
mov r14, rcx
lea rbx, [rcx + 0x18]
mov qword [rbp + 0x10], rbx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
inc dword [r14 + 8]
cmp qword [r14 + 0x10], 0
je 0x140031872
mov dil, 1
jmp 0x140031b0a
mov qword [rbp - 0x18], 7
xor r13d, r13d
mov qword [rbp - 0x20], r13
mov word [rbp - 0x30], r13w
lea rcx, [rbp - 0x30]
call fcn.140023160
mov dword [rsp + 0x20], 0x1200097
mov dword [rsp + 0x24], 0xf0020
mov dword [rsp + 0x28], 0xdd00d5
mov dword [rsp + 0x2c], 0xdf008f
mov dword [rsp + 0x30], 0xa3014e
xor eax, eax
mov word [rsp + 0x34], ax
lea rcx, [rsp + 0x20]
call fcn.1400042a0
or rdi, 0xffffffffffffffff
cmp word [rax], r13w
jne 0x1400318d7
mov r8d, r13d
jmp 0x1400318eb
mov r8, rdi
nop word [rax + rax]
inc r8
cmp word [rax + r8*2], 0
jne 0x1400318e0
mov rdx, rax
lea rcx, [rbp - 0x30]
call fcn.14000f3a0
lea rcx, [rbp - 0x30]
cmp qword [rbp - 0x18], 8
cmovae rcx, qword [rbp - 0x30]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov r12d, eax
lea rdx, [rbp - 0x30]
cmp qword [rbp - 0x18], 8
cmovae rdx, qword [rbp - 0x30]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x40], rax
xor r8d, r8d
lea rcx, [rsp + 0x40]
call fcn.1400078f0
nop
xor r9d, r9d
mov r8d, 0x28006
lea rdx, [r14 + 0x10]
mov rcx, qword [rsp + 0x40]
call fcn.1400b3fc0
mov esi, eax
lea rax, [rsp + 0x48]
mov rcx, qword [rsp + 0x40]
cmp rcx, rax
je 0x140031961
call fcn.140222478
test esi, esi
je 0x14003196d
xor dil, dil
jmp 0x140031adf
test r12d, r12d
jne 0x14003198e
call fcn.1400242e0
test al, al
je 0x14003198e
lea rcx, [rbp - 0x30]
cmp qword [rbp - 0x18], 8
cmovae rcx, qword [rbp - 0x30]
call fcn.140023c70
movdqa xmm0, xmmword [0x14029fae0]
movdqu xmmword [rsp + 0x20], xmm0
mov word [rsp + 0x30], 0xa2
lea rcx, [rsp + 0x20]
call fcn.140007520
mov qword [rbp + 8], reloc.WS2_32.dll_ntohs
mov qword [rbp], r13
mov byte [rbp - 0x10], 0
cmp byte [rax], 0
jne 0x1400319c7
mov rdi, r13
jmp 0x1400319d0
inc rdi
cmp byte [rax + rdi], 0
jne 0x1400319c7
mov r8, rdi
mov rdx, rax
lea rcx, [rbp - 0x10]
call fcn.1400044f0
nop
lea rsi, [rbp - 0x10]
cmp qword [rbp + 8], 0x10
cmovae rsi, qword [rbp - 0x10]
mov rdi, qword [r14 + 0x10]
lea rdx, str.main
mov rcx, rdi
call fcn.1400d9a70
mov r9d, dword [rbp]
mov r8, rsi
mov edx, eax
mov rcx, rdi
call fcn.1400d9850
test eax, eax
jne 0x140031a76
mov rdi, qword [r14 + 0x10]
mov rcx, qword [rdi + 0x18]
test rcx, rcx
je 0x140031a29
call qword [0x1403252a8]
lea rax, [0x1400b2520]
mov qword [rdi + 0x2a8], rax
mov qword [rdi + 0x2b0], rdi
mov dword [rdi + 0x2b8], r13d
mov dword [rdi + 0x308], r13d
mov rcx, qword [rdi + 0x18]
test rcx, rcx
je 0x140031a5b
call qword [0x1403252b8]
mov dword [rdi + 0x308], 0xbb8
mov rcx, r14
call fcn.1400326a0
test al, al
je 0x140031a76
mov dil, 1
jmp 0x140031a79
xor dil, dil
mov rax, qword [rbp + 8]
cmp rax, 0x10
jb 0x140031acf
inc rax
mov rcx, qword [rbp - 0x10]
cmp rax, 0x1000
jb 0x140031aca
test cl, 0x1f
je 0x140031a9d
call fcn.1402226ac
int3
mov rax, qword [rcx - 8]
cmp rax, rcx
jb 0x140031aac
call fcn.1402226ac
int3
sub rcx, rax
cmp rcx, 8
jae 0x140031abb
call fcn.1402226ac
int3
cmp rcx, 0x27
jbe 0x140031ac7
call fcn.1402226ac
int3
mov rcx, rax
call fcn.1402150bc
mov qword [rbp + 8], reloc.WS2_32.dll_ntohs
mov qword [rbp], r13
mov byte [rbp - 0x10], 0
mov r8, qword [rbp - 0x18]
cmp r8, 8
jb 0x140031af9
inc r8
mov rdx, qword [rbp - 0x30]
lea rcx, [rbp - 0x30]
call fcn.140008270
mov qword [rbp - 0x18], 7
mov qword [rbp - 0x20], r13
mov word [rbp - 0x30], r13w
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
movzx eax, dil
mov rcx, qword [rbp + 0x18]
xor rcx, rsp
call fcn.140215090
lea r11, [rsp + 0x120]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret