Function at 0x140020300
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x68]
sub rsp, 0x168
mov qword [rbp + 0x30], 0xfffffffffffffffe
mov r14, rdx
mov rbx, rcx
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x50], 0
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0x48]
call fcn.140020b10
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
mov rcx, rbx
call fcn.14001f7f0
lea rcx, [rbx + 8]
cmp qword [rcx + 0x18], 0x10
jb 0x140020371
mov rcx, qword [rcx]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
je 0x1400203ad
mov rdi, qword [rsp + 0x48]
mov rcx, qword [rdi]
mov qword [rdi], rdi
mov qword [rdi + 8], rdi
cmp rcx, rdi
je 0x1400203a0
mov rbx, qword [rcx]
call fcn.1400eb7f4
mov rcx, rbx
cmp rbx, rdi
jne 0x140020390
mov rcx, rdi
call fcn.1400eb7f4
jmp 0x140020838
mov rsi, qword [rsp + 0x48]
mov rdi, qword [rsi]
cmp rdi, rsi
je 0x140020805
lea r13, [rdi + 0x10]
mov rcx, r14
call fcn.14000c400
mov rsi, rax
call fcn.14000b6b4
test rax, rax
je 0x1400207fa
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + Ordinal_26]
lea rbx, [rax + 0x18]
mov qword [rbp + 0xc8], rbx
test rsi, rsi
je 0x140020431
test rsi, 0xffffffffffff0000
jne 0x140020422
movzx esi, si
xor edx, edx
mov ecx, esi
call fcn.14000b0cc
test rax, rax
je 0x14002044c
mov r8d, esi
mov rdx, rax
lea rcx, [rbp + 0xc8]
call fcn.1400080f4
jmp 0x140020445
or rax, 0xffffffffffffffff
inc rax
cmp byte [rsi + rax], 0
jne 0x140020426
jmp 0x140020433
xor eax, eax
mov r8d, eax
mov rdx, rsi
lea rcx, [rbp + 0xc8]
call fcn.140007a14
mov rbx, qword [rbp + 0xc8]
mov ecx, 1
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, 0x104
or ecx, eax
jge 0x140020478
mov edx, 0x104
lea rcx, [rbp + 0xc8]
call fcn.14000799c
mov rbx, qword [rbp + 0xc8]
lea rdx, [r13 + 8]
mov rcx, rbx
call qword [sym.imp.SHLWAPI.dll_PathAppendA]
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
call fcn.140156670
test eax, eax
js 0x1400207ef
cmp eax, dword [rbx - 0xc]
jg 0x1400207ef
mov dword [rbx - 0x10], eax
cdqe
mov byte [rax + rbx], 0
mov qword [rbp - 0x58], reloc.WS2_32.dll_ntohs
xor esi, esi
mov qword [rbp - 0x60], rsi
mov byte [rbp - 0x70], sil
cmp byte [rbx], sil
jne 0x1400204c7
mov r8d, esi
jmp 0x1400204d9
or r8, 0xffffffffffffffff
nop dword [rax + rax]
inc r8
cmp byte [rbx + r8], sil
jne 0x1400204d0
mov rdx, rbx
lea rcx, [rbp - 0x70]
call fcn.14000d058
nop
mov qword [rsp + 0x70], reloc.WS2_32.dll_ntohs
mov qword [rsp + 0x68], rsi
mov byte [rsp + 0x58], 0
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp - 0x70]
lea rcx, [rsp + 0x58]
call fcn.14000ca10
lea rax, [rsp + 0x58]
mov qword [rsp + 0x40], rax
xor r15b, r15b
lea rcx, [rsp + 0x58]
cmp qword [rsp + 0x70], 0x10
cmovae rcx, qword [rsp + 0x58]
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov r12, rax
cmp rax, 0xffffffffffffffff
je 0x1400206e9
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov r14d, eax
cmp dword [r13 + 4], eax
sete r15b
test r15b, r15b
je 0x1400206d9
mov dword [rbp + 0xc0], esi
mov edx, r14d
lea rcx, [rsp + 0x78]
call fcn.14001cfb0
nop
mov qword [rsp + 0x20], rsi
lea r9, [rbp + 0xc0]
mov r8d, r14d
mov rsi, qword [rsp + 0x78]
mov rdx, rsi
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [rbp + 0xc0], r14d
sete r15b
test r15b, r15b
je 0x14002068a
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x10]
call fcn.14001ef20
lea rdx, [r13 + 0x108]
cmp byte [rdx], 0
jne 0x1400205e1
xor esi, esi
jmp 0x1400205ee
or rsi, 0xffffffffffffffff
inc rsi
cmp byte [rdx + rsi], 0
jne 0x1400205e5
lea rcx, [rbp - 0x10]
mov r14, qword [rbp - 0x10]
mov r13, qword [rbp + 8]
cmp r13, 0x10
cmovae rcx, r14
mov r8, rsi
mov r15, qword [rbp]
cmp r15, rsi
cmovb r8, r15
test r8, r8
je 0x14002061e
call fcn.14011db30
test eax, eax
jne 0x140020632
cmp r15, rsi
jae 0x140020628
or eax, 0xffffffff
jmp 0x140020630
xor eax, eax
cmp r15, rsi
seta al
test eax, eax
sete r15b
cmp r13, 0x10
jb 0x140020681
lea rax, [r13 + 1]
cmp rax, 0x1000
jb 0x140020679
test r14b, 0x1f
jne 0x1400207d1
mov rax, qword [r14 - 8]
cmp rax, r14
jae 0x1400207cb
sub r14, rax
cmp r14, 8
jb 0x1400207c5
cmp r14, 0x27
ja 0x1400207bf
mov r14, rax
mov rcx, r14
call fcn.1400eb7f4
lea r13, [rdi + 0x10]
mov rsi, qword [rsp + 0x78]
test rsi, rsi
je 0x1400206d7
mov rax, qword [rbp - 0x78]
sub rax, rsi
cmp rax, 0x1000
jb 0x1400206cf
test sil, 0x1f
jne 0x1400207e9
mov rax, qword [rsi - 8]
cmp rax, rsi
jae 0x1400207e3
sub rsi, rax
cmp rsi, 8
jb 0x1400207dd
cmp rsi, 0x27
ja 0x1400207d7
mov rsi, rax
mov rcx, rsi
call fcn.1400eb7f4
xor esi, esi
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r14, qword [rbp + 0xb8]
lea rcx, [rsp + 0x58]
call fcn.14000c7e0
test r15b, r15b
jne 0x14002078e
mov qword [rbp + 0x28], reloc.WS2_32.dll_ntohs
mov qword [rbp + 0x20], rsi
mov byte [rbp + 0x10], r15b
mov qword [rbp - 0x38], reloc.WS2_32.dll_ntohs
mov qword [rbp - 0x40], rsi
mov byte [rbp - 0x50], r15b
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp - 0x70]
lea rcx, [rbp - 0x50]
call fcn.14000ca10
lea r8, [rbp + 0x10]
lea rdx, [rbp - 0x50]
lea rcx, [rbp + 0x38]
call fcn.140020020
nop
mov qword [rbp - 0x18], reloc.WS2_32.dll_ntohs
mov qword [rbp - 0x20], rsi
mov byte [rbp - 0x30], r15b
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp - 0x70]
lea rcx, [rbp - 0x30]
call fcn.14000ca10
lea r8, [rbp - 0x30]
mov rdx, r13
mov rcx, qword [rbp + 0xb0]
call fcn.14001fa80
nop
lea rcx, [rbp + 0x38]
call fcn.14000c7e0
nop
lea rcx, [rbp + 0x10]
call fcn.14000c7e0
nop
lea rcx, [rbp - 0x70]
call fcn.14000c7e0
nop
lea rdx, [rbx - 0x18]
or eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x1400207b2
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.WS2_32.dll_htonl]
mov rdi, qword [rdi]
mov rsi, qword [rsp + 0x48]
jmp 0x1400203b5
call fcn.140128ff4
int3
call fcn.140128ff4
int3
call fcn.140128ff4
int3
call fcn.140128ff4
nop
call fcn.140128ff4
int3
call fcn.140128ff4
int3
call fcn.140128ff4
int3
call fcn.140128ff4
nop
mov ecx, 0x80070057
call fcn.14000b9ec
nop
mov ecx, 0x80004005
call fcn.14000b9ec
nop
mov rcx, qword [rsi]
mov qword [rsi], rsi
mov qword [rsi + 8], rsi
cmp rcx, rsi
je 0x140020824
mov rbx, qword [rcx]
call fcn.1400eb7f4
mov rcx, rbx
cmp rbx, rsi
jne 0x140020814
mov edx, 1
mov r8d, 0x148
mov rcx, rsi
call fcn.14000ce04
nop
mov rcx, r14
add rsp, 0x168
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
jmp fcn.14000c7e0