Function at 0x409a70
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x58b6f8
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
mov ebx, dword [ebp + 8]
push edi
mov edi, ecx
cmp ebx, 0xffffffff
jne 0x409aab
pop edi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
push esi
call dword [sym.imp.MSVCP120.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
test eax, eax
je 0x409adb
mov eax, dword [edi + 0x30]
mov ecx, dword [edi + 0x20]
mov esi, dword [eax]
add esi, dword [ecx]
mov ecx, edi
call dword [sym.imp.MSVCP120.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
cmp eax, esi
jae 0x409adb
mov ecx, edi
call dword [sym.imp.MSVCP120.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void_]
mov byte [eax], bl
jmp 0x409c53
cmp dword [edi + 0x50], 0
jne 0x409af7
pop esi
pop edi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0xc]
mov ecx, dword [eax]
lea eax, [edi + 0x44]
cmp ecx, eax
jne 0x409b13
push dword [edi + 0x3c]
mov eax, dword [edi + 0x38]
mov ecx, edi
push eax
push eax
call dword [sym.imp.MSVCP120.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::setg_char___char___char__]
cmp dword [edi + 0x40], 0
jne 0x409b46
push dword [edi + 0x50]
movsx eax, bl
push eax
call dword [sym.imp.MSVCR120.dll_fputc]
add esp, 8
or ecx, 0xffffffff
cmp eax, ecx
cmovne ecx, ebx
pop esi
pop edi
mov eax, ecx
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov ecx, 0xf
mov byte [ebp - 0x2c], 0
xorps xmm0, xmm0
mov byte [ebp - 0x10], bl
cmp ecx, 0x10
movq qword [ebp - 0x2c], xmm0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x18], ecx
cmovae eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], 8
mov byte [eax + 8], 0
mov dword [ebp - 4], 0
lea esp, [esp]
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp + 8]
push eax
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x2c]
cmovae edx, dword [ebp - 0x2c]
lea ecx, [ebp - 0x2c]
cmovae ecx, dword [ebp - 0x2c]
add eax, edx
push eax
push ecx
mov ecx, dword [edi + 0x40]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xf]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [edi + 0x48]
push eax
call dword [sym.imp.MSVCP120.dll_public:_int___thiscall_std::codecvt_char__char__int_::out_int___char_const___char_const___char_const____char___char___char___const]
test eax, eax
js 0x409c3f
cmp eax, 1
jg 0x409c20
mov ecx, dword [ebp - 0x18]
lea eax, [ebp - 0x2c]
mov edx, dword [ebp - 0x2c]
cmp ecx, 0x10
mov esi, dword [ebp + 8]
cmovae eax, edx
sub esi, eax
je 0x409bf6
push dword [edi + 0x50]
cmp ecx, 0x10
lea eax, [ebp - 0x2c]
push esi
cmovae eax, edx
push 1
push eax
call dword [sym.imp.MSVCR120.dll_fwrite]
add esp, 0x10
cmp esi, eax
jne 0x409c3f
lea eax, [ebp - 0x10]
mov byte [edi + 0x45], 1
cmp dword [ebp - 0x14], eax
jne 0x409c42
test esi, esi
jne 0x409b80
cmp dword [ebp - 0x1c], 0x20
jae 0x409c3f
push esi
push 8
lea ecx, [ebp - 0x2c]
call fcn.004093e0
jmp 0x409b80
cmp eax, 3
jne 0x409c3f
push dword [edi + 0x50]
push dword [ebp - 0x10]
call fcn.00408c50
or ecx, 0xffffffff
add esp, 8
test al, al
cmovne ecx, ebx
mov ebx, ecx
jmp 0x409c42
or ebx, 0xffffffff
cmp dword [ebp - 0x18], 0x10
jb 0x409c53
push dword [ebp - 0x2c]
call sub.MSVCR120.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [ebp - 0xc]
mov eax, ebx
pop esi
pop edi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4