Function at 0x140008360
Capabilities:
Write file on windows

Disassembly:
mov dword [rsp + 0x10], edx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov qword [rbp - 1], 0xfffffffffffffffe
mov qword [rsp + 0xc0], rbx
mov r14d, edx
mov rdi, rcx
call fcn.140003970
mov esi, eax
mov dword [rbp + 0x77], eax
lea rdx, [rbp + 0x6f]
lea rcx, [rbp + 0x77]
call fcn.140003960
test al, al
je 0x1400083b6
lea rcx, [rbp + 0x6f]
call fcn.140003920
jmp 0x140008582
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const___ptr64]
test rax, rax
je 0x1400083fd
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::epptr_void_const___ptr64]
mov rbx, rax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const___ptr64]
cmp rax, rbx
jae 0x1400083fd
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void____ptr64]
mov rdx, rax
lea rcx, [rbp + 0x6f]
call fcn.140003940
mov byte [rdx], al
mov eax, r14d
jmp 0x140008582
cmp qword [rdi + 0x80], 0
je 0x140008580
mov rcx, rdi
call fcn.140009070
lea rcx, [rbp + 0x6f]
call fcn.140003940
cmp qword [rdi + 0x68], 0
jne 0x14000843d
movzx ecx, al
mov rdx, qword [rdi + 0x80]
call fcn.140004c50
test al, al
cmovne esi, r14d
jmp 0x140008580
mov byte [rbp - 0x19], al
xor r8d, r8d
lea edx, [r8 + 8]
lea rcx, [rbp + 0x17]
call fcn.140015440
nop
lea rdx, [rbp - 0x11]
lea rcx, [rbp + 0x17]
call fcn.140007720
mov rcx, rax
call fcn.140007290
mov rbx, rax
lea rcx, [rbp + 0x17]
call fcn.140003780
add rbx, rax
lea rdx, [rbp - 9]
lea rcx, [rbp + 0x17]
call fcn.140007720
mov rcx, rax
call fcn.140007290
lea rcx, [rbp + 0x77]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x7f]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x18]
lea r8, [rbp - 0x19]
lea rdx, [rdi + 0x74]
mov rcx, qword [rdi + 0x68]
call qword [sym.imp.MSVCP140.dll_public:_int___cdecl_std::codecvt_char__char__struct__Mbstatet_::out_struct__Mbstatet____ptr64__char_const____ptr64__char_const____ptr64__char_const____ptr64____ptr64__char____ptr64__char____ptr64__char____ptr64____ptr64_const___ptr64]
test eax, eax
js 0x140008577
cmp eax, 1
jg 0x14000855c
lea rdx, [rbp + 7]
lea rcx, [rbp + 0x17]
call fcn.140007720
mov rcx, rax
call fcn.140007290
mov rbx, qword [rbp + 0x77]
sub rbx, rax
je 0x14000851d
lea rdx, [rbp + 0xf]
lea rcx, [rbp + 0x17]
call fcn.140007720
mov rcx, rax
call fcn.140007290
mov rcx, rax
mov r9, qword [rdi + 0x80]
mov r8, rbx
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp rbx, rax
jne 0x140008577
mov byte [rdi + 0x71], 1
lea rax, [rbp - 0x19]
cmp qword [rbp + 0x7f], rax
jne 0x140008557
test rbx, rbx
jne 0x140008451
lea rcx, [rbp + 0x17]
call fcn.140003780
cmp rax, 0x20
jae 0x140008577
xor r8d, r8d
lea edx, [rbx + 8]
lea rcx, [rbp + 0x17]
call fcn.140015570
jmp 0x140008451
mov esi, r14d
jmp 0x140008577
cmp eax, 3
jne 0x140008577
mov rdx, qword [rdi + 0x80]
movzx ecx, byte [rbp - 0x19]
call fcn.140004c50
test al, al
cmovne esi, r14d
lea rcx, [rbp + 0x17]
call fcn.140001fe0
mov eax, esi
mov rbx, qword [rsp + 0xc0]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret