Function at 0x403570
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, ecx
push ebx
sub esp, 0x45c
lea ebx, [ebp - 0x424]
mov dword [esp + 8], edx
mov dword [ebp - 0x43c], edx
mov dword [ebp - 0x438], eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0x400
mov dword [esp], ebx
call fcn.00409700
mov edx, dword [ebp - 0x43c]
mov dword [ebp - 0x434], ebx
cmp eax, 0x3ff
mov edi, eax
ja 0x403764
cmp byte [0x41a12c], 0
jne 0x403651
mov edx, dword [ebp + 8]
test edx, edx
je 0x403607
call sub.cygwin1.dll___locale_mb_cur_max
cmp eax, 1
jle 0x4037a0
mov eax, dword [ebp - 0x434]
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.0040a190
mov dword [ebp - 0x42c], eax
mov eax, dword [ebp - 0x438]
test eax, eax
je 0x403635
mov edx, dword [ebp - 0x438]
mov eax, dword [ebp - 0x434]
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov dword [esp + 0xc], edx
mov dword [esp], eax
call sub.cygwin1.dll_fwrite
mov esi, dword [ebp + 8]
test esi, esi
je 0x403647
mov eax, dword [ebp - 0x42c]
mov edx, dword [ebp + 8]
mov dword [edx], eax
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___locale_mb_cur_max
cmp eax, 1
jle 0x40385d
add edi, dword [ebp - 0x434]
mov dword [ebp - 0x42c], 0
mov dword [ebp - 0x430], edi
mov edi, dword [ebp - 0x434]
mov edx, dword [ebp - 0x430]
cmp edi, edx
jae 0x403759
mov esi, edi
nop
lea esi, [esi]
movzx eax, byte [esi]
cmp al, 0x5f
jg 0x403810
cmp al, 0x41
jge 0x40381c
cmp al, 0x20
jl 0x4036c0
cmp al, 0x23
jle 0x40381c
lea edx, [eax - 0x25]
cmp dl, 0x1a
jbe 0x40381c
nop
lea esi, [esi]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
nop
lea eax, [ebp - 0x24]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x430]
lea edx, [ebp - 0x1a]
mov dword [esp + 4], esi
mov dword [esp], edx
sub eax, esi
mov dword [esp + 8], eax
call sub.cygwin1.dll_mbrtowc
cmp eax, 0xffffffff
mov ebx, eax
je 0x403830
cmp eax, 0xfffffffe
je 0x403845
test eax, eax
mov eax, 1
cmove ebx, eax
movzx eax, word [ebp - 0x1a]
mov dword [esp], eax
call sub.cygwin1.dll_wcwidth
test eax, eax
js 0x4037f6
xor edx, edx
movzx ecx, byte [esi + edx]
mov byte [edi + edx], cl
add edx, 1
cmp ebx, edx
jne 0x403726
add dword [ebp - 0x42c], eax
add edi, ebx
add esi, ebx
lea edx, [ebp - 0x24]
mov dword [esp], edx
call sub.cygwin1.dll_mbsinit
test eax, eax
je 0x4036d0
cmp dword [ebp - 0x430], esi
ja 0x403690
sub edi, dword [ebp - 0x434]
jmp 0x403607
lea ecx, [eax + 1]
lea eax, [eax + 0x1f]
and eax, 0xfffffff0
call fcn.00413220
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov dword [ebp - 0x434], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.00409700
jmp 0x4035c9
mov ecx, dword [ebp - 0x434]
mov dword [ebp - 0x42c], 0
add ecx, edi
cmp dword [ebp - 0x434], ecx
jae 0x403607
mov eax, dword [sym.imp.cygwin1.dll___ctype_ptr__]
xor esi, esi
mov ebx, dword [eax]
mov eax, dword [ebp - 0x434]
lea esi, [esi]
movzx edx, byte [eax]
movsx edx, byte [ebx + edx + 1]
and edx, 0x97
cmp edx, 1
sbb esi, 0xffffffff
add eax, 1
cmp ecx, eax
ja 0x4037d0
mov dword [ebp - 0x42c], esi
jmp 0x403607
mov byte [edi], 0x3f
add esi, ebx
add edi, 1
add dword [ebp - 0x42c], 1
jmp 0x40373e
lea edx, [eax - 0x61]
cmp dl, 0x1d
ja 0x4036c0
mov byte [edi], al
add esi, 1
add edi, 1
add dword [ebp - 0x42c], 1
jmp 0x40374d
mov byte [edi], 0x3f
add esi, 1
add edi, 1
add dword [ebp - 0x42c], 1
jmp 0x40374d
mov byte [edi], 0x3f
add edi, 1
add dword [ebp - 0x42c], 1
sub edi, dword [ebp - 0x434]
jmp 0x403607
mov ebx, dword [ebp - 0x434]
mov dword [ebp - 0x42c], edi
add ebx, edi
cmp dword [ebp - 0x434], ebx
jae 0x403607
mov eax, dword [sym.imp.cygwin1.dll___ctype_ptr__]
mov ecx, dword [eax]
mov eax, dword [ebp - 0x434]
movzx edx, byte [eax]
movsx edx, byte [ecx + edx + 1]
and edx, 0x97
jne 0x403897
mov byte [eax], 0x3f
add eax, 1
cmp ebx, eax
ja 0x403884
mov dword [ebp - 0x42c], edi
jmp 0x403607