Function at 0x14007d290
Capabilities:
Get file size
Write file on windows

Disassembly:
push rbp
push rsi
mov rbp, rsp
sub rsp, 0x78
xor edx, edx
mov rsi, rcx
call fcn.140024c30
mov edx, eax
shr edx, 0x1f
test dl, dl
jne 0x14007d532
mov qword [rsp + 0xa0], rdi
lea rcx, [rsi + 0x28]
mov edx, 2
mov qword [rsp + 0x68], r14
call fcn.140025da0
mov r14, 0xffffffffffffffff
lea r9, [0x140148ff8]
mov rcx, r14
mov r8, rax
movzx edi, word [r8 + rcx*2 + 2]
movzx edx, word [r9 + rcx*2 + 2]
sub edi, edx
jne 0x14007d308
add rcx, 2
cmp rcx, 0x15
je 0x14007d308
movzx edi, word [r8 + rcx*2]
movzx eax, word [r9 + rcx*2]
sub edi, eax
je 0x14007d2e0
mov qword [rsp + 0x70], r12
mov qword [rsp + 0x60], r15
test edi, edi
jne 0x14007d35c
lea r15, [rsi + 0x298]
mov rcx, r15
call fcn.14002d780
mov r9d, dword [rsi + 0x264]
lea r12, [rsi + 0x2a8]
shl r9d, 2
lea r8, [rsi + 0x270]
shr r9d, 3
lea rdx, [rsi + 0x38]
mov rcx, r12
call fcn.140022bf0
test al, al
jne 0x14007d37f
mov eax, 0x80040202
jmp 0x14007d51b
mov rcx, rsi
call fcn.140024080
mov ecx, eax
shr ecx, 0x1f
test cl, cl
jne 0x14007d51b
lea r15, [rsi + 0x298]
lea r12, [rsi + 0x2a8]
mov eax, dword [rsi + 0x260]
lea r9, [rbp + 0x20]
mov rcx, qword [rsi + 0x38]
lea rdx, [rbp - 0x38]
mov qword [rsp + 0x90], rbx
xor ebx, ebx
mov dword [rbp - 0x38], 1
mov dword [rbp - 0x34], eax
mov qword [rbp - 0x30], 1
lea r8d, [rbx + 0x18]
mov qword [rbp - 0x28], rbx
mov dword [rbp + 0x20], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [rbp - 0x38]
lea r9, [rbp + 0x20]
add eax, 2
mov qword [rbp - 0x44], rbx
lea r8d, [rbx + 0xc]
mov dword [rbp + 0x20], ebx
lea rdx, [rbp - 0x48]
mov qword [rsp + 0x20], rbx
lea ecx, [rax + rax*2]
shl ecx, 2
mov dword [rbp - 0x48], ecx
mov rcx, qword [rsi + 0x38]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rsi
call fcn.1400246e0
mov ecx, eax
shr ecx, 0x1f
test cl, cl
jne 0x14007d513
test edi, edi
jne 0x14007d42c
mov rcx, r15
call fcn.14002da20
mov rcx, r12
call fcn.140023bc0
mov rax, qword [rsi + 0x268]
inc rax
sar rax, 1
jmp 0x14007d432
mov eax, dword [rsi + 0x268]
mov rcx, qword [rsi + 0x10]
mov edx, recv
mov dword [rbp - 0x44], eax
mov rax, qword [rcx]
call qword [rax + 0x40]
mov rdi, rax
test rax, rax
jne 0x14007d461
mov rcx, qword [rsi + 0x10]
lea edx, [rdi + 3]
mov rax, qword [rcx]
call qword [rax + 0x40]
mov rdi, rax
test rax, rax
je 0x14007d4a5
mov rcx, qword [rsi + 0x38]
lea rdx, [rbp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
mov ecx, ebx
cmovne ecx, dword [rbp + 0x20]
mov dword [rbp - 0x40], ecx
mov dword [rbp + 0x20], ebx
nop dword [rax]
cmp byte [rdi + r14 + 1], bl
lea r14, [r14 + 1]
jne 0x14007d480
mov rcx, qword [rsi + 0x38]
lea r8d, [r14 + 1]
lea r9, [rbp + 0x20]
mov qword [rsp + 0x20], rbx
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsi + 0x38]
lea rdx, [rbp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, ebx
mov rdx, rbx
test eax, eax
cmovne ecx, dword [rbp + 0x20]
xor r9d, r9d
mov dword [rbp - 0x28], ecx
xor r8d, r8d
mov rcx, qword [rsi + 0x38]
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov rcx, qword [rsi + 0x38]
lea r9, [rbp + 0x20]
mov r8d, 0x18
mov dword [rbp + 0x20], ebx
lea rdx, [rbp - 0x38]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsi + 0x38]
lea r9, [rbp + 0x20]
mov r8d, recv
mov dword [rbp + 0x20], ebx
lea rdx, [rbp - 0x48]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
mov rbx, qword [rsp + 0x90]
mov r12, qword [rsp + 0x70]
mov r15, qword [rsp + 0x60]
mov rdi, qword [rsp + 0xa0]
mov r14, qword [rsp + 0x68]
add rsp, 0x78
pop rsi
pop rbp
ret