Function at 0x140004cb0
Capabilities:
Write file on windows

Disassembly:
push rbp
push rbx
push r12
push r13
push r14
lea rbp, [rsp - 0x24f0]
mov eax, 0x25f0
call fcn.14005e100
sub rsp, rax
mov rax, qword [0x140083180]
xor rax, rsp
mov qword [rbp + 0x24d0], rax
xor r13d, r13d
mov qword [rsp + 0x68], r9
mov r10d, edx
mov rbx, rcx
mov dword [rsp + 0x40], r13d
mov r14d, r13d
mov qword [rsp + 0x58], r13
mov r12d, r13d
mov qword [rsp + 0x50], r13
test rcx, rcx
je 0x1400051d0
mov rdx, qword [rcx + 0x68]
test rdx, rdx
je 0x1400051c9
cmp qword [rcx + 0x48], r13
je 0x1400051c9
cmp r10d, dword [rcx + 0x10]
jae 0x140004d35
mov rax, qword [rdx + 0x20]
mov r8d, dword [rax + r10*4]
add r8, qword [rdx]
jmp 0x140004d38
mov r8, r13
lea r9, [rbp - 0x70]
mov qword [rsp + 0x20], r13
mov edx, r10d
call fcn.1400046c0
test eax, eax
je 0x1400051d0
cmp dword [rbp - 0x2c], r12d
jne 0x1400051bf
cmp qword [rbp - 0x50], r12
je 0x1400051bf
test byte [rbp - 0x5c], 0x61
je 0x140004d79
mov dword [rbx + 0x1c], 5
xor eax, eax
jmp 0x140004ec7
mov eax, 0xfff7
test word [rbp - 0x5a], ax
je 0x140004d92
mov dword [rbx + 0x1c], 4
xor eax, eax
jmp 0x140004ec7
mov rcx, qword [rbx + 0x60]
lea r8, [rbp + 0x24b0]
mov qword [rsp + 0x25e8], rdi
mov r9d, 0x1e
mov rdi, qword [rbp - 0x38]
mov rdx, rdi
call qword [rbx + 0x48]
cmp rax, 0x1e
je 0x140004dc9
mov dword [rbx + 0x1c], shutdown
xor eax, eax
jmp 0x140004ebf
movzx eax, byte [rbp + 0x24b2]
movzx ecx, byte [rbp + 0x24b3]
shl ecx, 8
or ecx, eax
mov qword [rsp + 0x25e0], r15
movzx eax, byte [rbp + 0x24b1]
shl ecx, 8
or ecx, eax
movzx eax, byte [rbp + 0x24b0]
shl ecx, 8
or ecx, eax
cmp ecx, 0x4034b50
jne 0x1400051b1
movzx eax, byte [rbp + 0x24ca]
movzx r15d, byte [rbp + 0x24cb]
movzx ecx, byte [rbp + 0x24cd]
mov r8, qword [rbp - 0x50]
shl r15, 8
or r15, rax
shl rcx, 8
movzx eax, byte [rbp + 0x24cc]
add r15, rdi
or rcx, rax
add rcx, 0x1e
add r15, rcx
lea rax, [r15 + r8]
cmp rax, qword [rbx]
ja 0x1400051b1
mov rcx, qword [rbx + 0x68]
mov qword [rsp + 0x2630], rsi
mov rax, qword [rcx + 0x80]
test rax, rax
je 0x140004e7e
add rax, r15
mov rdx, r8
mov qword [rsp + 0x48], rax
mov rdi, r8
mov qword [rsp + 0x60], rdx
mov rsi, r13
jmp 0x140004ef9
mov rcx, qword [rbx + 0x40]
mov eax, 0x10000
cmp r8, rax
mov edx, 1
cmovb rax, r8
mov r8, rax
mov qword [rsp + 0x60], rax
call qword [rbx + 0x28]
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x140004ee6
mov dword [rbx + 0x1c], reloc.WS2_32.dll_recv
mov rsi, qword [rsp + 0x2630]
mov r15, qword [rsp + 0x25e0]
mov rdi, qword [rsp + 0x25e8]
mov rcx, qword [rbp + 0x24d0]
xor rcx, rsp
call fcn.14005d470
add rsp, 0x25f0
pop r14
pop r13
pop r12
pop rbx
pop rbp
ret
mov r8, qword [rbp - 0x50]
mov rdi, r13
mov rcx, qword [rbx + 0x68]
mov rsi, r8
mov rdx, qword [rsp + 0x60]
cmp word [rbp - 0x5a], r12w
je 0x140005080
mov rcx, qword [rbx + 0x40]
mov edx, 1
mov r8d, 0x8000
mov dword [rbp + 0x3f0], r13d
call qword [rbx + 0x28]
mov qword [rsp + 0x50], rax
test rax, rax
jne 0x140004f50
mov dword [rbx + 0x1c], reloc.WS2_32.dll_recv
jmp 0x14000516d
mov rax, qword [rsp + 0x50]
nop word [rax + rax]
mov rcx, r12
and ecx, 0x7fff
lea r14, [rcx + rax]
mov eax, 0x8000
sub rax, rcx
mov qword [rsp + 0x70], r14
mov qword [rsp + 0x78], rax
test rdi, rdi
jne 0x140004fb5
mov rax, qword [rbx + 0x68]
cmp qword [rax + 0x80], rdi
jne 0x140004fb5
cmp qword [rsp + 0x60], rsi
mov rdi, rsi
mov r8, qword [rsp + 0x48]
mov rdx, r15
cmovb rdi, qword [rsp + 0x60]
mov rcx, qword [rbx + 0x60]
mov r9, rdi
call qword [rbx + 0x48]
cmp rax, rdi
jne 0x140005068
add r15, rdi
mov qword [rsp + 0x58], r13
sub rsi, rdi
mov rdx, qword [rsp + 0x58]
lea r8, [rbp - 0x80]
mov r9, qword [rsp + 0x50]
mov rax, rsi
neg rax
mov qword [rbp - 0x80], rdi
lea rax, [rsp + 0x78]
sbb ecx, ecx
add rdx, qword [rsp + 0x48]
and ecx, 2
mov dword [rsp + 0x30], ecx
lea rcx, [rbp + 0x3f0]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r14
call fcn.140001a10
mov r8, qword [rsp + 0x78]
mov r14d, eax
mov rax, qword [rbp - 0x80]
add qword [rsp + 0x58], rax
sub rdi, rax
test r8, r8
je 0x140005053
mov r9, qword [rsp + 0x68]
mov edx, 1
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov r13, qword [rsp + 0x78]
cmp rax, r13
jne 0x140005074
mov rdx, qword [rsp + 0x70]
mov r8, r13
mov ecx, dword [rsp + 0x40]
call fcn.140001900
add r12, r13
mov dword [rsp + 0x40], eax
cmp r12, qword [rbp - 0x48]
ja 0x140005166
xor r13d, r13d
cmp r14d, 1
je 0x140004f40
cmp r14d, 2
jne 0x1400050c7
jmp 0x140004f40
mov dword [rbx + 0x1c], shutdown
jmp 0x14000516d
mov dword [rbx + 0x1c], 0x1f
jmp 0x14000516d
cmp qword [rcx + 0x80], r12
je 0x1400050d2
mov r9, qword [rsp + 0x68]
mov edx, 1
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov r12, qword [rbp - 0x50]
cmp rax, r12
je 0x1400050b4
mov dword [rbx + 0x1c], 0x1f
mov r14d, 0xffffffff
jmp 0x1400050c7
mov rdx, qword [rsp + 0x48]
mov r8, r12
xor ecx, ecx
call fcn.140001900
mov dword [rsp + 0x40], eax
test r14d, r14d
jne 0x140005173
jmp 0x14000514e
test rsi, rsi
je 0x14000514e
jmp 0x1400050e5
mov rax, qword [rsp + 0x48]
mov rcx, qword [rbx + 0x60]
cmp rdx, rsi
mov rdi, rsi
mov r8, rax
cmovb rdi, rdx
mov rdx, r15
mov r9, rdi
call qword [rbx + 0x48]
cmp rax, rdi
jne 0x140005068
mov rdx, qword [rsp + 0x48]
mov r8, rdi
mov ecx, dword [rsp + 0x40]
call fcn.140001900
mov r9, qword [rsp + 0x68]
mov r8, rdi
mov rcx, qword [rsp + 0x48]
mov edx, 1
mov dword [rsp + 0x40], eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp rax, rdi
jne 0x140005074
mov rdx, qword [rsp + 0x60]
add r15, rdi
add r12, rdi
sub rsi, rdi
jne 0x1400050e0
cmp r12, qword [rbp - 0x48]
je 0x14000515d
mov dword [rbx + 0x1c], ntohs
jmp 0x14000516d
mov eax, dword [rsp + 0x40]
cmp eax, dword [rbp - 0x58]
je 0x140005173
mov dword [rbx + 0x1c], ntohs
mov r14d, 0xffffffff
mov rax, qword [rbx + 0x68]
cmp qword [rax + 0x80], 0
jne 0x14000518d
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rbx + 0x40]
call qword [rbx + 0x30]
mov rax, qword [rsp + 0x50]
test rax, rax
je 0x1400051a1
mov rcx, qword [rbx + 0x40]
mov rdx, rax
call qword [rbx + 0x30]
test r14d, r14d
mov eax, 0
sete al
jmp 0x140004eaf
mov dword [rbx + 0x1c], 9
xor eax, eax
jmp 0x140004eb7
mov eax, 1
jmp 0x140004ec7
mov dword [rcx + 0x1c], 0x18
xor eax, eax
jmp 0x140004ec7