Function at 0x140023750
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x2000]
mov eax, 0x2100
call fcn.1400bfe00
sub rsp, rax
mov qword [rbp - 0x30], 0xfffffffffffffffe
mov qword [rsp + 0x2150], rbx
movaps xmmword [rsp + 0x20f0], xmm6
mov rax, qword [0x140104508]
xor rax, rsp
mov qword [rbp + 0x1fe0], rax
mov rbx, rdx
mov qword [rbp - 0x48], rdx
mov r13, rcx
xor r14d, r14d
mov dword [rsp + 0x58], r14d
mov rax, qword [0x140104018]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x68], rax
mov dword [rsp + 0x4c], r14d
mov dword [rsp + 0x5c], r14d
add rcx, 8
mov edx, dword [r13 + 0x5c4]
call fcn.140009b60
mov rcx, rax
lea rdx, [rbp - 0x60]
call fcn.1400092b0
nop
lea r15d, [r14 - 1]
cmp dword [rbx + 0x18], r14d
je 0x140023d49
mov r8, qword [rbx + 8]
lea rdx, [0x1400d0948]
lea rcx, [rsp + 0x40]
call fcn.1400086c0
mov rax, qword [rsp + 0x40]
cmp dword [rax - 0xc], r14d
jl 0x14002381d
mov qword [rsp + 0x78], rax
lock inc dword [rax - 0xc]
jmp 0x140023838
mov rax, qword [0x140104018]
mov qword [rsp + 0x78], rax
mov rdx, qword [rsp + 0x40]
lea rcx, [rsp + 0x78]
call fcn.140006470
add r13, 0x5d8
xor r9d, r9d
xor r8d, r8d
lea rdx, [rsp + 0x78]
mov rcx, r13
call fcn.140002330
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
lea r8d, [r9 + 3]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
cmp rax, 0xffffffffffffffff
jne 0x140023925
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x58]
call fcn.1400513a0
nop
lea rcx, [rbx + 0x20]
mov rdx, rax
call fcn.1400063d0
nop
mov rcx, qword [rbp - 0x58]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x1400238d0
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x1400238d0
mov rcx, qword [rbp - 0x58]
add rcx, 0xfffffffffffffff4
call fcn.1400bf5e4
mov r8, qword [rbx + 8]
lea rdx, [0x1400d0970]
lea rcx, [rsp + 0x40]
call fcn.1400086c0
mov rax, qword [rsp + 0x40]
cmp dword [rax - 0xc], 0
jl 0x1400238fa
mov qword [rbp - 0x80], rax
lock inc dword [rax - 0xc]
jmp 0x140023913
mov rax, qword [0x140104018]
mov qword [rbp - 0x80], rax
mov rdx, qword [rsp + 0x40]
lea rcx, [rbp - 0x80]
call fcn.140006470
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp - 0x80]
mov rcx, r13
call fcn.140002330
lea rdx, [rbp - 0x38]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x1400239e6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x50]
call fcn.1400513a0
nop
lea rcx, [rbx + 0x20]
mov rdx, rax
call fcn.1400063d0
nop
mov rcx, qword [rbp - 0x50]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x140023983
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023983
mov rcx, qword [rbp - 0x50]
add rcx, 0xfffffffffffffff4
call fcn.1400bf5e4
mov r8, qword [rbx + 8]
lea rdx, [0x1400d09a0]
lea rcx, [rsp + 0x40]
call fcn.1400086c0
mov rax, qword [rsp + 0x40]
cmp dword [rax - 0xc], 0
jl 0x1400239ad
mov qword [rbp - 0x78], rax
lock inc dword [rax - 0xc]
jmp 0x1400239c6
mov rax, qword [0x140104018]
mov qword [rbp - 0x78], rax
mov rdx, qword [rsp + 0x40]
lea rcx, [rbp - 0x78]
call fcn.140006470
lea rdx, [rbp - 0x78]
xor r9d, r9d
xor r8d, r8d
mov rcx, r13
call fcn.140002330
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140023d4f
mov rbx, qword [0x140104018]
mov qword [rsp + 0x60], rbx
mov dword [rsp + 0x58], 1
lea rcx, [0x1400cd944]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [rsp + 0x48], eax
mov rcx, qword [rbp - 0x60]
mov qword [rsp + 0x50], rcx
movsxd rdi, dword [rcx - 8]
lea esi, [rax + rdi]
cmp esi, edi
jl 0x140023aa4
cmp esi, eax
jl 0x140023aa4
test esi, esi
je 0x140023aa4
mov edx, esi
lea rcx, [rsp + 0x60]
call fcn.140001970
mov rbx, qword [rsp + 0x60]
test eax, eax
je 0x140023aa4
add rdi, rdi
lea eax, [rsi + 1]
movsxd rdx, eax
add rdx, rdx
mov r9, rdi
mov r8, qword [rsp + 0x50]
mov rcx, rbx
call fcn.1400029b0
movsxd rax, dword [rsp + 0x48]
mov rdx, rax
inc eax
movsxd r8, eax
add r8, r8
lea rcx, [rdi + rbx]
add rdx, rdx
je 0x140023aa4
test rcx, rcx
jne 0x140023a8b
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], socket
jmp 0x140023e08
cmp r8, rdx
jb 0x140023df5
mov r8, rdx
lea rdx, [0x1400cd944]
call sub.VCRUNTIME140.dll_memcpy
nop
mov rdi, qword [0x140104018]
mov qword [rsp + 0x50], rdi
mov dword [rsp + 0x58], 3
mov rsi, qword [rbp - 0x48]
mov rax, qword [rsi]
mov qword [rsp + 0x70], rax
mov ecx, dword [rax - 8]
mov dword [rsp + 0x48], ecx
mov edx, dword [rbx - 8]
mov dword [rbp - 0x68], edx
lea eax, [rdx + rcx]
cmp eax, edx
jl 0x140023b3e
cmp eax, ecx
jl 0x140023b3e
test eax, eax
je 0x140023b3e
mov edx, eax
lea rcx, [rsp + 0x50]
call fcn.140001970
mov rdi, qword [rsp + 0x50]
test eax, eax
je 0x140023b3e
movsxd rdx, dword [rbp - 0x68]
lea rsi, [rdx + rdx]
mov eax, dword [rsp + 0x48]
inc edx
add eax, edx
movsxd rdx, eax
add rdx, rdx
mov r9, rsi
mov r8, rbx
mov rcx, rdi
call fcn.1400029b0
movsxd rax, dword [rsp + 0x48]
mov r9, rax
add r9, r9
inc eax
movsxd rdx, eax
add rdx, rdx
lea rcx, [rsi + rdi]
mov r8, qword [rsp + 0x70]
call fcn.1400029b0
mov rsi, qword [rbp - 0x48]
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x68]
call fcn.1400063d0
nop
lea rcx, [rdi - 0xc]
cmp rcx, qword [0x140104010]
je 0x140023b71
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023b6c
call fcn.1400bf5e4
mov rbx, qword [rsp + 0x60]
lea rcx, [rbx - 0xc]
cmp rcx, qword [0x140104010]
je 0x140023b8f
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023b8f
call fcn.1400bf5e4
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 1]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140023c62
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x40]
call fcn.1400513a0
nop
lea rcx, [rsi + 0x20]
mov rdx, rax
call fcn.1400063d0
nop
mov rcx, qword [rbp - 0x40]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x140023c0e
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023c0e
mov rcx, qword [rbp - 0x40]
add rcx, 0xfffffffffffffff4
call fcn.1400bf5e4
mov r8, qword [rsp + 0x68]
lea rdx, [0x1400d09e0]
lea rcx, [rsp + 0x40]
call fcn.1400086c0
mov rax, qword [rsp + 0x40]
cmp dword [rax - 0xc], 0
jl 0x140023c40
mov qword [rbp - 0x70], rax
lock inc dword [rax - 0xc]
lea rdx, [rbp - 0x70]
jmp 0x1400239ca
mov rax, qword [0x140104018]
mov qword [rbp - 0x70], rax
mov rdx, qword [rsp + 0x40]
lea rcx, [rbp - 0x70]
call fcn.140006470
lea rdx, [rbp - 0x70]
jmp 0x1400239ca
mov rbx, r14
mov rcx, r13
call fcn.140001fb0
test al, al
jne 0x140023d0f
movss xmm6, dword [0x1400d230c]
nop dword [rax]
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x4c]
mov r8d, 0x400
lea rdx, [rbp - 0x20]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140023d29
mov r8d, dword [rsp + 0x4c]
test r8d, r8d
je 0x140023d29
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x5c]
lea rdx, [rbp - 0x20]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140023d29
mov eax, dword [rsp + 0x5c]
cmp dword [rsp + 0x4c], eax
jne 0x140023d29
add rbx, rax
xorps xmm1, xmm1
cvtsi2ss xmm1, rbx
mulss xmm1, xmm6
xorps xmm0, xmm0
cvtsi2ss xmm0, qword [rbp - 0x38]
divss xmm1, xmm0
cvttss2si edx, xmm1
xor r8d, r8d
mov rcx, r13
call fcn.1400022e0
mov rcx, r13
call fcn.140001fb0
test al, al
je 0x140023c80
cmp r12, 0xffffffffffffffff
je 0x140023d1e
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140023d4f
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rdx, [rsp + 0x68]
lea rcx, [rsi + 8]
call fcn.1400063d0
mov r14d, 1
mov rcx, qword [rbp - 0x60]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x140023d7a
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023d7a
mov rcx, qword [rbp - 0x60]
add rcx, 0xfffffffffffffff4
call fcn.1400bf5e4
nop
mov rcx, qword [rsp + 0x68]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x140023d9e
mov eax, r15d
lock xadd dword [rcx], eax
sub eax, 1
jg 0x140023d9e
call fcn.1400bf5e4
nop
mov rcx, qword [rsp + 0x40]
add rcx, 0xfffffffffffffff4
cmp rcx, qword [0x140104010]
je 0x140023dc0
lock xadd dword [rcx], r15d
sub r15d, 1
jg 0x140023dc0
call fcn.1400bf5e4
mov eax, r14d
mov rcx, qword [rbp + 0x1fe0]
xor rcx, rsp
call fcn.1400bf680
mov rbx, qword [rsp + 0x2150]
movaps xmm6, xmmword [rsp + 0x20f0]
add rsp, 0x2100
pop r15
pop r14
pop r13
pop r12
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