Function at 0x140049d50
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r14
mov rbp, rsp
sub rsp, 0x60
mov qword [rbp - 0x30], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rdi, rcx
cmp qword [rcx + 0x68], 0
je 0x140049f96
cmp byte [rcx + 0x71], 0
je 0x140049f96
mov rax, qword [rcx]
or edx, 0xffffffff
call qword [rax + Ordinal_26]
cmp eax, 0xffffffff
jne 0x140049d9b
xor al, al
jmp 0x140049f98
mov edx, reloc.WS2_32.dll_ntohs
mov qword [rbp - 0x10], rdx
mov byte [rbp - 0x28], 0
xor ecx, ecx
mov qword [rbp - 0x28], rcx
mov qword [rbp - 0x18], 8
lea rax, [rbp - 0x28]
cmp rdx, 0x10
cmovae rax, rcx
mov byte [rax + 8], cl
xor r14d, r14d
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
lea rdx, [rbp - 0x28]
cmp r9, 0x10
cmovae rdx, rcx
lea r8, [rbp - 0x28]
cmovae r8, rcx
mov r9, qword [rbp - 0x18]
add r9, rdx
lea rax, [rbp + 0x20]
mov qword [rsp + 0x20], rax
lea rdx, [rdi + 0x74]
mov rcx, qword [rdi + 0x68]
call qword [sym.imp.MSVCP140.dll_public:_int___cdecl_std::codecvt_char__char__struct__Mbstatet_::unshift_struct__Mbstatet____ptr64__char____ptr64__char____ptr64__char____ptr64____ptr64_const___ptr64]
test eax, eax
je 0x140049e11
sub eax, 1
jne 0x140049f0e
jmp 0x140049e15
mov byte [rdi + 0x71], r14b
lea rax, [rbp - 0x28]
mov rcx, qword [rbp - 0x28]
mov r9, qword [rbp - 0x10]
cmp r9, 0x10
cmovae rax, rcx
mov rbx, qword [rbp + 0x20]
sub rbx, rax
je 0x140049e67
lea rax, [rbp - 0x28]
cmp r9, 0x10
cmovae rax, rcx
mov r9, qword [rdi + 0x80]
mov r8, rbx
mov edx, 1
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
cmp rbx, rax
jne 0x140049f1b
cmp byte [rdi + 0x71], r14b
je 0x140049f3b
test rbx, rbx
jne 0x140049dd0
or rax, 0xffffffffffffffff
mov r8, qword [rbp - 0x18]
sub rax, r8
cmp rax, 8
jbe 0x140049f2d
lea rbx, [r8 + 8]
cmp rbx, 0xfffffffffffffffe
ja 0x140049f1f
cmp r9, rbx
jae 0x140049eb8
mov rdx, rbx
lea rcx, [rbp - 0x28]
call fcn.140035200
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
jmp 0x140049ed5
test rbx, rbx
jne 0x140049ede
mov qword [rbp - 0x18], r14
lea rax, [rbp - 0x28]
cmp r9, 0x10
cmovae rax, rcx
mov byte [rax], r14b
jmp 0x140049dc8
test rbx, rbx
je 0x140049dd0
lea rdx, [rbp - 0x28]
cmp r9, 0x10
cmovae rdx, rcx
mov rax, qword [rbp - 0x18]
xor ecx, ecx
mov qword [rax + rdx], rcx
mov qword [rbp - 0x18], rbx
lea rax, [rbp - 0x28]
cmp qword [rbp - 0x10], 0x10
cmovae rax, qword [rbp - 0x28]
mov byte [rbx + rax], cl
jmp 0x140049dc8
sub eax, 2
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
je 0x140049f3b
xor bl, bl
jmp 0x140049f3d
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
mov bl, 1
cmp r9, 0x10
jb 0x140049f91
lea rax, [r9 + 1]
cmp rax, 0x1000
jb 0x140049f8c
test byte [rbp - 0x28], 0x1f
je 0x140049f5c
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rax, qword [rcx - 8]
cmp rax, rcx
jb 0x140049f6c
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
sub rcx, rax
cmp rcx, 8
jae 0x140049f7c
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp rcx, 0x27
jbe 0x140049f89
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, rax
call fcn.140054a50
movzx eax, bl
jmp 0x140049f98
mov al, 1
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret