Function at 0x140046d30
Capabilities:
Write file on windows

Disassembly:
mov dword [rsp + 0x10], edx
mov qword [rsp + 8], rcx
sub rsp, 0xb8
call fcn.140018a50
mov edx, dword [rsp + 0xc8]
mov ecx, eax
call fcn.140018ab0
movzx eax, al
test eax, eax
je 0x140046d6b
mov ecx, dword [rsp + 0xc8]
call fcn.140018a60
jmp 0x140046fca
mov rcx, qword [rsp + 0xc0]
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 0x140046dda
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const___ptr64]
mov qword [rsp + 0x58], rax
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::epptr_void_const___ptr64]
mov rcx, qword [rsp + 0x58]
cmp rcx, rax
jae 0x140046dda
mov ecx, dword [rsp + 0xc8]
call fcn.140018af0
mov byte [rsp + 0x42], al
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void____ptr64]
movzx ecx, byte [rsp + 0x42]
mov byte [rax], cl
mov eax, dword [rsp + 0xc8]
jmp 0x140046fca
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x80], 0
jne 0x140046df6
call fcn.140018a50
jmp 0x140046fca
mov rcx, qword [rsp + 0xc0]
call fcn.1400482c0
mov rax, qword [rsp + 0xc0]
cmp qword [rax + 0x68], 0
jne 0x140046e6b
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x80]
mov qword [rsp + 0x60], rax
mov ecx, dword [rsp + 0xc8]
call fcn.140018af0
mov byte [rsp + 0x43], al
mov rdx, qword [rsp + 0x60]
movzx ecx, byte [rsp + 0x43]
call fcn.14003fcc0
movzx eax, al
test eax, eax
je 0x140046e59
mov eax, dword [rsp + 0xc8]
mov dword [rsp + 0x48], eax
jmp 0x140046e62
call fcn.140018a50
mov dword [rsp + 0x48], eax
mov eax, dword [rsp + 0x48]
jmp 0x140046fca
mov qword [rsp + 0x80], reloc.WLDAP32.dll_Ordinal_32
mov ecx, dword [rsp + 0xc8]
call fcn.140018af0
mov byte [rsp + 0x40], al
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x68]
mov qword [rsp + 0x68], rax
lea rax, [rsp + 0xa8]
lea rcx, [rsp + 0x41]
mov rdx, qword [rsp + 0xc0]
add rdx, 0x74
lea r8, [rsp + 0x70]
mov qword [rsp + 0x38], r8
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x88]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
mov r9, rcx
lea r8, [rsp + 0x40]
mov rcx, qword [rsp + 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]
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 0
je 0x140046f0c
cmp dword [rsp + 0x44], 1
je 0x140046f0c
cmp dword [rsp + 0x44], 3
je 0x140046f89
jmp 0x140046fc5
lea rax, [rsp + 0x88]
mov rcx, qword [rsp + 0x70]
sub rcx, rax
mov rax, rcx
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
jbe 0x140046f61
mov rax, qword [rsp + 0xc0]
mov r9, qword [rax + 0x80]
mov r8, qword [rsp + 0x50]
mov edx, 1
lea rcx, [rsp + 0x88]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp qword [rsp + 0x50], rax
je 0x140046f61
call fcn.140018a50
jmp 0x140046fca
mov rax, qword [rsp + 0xc0]
mov byte [rax + 0x71], 1
lea rax, [rsp + 0x40]
cmp qword [rsp + 0x78], rax
je 0x140046f82
mov eax, dword [rsp + 0xc8]
jmp 0x140046fca
call fcn.140018a50
jmp 0x140046fca
mov rax, qword [rsp + 0xc0]
mov rdx, qword [rax + 0x80]
movzx ecx, byte [rsp + 0x40]
call fcn.14003fcc0
movzx eax, al
test eax, eax
je 0x140046fb6
mov eax, dword [rsp + 0xc8]
mov dword [rsp + 0x4c], eax
jmp 0x140046fbf
call fcn.140018a50
mov dword [rsp + 0x4c], eax
mov eax, dword [rsp + 0x4c]
jmp 0x140046fca
call fcn.140018a50
add rsp, 0xb8
ret