Function at 0x410150
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x510458
push eax
mov dword fs:[0], esp
sub esp, 0x28
push ebx
mov ebx, dword [ebp + 8]
mov eax, 0xffff
push edi
mov edi, ecx
cmp ax, bx
jne 0x410190
pop edi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0x24]
mov ecx, dword [eax]
test ecx, ecx
je 0x4101c7
mov eax, ecx
mov ecx, dword [edi + 0x34]
mov edx, dword [ecx]
lea ecx, [eax + edx*2]
cmp eax, ecx
jae 0x4101c7
mov ecx, edi
call dword [sym.imp.MSVCP100.dll_protected:_wchar_t____thiscall_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::_Pninc_void_]
mov word [eax], bx
pop edi
mov ax, bx
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
cmp dword [edi + 0x54], 0
jne 0x4101e4
pop edi
mov eax, 0xffff
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov edx, dword [edi + 0x10]
lea ecx, [edi + 0x48]
cmp dword [edx], ecx
jne 0x4101ff
mov eax, dword [edi + 0x40]
mov edx, dword [edi + 0x3c]
push eax
push eax
push edx
mov ecx, edi
call dword [sym.imp.MSVCP100.dll_protected:_void___thiscall_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::setg_wchar_t___wchar_t___wchar_t__]
cmp dword [edi + 0x44], 0
jne 0x410238
mov edi, dword [edi + 0x54]
push edi
push ebx
call dword [sym.imp.MSVCR100.dll_fputwc]
mov ecx, 0xffff
add esp, 8
cmp ax, cx
movzx eax, bx
jne 0x410378
pop edi
mov eax, ecx
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
movzx edx, bx
push esi
lea esi, [ebp - 0x34]
mov dword [ebp - 0x10], edx
call fcn.00411770
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x20]
mov ecx, eax
cmp edx, 0x10
jae 0x410260
lea ecx, [ebp - 0x34]
mov eax, ecx
lea edx, [ebp - 0x14]
push edx
mov edx, dword [ebp - 0x24]
add edx, ecx
push edx
push eax
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0xe]
push ecx
mov ecx, dword [edi + 0x44]
lea edx, [ebp - 0x10]
push edx
lea eax, [edi + 0x4c]
push eax
call dword [sym.imp.MSVCP100.dll_public:_int___thiscall_std::codecvt_wchar_t__char__int_::out_int___wchar_t_const___wchar_t_const___wchar_t_const____char___char___char___const]
test eax, eax
js 0x410363
cmp eax, 1
jg 0x4102fd
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x34]
mov ecx, eax
cmp edx, 0x10
jae 0x4102a1
lea ecx, [ebp - 0x34]
mov esi, dword [ebp - 0x14]
sub esi, ecx
je 0x4102cf
cmp edx, 0x10
jae 0x4102b0
lea eax, [ebp - 0x34]
mov ecx, dword [edi + 0x54]
push ecx
push esi
push 1
push eax
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp esi, eax
jne 0x410363
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x34]
lea ecx, [ebp - 0x10]
mov byte [edi + 0x4a], 1
cmp dword [ebp - 0x18], ecx
jne 0x41033e
test esi, esi
jne 0x410254
cmp dword [ebp - 0x24], 0x20
jae 0x410363
push esi
lea ebx, [esi + 8]
lea esi, [ebp - 0x34]
call fcn.00411840
mov ebx, dword [ebp + 8]
jmp 0x41024e
cmp eax, 3
jne 0x410363
mov eax, dword [edi + 0x54]
mov ecx, dword [ebp - 0x10]
call fcn.004014c0
movzx edi, bx
test al, al
jne 0x410319
mov edi, 0xffff
mov dword [ebp - 4], 0xffffffff
lea esi, [ebp - 0x34]
call fcn.004150e0
pop esi
mov ax, di
pop edi
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 4], 0xffffffff
lea esi, [ebp - 0x34]
call fcn.004150e0
pop esi
pop edi
mov ax, bx
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 4], 0xffffffff
lea esi, [ebp - 0x34]
call fcn.004150e0
mov eax, 0xffff
pop esi
mov ecx, dword [ebp - 0xc]
pop edi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4