Function at 0x405290
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x30
mov eax, dword [0x40c1c0]
xor eax, esp
mov dword [esp + 0x2c], eax
push ebx
mov ebx, dword [esp + 0x38]
push edi
mov edi, ecx
cmp ebx, 0xffffffff
jne 0x4052c0
pop edi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4
push esi
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
test eax, eax
je 0x405301
mov ecx, edi
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::epptr_void_const]
mov ecx, edi
mov esi, eax
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
cmp eax, esi
jae 0x405301
mov ecx, edi
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void_]
pop esi
pop edi
mov byte [eax], bl
mov eax, ebx
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4
cmp dword [edi + 0x4c], 0
je 0x40540d
mov ecx, edi
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::eback_void_const]
lea ecx, [edi + 0x3c]
cmp eax, ecx
jne 0x40532a
push dword [edi + 0x54]
mov eax, dword [edi + 0x50]
mov ecx, edi
push eax
push eax
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::setg_char___char___char__]
mov ecx, dword [edi + 0x38]
test ecx, ecx
jne 0x40535f
push dword [edi + 0x4c]
movsx eax, bl
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputc]
add esp, 8
or ecx, 0xffffffff
cmp eax, ecx
cmove ebx, ecx
pop esi
pop edi
mov eax, ebx
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4
lea eax, [esp + 0x10]
mov byte [esp + 0xc], bl
push eax
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x1d]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [edi + 0x40]
push eax
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::codecvt_char__char__struct__Mbstatet_::out_struct__Mbstatet___char_const___char_const___char_const____char___char___char___const]
sub eax, 0
je 0x4053c7
sub eax, 1
je 0x4053c7
sub eax, 2
jne 0x40540d
push dword [edi + 0x4c]
push dword [esp + 0x10]
call fcn.00402d20
add esp, 8
or ecx, 0xffffffff
test al, al
cmove ebx, ecx
pop esi
pop edi
mov eax, ebx
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x18]
sub esi, eax
je 0x4053e7
push dword [edi + 0x4c]
push esi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp esi, eax
jne 0x40540d
lea ecx, [esp + 0xc]
mov byte [edi + 0x3d], 1
or eax, 0xffffffff
cmp dword [esp + 0x14], ecx
pop esi
pop edi
cmovne eax, ebx
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4
mov ecx, dword [esp + 0x38]
or eax, 0xffffffff
pop esi
pop edi
pop ebx
xor ecx, esp
call fcn.00406518
add esp, 0x30
ret 4