Function at 0x140021e70
Capabilities:
Read file on windows

Disassembly:
push rbp
push rsi
push rdi
push r14
push r15
sub rsp, 0x2d0
mov qword [rsp + 0x38], 0xfffffffffffffffe
mov qword [rsp + 0x300], rbx
mov rax, qword [0x140104508]
xor rax, rsp
mov qword [rsp + 0x2c0], rax
mov r14, r8
mov r15, rdx
mov qword [rsp + 0x40], rdx
xor edi, edi
mov qword [rsp + 0x28], rdi
mov rcx, qword [r8]
lea esi, [rdi - 1]
cmp dword [rcx - 8], edi
je 0x140021ef5
add rcx, 0xfffffffffffffff4
cmp dword [rcx], edi
jl 0x140021f4d
cmp rcx, qword [0x140104010]
je 0x140021ef5
mov eax, esi
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140021eeb
mov rcx, qword [r8]
sub rcx, 0xc
call fcn.1400bf5e4
mov rax, qword [0x140104018]
mov qword [r14], rax
xor edx, edx
mov rcx, r15
call fcn.140001c10
mov rdx, rax
lea r8, [0x1400cdcb0]
lea rcx, [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
cmp qword [rsp + 0x28], rdi
jne 0x140021fc4
mov rax, qword [r15]
add rax, 0xfffffffffffffff4
cmp rax, qword [0x140104010]
je 0x140021f46
mov ecx, esi
lock xadd dword [rax], ecx
sub ecx, 1
jg 0x140021f46
mov rcx, qword [r15]
sub rcx, 0xc
call fcn.1400bf5e4
mov eax, esi
jmp 0x1400220e7
lea rcx, [0x1400cd920]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
movsxd rbp, eax
mov edx, ebp
mov rcx, r14
call fcn.140021d50
test eax, eax
je 0x140021ef5
lea rbx, [rbp*2]
lea ecx, [rbp + 1]
movsxd r8, ecx
add r8, r8
mov rcx, qword [r14]
test rbx, rbx
je 0x140021fb5
test rcx, rcx
jne 0x140021f9a
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], socket
jmp 0x140022121
cmp r8, rbx
jb 0x14002210e
mov r8, rbx
lea rdx, [0x1400cd920]
call sub.VCRUNTIME140.dll_memcpy
mov rcx, qword [r14]
mov dword [rcx - 8], ebp
mov rax, qword [r14]
mov word [rbx + rax], di
jmp 0x140021ef5
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x20]
call fcn.140049a60
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
jne 0x14002203c
nop dword [rax]
nop word [rax + rax]
mov r9, qword [rsp + 0x28]
mov edx, 1
mov r8d, 0x200
lea rcx, [rsp + 0xc0]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
test rax, rax
je 0x14002202d
mov r9d, eax
lea r8, [rsp + 0xc0]
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x20]
call fcn.14004a360
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
je 0x140021ff0
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0xb0]
lea rcx, [rsp + 0x20]
call fcn.140049930
nop
mov rax, qword [0x140104018]
mov qword [rsp + 0x30], rax
movzx r8d, byte [rsp + rdi + 0xb0]
lea rdx, [0x1400d0c80]
lea rcx, [rsp + 0x30]
call fcn.1400086c0
mov rbx, qword [rsp + 0x30]
mov r8, rbx
mov edx, dword [rbx - 8]
mov rcx, r14
call fcn.140025070
nop
lea rcx, [rbx - 0xc]
cmp rcx, qword [0x140104010]
je 0x1400220b7
mov eax, esi
lock xadd dword [rcx], eax
sub eax, 1
jg 0x1400220b7
call fcn.1400bf5e4
inc rdi
cmp rdi, 0x10
jl 0x140022060
mov rax, qword [r15]
add rax, 0xfffffffffffffff4
cmp rax, qword [0x140104010]
je 0x1400220e5
lock xadd dword [rax], esi
sub esi, 1
jg 0x1400220e5
mov rcx, qword [r15]
sub rcx, 0xc
call fcn.1400bf5e4
xor eax, eax
mov rcx, qword [rsp + 0x2c0]
xor rcx, rsp
call fcn.1400bf680
mov rbx, qword [rsp + 0x300]
add rsp, 0x2d0
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
xor edx, edx
call sub.VCRUNTIME140.dll_memset
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x22
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, 0x80070057
call fcn.140001ac0
int3