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

Disassembly:
push rbp
push r15
lea rbp, [rsp - 8]
sub rsp, 0x108
lea rdx, [0x14012bb38]
mov r15, rcx
call fcn.140024c30
mov edx, eax
shr edx, 0x1f
test dl, dl
jne 0x14004d5e6
mov rcx, r15
mov byte [r15 + 0x289], 1
call fcn.140024080
mov ecx, eax
shr ecx, 0x1f
test cl, cl
jne 0x14004d5e6
mov rcx, qword [r15 + 0x10]
mov edx, 3
mov qword [rsp + 0x120], rbx
mov qword [rsp + 0xf8], rdi
mov qword [rsp + 0xf0], r12
mov rax, qword [rcx]
mov qword [rsp + 0xe8], r13
mov qword [rsp + 0xe0], r14
movaps xmmword [rsp + 0xd0], xmm6
call qword [rax + 0x40]
xor ebx, ebx
mov qword [rbp + 0x38], rax
lea r14, [rbx - 1]
test rax, rax
je 0x14004cff0
mov rdi, r14
nop word [rax + rax]
inc rdi
cmp byte [rax + rdi], bl
jne 0x14004cfe0
add edi, 2
and edi, 0xfffffffe
jmp 0x14004cff2
mov edi, ebx
mov rcx, qword [r15 + 0x10]
mov edx, reloc.WSOCK32.dll_recv
mov qword [rsp + 0x100], rsi
mov rax, qword [rcx]
call qword [rax + 0x40]
mov r13, rax
test rax, rax
je 0x14004d024
mov rsi, r14
inc rsi
cmp byte [rsi + rax], bl
jne 0x14004d014
add esi, 2
and esi, 0xfffffffe
jmp 0x14004d026
mov esi, ebx
mov rcx, qword [r15 + 0x10]
mov edx, recv
mov rax, qword [rcx]
call qword [rax + 0x40]
mov r12, rax
test rax, rax
je 0x14004d053
nop dword [rax]
inc r14
cmp byte [rax + r14], bl
jne 0x14004d040
add r14d, 2
and r14d, 0xfffffffe
jmp 0x14004d056
mov r14d, ebx
mov eax, dword [r15 + 0x258]
mov edx, 0xfffffffe
mov ecx, dword [r15 + 0x290]
imul rcx, rax
mov dword [rbp - 0x78], 0x4d524f46
imul rcx, qword [r15 + 0x250]
mov eax, ecx
cmp rax, rcx
cmovl ecx, edx
test cl, 1
lea eax, [rcx + 1]
cmove eax, ecx
mov dword [rbp + 0x30], eax
add eax, 0x2e
cmp qword [rbp + 0x38], rbx
je 0x14004d09e
add eax, 8
add eax, edi
test r13, r13
je 0x14004d0a8
add eax, 8
add eax, esi
test r12, r12
je 0x14004d0b3
add eax, 8
add eax, r14d
mov rcx, qword [r15 + 0x38]
lea r9, [rbp + 0x28]
bswap eax
mov r8d, recv
mov dword [rbp - 0x74], eax
lea rdx, [rbp - 0x78]
mov dword [rbp - 0x70], 0x46464941
mov dword [rbp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
movzx eax, word [r15 + 0x258]
lea rcx, [rsp + 0x70]
mov word [rsp + 0x68], ax
xorps xmm1, xmm1
mov eax, dword [r15 + 0x250]
mov dword [rsp + 0x6a], eax
movzx eax, word [r15 + 0x290]
shl ax, 3
mov word [rsp + 0x6e], ax
mov eax, dword [r15 + 0x260]
cvtsi2sd xmm1, rax
call fcn.14004d760
mov eax, dword [rsp + 0x6a]
lea r9, [rsp + 0x68]
ror word [rsp + 0x68], 8
mov edx, 0x4d4d4f43
ror word [rsp + 0x6e], 8
mov r8d, send
bswap eax
mov rcx, r15
mov dword [rsp + 0x6a], eax
call fcn.14004d600
mov rcx, qword [r15 + 0x10]
lea rdx, [rsp + 0x48]
mov dword [rsp + 0x48], 0x7f0000
xorps xmm6, xmm6
mov word [rsp + 0x4c], 0x3c7f
mov byte [rsp + 0x4e], bl
mov dword [rsp + 0x50], ebx
mov word [rsp + 0x54], bx
mov byte [rsp + 0x56], bl
mov qword [rsp + 0x58], rbx
mov dword [rsp + 0x60], ebx
mov rax, qword [rcx]
call qword [rax + 0x28]
cmp byte [rsp + 0x48], bl
je 0x14004d315
movzx edx, byte [rsp + 0x54]
test dl, dl
je 0x14004d211
movzx eax, byte [0x14013f848]
lea r9, [rbp - 0x60]
movsd xmm0, qword [str.beg_loop]
mov ecx, 0x200
mov byte [rbp - 0x4f], al
mov edx, 0x4b52414d
movzx eax, byte [0x14013f858]
mov r8d, 0x22
mov byte [rbp - 0x3f], al
mov eax, dword [rsp + 0x58]
bswap eax
mov dword [rbp - 0x5c], eax
mov eax, dword [rsp + 0x5c]
movsd qword [rbp - 0x57], xmm0
movsd xmm0, qword [str.end_loop]
bswap eax
mov word [rbp - 0x4e], cx
mov rcx, r15
mov dword [rbp - 0x4c], eax
mov byte [rbp - 0x58], 8
mov byte [rbp - 0x48], 8
movsd qword [rbp - 0x47], xmm0
mov dword [rbp - 0x60], 0x1000200
call fcn.14004d600
movzx edx, byte [rsp + 0x54]
movzx eax, byte [rsp + 0x4d]
mov byte [rsp + 0x30], al
movzx eax, byte [rsp + 0x4e]
mov byte [rsp + 0x31], al
movzx eax, byte [rsp + 0x49]
mov byte [rsp + 0x32], al
movzx eax, byte [rsp + 0x4a]
mov byte [rsp + 0x33], al
movzx eax, byte [rsp + 0x4b]
mov byte [rsp + 0x34], al
movzx eax, byte [rsp + 0x4c]
mov byte [rsp + 0x35], al
test dl, dl
je 0x14004d25e
cmp byte [rsp + 0x55], bl
mov ecx, ebx
setne cl
inc cx
mov word [rsp + 0x38], cx
jmp 0x14004d266
movzx ecx, bx
mov word [rsp + 0x38], bx
test dl, dl
mov r9d, ebx
movzx r10d, bx
setne r9b
neg dl
mov word [rsp + 0x3a], r9w
mov eax, dword [rsp + 0x38]
sbb r8w, r8w
and r8w, 2
mov dword [rsp + 0x3e], eax
cmp byte [rsp + 0x56], bl
jne 0x14004d296
movzx r10d, ax
movss xmm0, dword [rsp + 0x50]
comiss xmm0, xmm6
jae 0x14004d2ab
subss xmm0, dword [0x14012bc68]
jmp 0x14004d2b3
addss xmm0, dword [0x14012bc68]
ror word [rsp + 0x40], 8
movzx eax, r8w
cvttss2si edx, xmm0
ror cx, 8
ror r9w, 8
ror r8w, 8
mov word [rsp + 0x38], cx
mov rcx, r15
mov word [rsp + 0x3a], r9w
lea r9, [rsp + 0x30]
ror ax, 8
ror r10w, 8
ror dx, 8
mov word [rsp + 0x36], dx
mov edx, 0x54534e49
mov word [rsp + 0x42], r8w
mov r8d, socket
mov word [rsp + 0x3c], ax
mov word [rsp + 0x3e], r10w
call fcn.14004d600
mov rcx, qword [r15 + 0x38]
lea r8, [rbp + 0x28]
mov r9d, 1
mov qword [rbp + 0x28], rbx
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov rcx, qword [r15 + 0x38]
lea r9, [rbp + 0x28]
test eax, eax
mov qword [rbp - 0x68], rbx
mov rax, 0xffffffffffffffff
mov dword [rbp - 0x80], 0x444e5353
cmovne rax, qword [rbp + 0x28]
lea rdx, [rbp - 0x80]
mov qword [rbp - 0x38], rax
mov r8d, 8
mov eax, dword [rbp + 0x30]
add eax, 8
mov dword [rbp + 0x28], ebx
bswap eax
mov dword [rbp - 0x7c], eax
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [r15 + 0x38]
lea r9, [rbp + 0x28]
mov r8d, 8
mov dword [rbp + 0x28], ebx
lea rdx, [rbp - 0x68]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, r15
call fcn.1400246e0
movaps xmm6, xmmword [rsp + 0xd0]
mov ecx, eax
shr ecx, 0x1f
test cl, cl
jne 0x14004d5b6
mov eax, dword [r15 + 0x290]
imul eax, dword [r15 + 0x268]
imul eax, dword [r15 + 0x258]
mov dword [rbp + 0x30], eax
test al, 1
je 0x14004d3f6
mov rcx, qword [r15 + 0x38]
lea r9, [rbp + 0x28]
mov r8d, 1
mov dword [rbp + 0x28], ebx
lea rdx, [0x14013f838]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rax, qword [rbp + 0x38]
test rax, rax
je 0x14004d412
mov r9, rax
mov r8d, edi
mov edx, 0x454d414e
mov rcx, r15
call fcn.14004d600
test r13, r13
je 0x14004d42a
mov r9, r13
mov r8d, esi
mov edx, 0x20296328
mov rcx, r15
call fcn.14004d600
test r12, r12
je 0x14004d442
mov r9, r12
mov r8d, r14d
mov edx, 0x4f4e4e41
mov rcx, r15
call fcn.14004d600
cmp byte [0x1401a8ff3], bl
lea rdi, [r15 + 0x38]
je 0x14004d504
mov rcx, rdi
call fcn.14004cf00
mov rcx, qword [rdi]
lea r9, [rbp + 0x28]
mov r8d, 8
mov qword [rbp + 0x38], 0x20334449
lea rdx, [rbp + 0x38]
mov dword [rbp + 0x28], ebx
mov rsi, rax
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rdx, qword [r15 + 0x10]
mov rcx, rdi
call fcn.14005efe0
mov rcx, rdi
call fcn.14004cf00
mov edx, 0xfffffff8
sub edx, esi
add edx, eax
mov dword [rbp + 0x3c], edx
test dl, 1
je 0x14004d4cb
mov rcx, qword [rdi]
lea r9, [rbp + 0x28]
mov r8d, 1
mov dword [rbp + 0x28], ebx
lea rdx, [0x14013f838]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rdi]
xor r9d, r9d
xor r8d, r8d
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [rbp + 0x3c]
lea r9, [rbp + 0x28]
mov rcx, qword [rdi]
lea rdx, [rbp + 0x38]
bswap eax
mov r8d, 8
mov dword [rbp + 0x3c], eax
mov dword [rbp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rdi]
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov rcx, qword [rdi]
lea rdx, [rbp + 0x28]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, ebx
mov qword [rsp + 0x20], rbx
test eax, eax
lea r9, [rbp + 0x28]
mov r8d, recv
lea rdx, [rbp - 0x78]
cmovne ecx, dword [rbp + 0x28]
sub ecx, 8
mov dword [rbp + 0x28], ebx
bswap ecx
mov dword [rbp - 0x74], ecx
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [r15 + 0x268]
lea r9, [rsp + 0x68]
bswap eax
mov edx, 0x4d4d4f43
mov dword [rsp + 0x6a], eax
mov r8d, send
mov rcx, r15
call fcn.14004d600
mov rdx, qword [rbp - 0x38]
xor r9d, r9d
mov rcx, qword [rdi]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [rbp + 0x30]
lea r9, [rbp + 0x28]
mov rcx, qword [rdi]
lea rdx, [rbp - 0x80]
add eax, 8
mov dword [rbp + 0x28], ebx
bswap eax
mov r8d, 8
mov dword [rbp - 0x7c], eax
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
mov rsi, qword [rsp + 0x100]
mov r12, qword [rsp + 0xf0]
mov rdi, qword [rsp + 0xf8]
mov r13, qword [rsp + 0xe8]
mov rbx, qword [rsp + 0x120]
mov r14, qword [rsp + 0xe0]
add rsp, 0x108
pop r15
pop rbp
ret