Function at 0x401900
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x3078
call fcn.00403c58
xor esi, esi
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x3048], edx
mov dword [esp], edx
mov dword [ebp - 0x304c], ecx
mov dword [ebp - 0x303c], eax
mov dword [esp + 4], 0x10000
call sub.cygwin1.dll_setmode
mov eax, dword [ebp - 0x303c]
mov dword [0x408070], 1
mov dword [0x408074], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.cygiconv_2.dll_libiconv
lea edx, [ebp - 0x102c]
lea eax, [ebp - 0x302c]
mov ebx, edx
mov dword [ebp - 0x3044], 0
mov dword [ebp - 0x3040], 0x1000
mov dword [ebp - 0x3060], edx
mov dword [ebp - 0x305c], eax
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fflush
mov eax, dword [ebp - 0x3048]
lea edx, [ebp - 0x202c]
mov dword [esp + 4], edx
mov dword [esp + 8], 0x1000
mov dword [esp], eax
call fcn.00403660
lea edx, [eax - 1]
cmp edx, 0xfffffffd
ja 0x401c06
mov edx, dword [ebp - 0x305c]
add eax, esi
mov dword [ebp - 0x1c], eax
sub edx, esi
add edx, 0x1000
mov dword [ebp - 0x28], edx
jmp 0x401a03
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x401b40
mov eax, dword [ebp - 0x3040]
lea edx, [ebp - 0x24]
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x1c]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x303c]
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.cygiconv_2.dll_libiconv
cmp ebx, dword [ebp - 0x20]
mov esi, eax
je 0x401a88
call sub.cygwin1.dll___errno
mov edi, dword [eax]
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
sub eax, ebx
mov dword [esp + 8], eax
call sub.cygwin1.dll_fwrite
mov edx, dword [ebp - 0x20]
sub edx, ebx
cmp eax, edx
jb 0x401b47
call sub.cygwin1.dll___errno
mov dword [eax], edi
cmp esi, 0xffffffff
jne 0x401a00
call sub.cygwin1.dll___errno
cmp dword [eax], 0x8a
jne 0x401ae8
cmp dword [0x408034], 1
jne 0x401b9a
mov edx, dword [ebp - 0x303c]
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 1
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov dword [esp], edx
call sub.cygiconv_2.dll_libiconvctl
mov dword [0x408034], 2
mov dword [ebp - 0x3044], 1
jmp 0x401a00
call sub.cygwin1.dll___errno
cmp dword [eax], 0x16
je 0x401bbb
call sub.cygwin1.dll___errno
cmp dword [eax], 7
nop
jne 0x401b72
cmp ebx, dword [ebp - 0x20]
jne 0x401a00
cmp ebx, dword [ebp - 0x3060]
je 0x401b1b
mov dword [esp], ebx
call sub.cygwin1.dll_free
shl dword [ebp - 0x3040], 1
je 0x401fa0
mov eax, dword [ebp - 0x3040]
mov dword [esp], eax
call fcn.00403730
mov ebx, eax
jmp 0x401a00
xor esi, esi
jmp 0x4019a8
mov dword [ebp - 0x3044], 1
cmp ebx, dword [ebp - 0x3060]
je 0x401b61
mov dword [esp], ebx
call sub.cygwin1.dll_free
mov eax, dword [ebp - 0x3044]
add esp, 0x307c
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [0x408030]
mov dword [ebp - 0x3044], 1
test esi, esi
jne 0x401b51
call sub.cygwin1.dll___errno
mov edx, dword [ebp - 0x304c]
mov eax, dword [eax]
call fcn.004017e0
jmp 0x401b51
mov edi, dword [0x408030]
mov dword [ebp - 0x3044], 1
test edi, edi
jne 0x401b51
mov eax, dword [ebp - 0x304c]
call fcn.004016c0
jmp 0x401b51
mov esi, dword [ebp - 0x1c]
cmp esi, 0x1000
ja 0x401d76
test esi, esi
je 0x4019a8
mov eax, dword [ebp - 0x305c]
mov edi, ebx
mov edx, dword [ebp - 0x28]
sub eax, esi
lea ecx, [eax + 0x1000]
mov eax, esi
movzx ebx, byte [edx]
sub eax, 1
add edx, 1
mov byte [ecx], bl
add ecx, 1
test eax, eax
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x1c], eax
jne 0x401be7
mov ebx, edi
jmp 0x4019a8
cmp eax, 0xffffffff
mov dword [ebp - 0x3054], 0
je 0x401f29
test esi, esi
jne 0x401d9d
mov edi, dword [ebp - 0x303c]
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x20]
mov dword [ebp - 0x3048], edx
mov dword [ebp - 0x3050], eax
mov edx, dword [ebp - 0x3040]
mov eax, dword [ebp - 0x3048]
mov dword [ebp - 0x20], ebx
mov dword [esp + 8], 0
mov dword [ebp - 0x2c], edx
mov edx, dword [ebp - 0x3050]
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0
mov dword [esp], edi
mov dword [esp + 0xc], edx
call sub.cygiconv_2.dll_libiconv
cmp dword [ebp - 0x20], ebx
mov esi, eax
je 0x401cc4
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0x303c], eax
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
sub eax, ebx
mov dword [esp + 8], eax
call sub.cygwin1.dll_fwrite
mov edx, dword [ebp - 0x20]
sub edx, ebx
cmp eax, edx
jb 0x401b47
call sub.cygwin1.dll___errno
mov edx, dword [ebp - 0x303c]
mov dword [eax], edx
cmp esi, 0xffffffff
jne 0x401f3b
call sub.cygwin1.dll___errno
cmp dword [eax], 0x8a
jne 0x401d1e
cmp dword [0x408034], 1
jne 0x401b9a
lea eax, [ebp - 0x24]
mov dword [ebp - 0x24], 1
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov dword [esp], edi
call sub.cygiconv_2.dll_libiconvctl
mov dword [0x408034], 2
mov dword [ebp - 0x3044], 1
jmp 0x401c39
call sub.cygwin1.dll___errno
cmp dword [eax], 0x16
je 0x401d76
call sub.cygwin1.dll___errno
cmp dword [eax], 7
jne 0x401b72
cmp dword [ebp - 0x20], ebx
jne 0x401c39
cmp ebx, dword [ebp - 0x3060]
je 0x401d4f
mov dword [esp], ebx
call sub.cygwin1.dll_free
shl dword [ebp - 0x3040], 1
je 0x401fa0
mov edx, dword [ebp - 0x3040]
mov dword [esp], edx
call fcn.00403730
mov ebx, eax
jmp 0x401c39
mov ebx, dword [ebp - 0x3040]
cmp dword [0x408030], 0
mov dword [ebp - 0x3044], 1
jne 0x401b51
mov eax, dword [ebp - 0x304c]
call fcn.00401750
jmp 0x401b51
cmp dword [0x408018], 0
je 0x401d76
mov eax, dword [ebp - 0x305c]
lea edx, [ebp - 0x2c]
xor edi, edi
mov dword [ebp - 0x3048], edx
mov dword [ebp - 0x3040], ebx
sub eax, esi
add eax, 0x1000
mov dword [ebp - 0x303c], eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x3050], eax
jmp 0x401e47
mov eax, dword [ebp - 0x3048]
lea edx, [ebp - 0x28]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp + 0x10], eax
mov eax, dword [0x408058]
mov dword [esp], eax
call sub.cygiconv_2.dll_libiconv
cmp eax, 0xffffffff
je 0x401ef6
call sub.cygwin1.dll___getreent
add edi, 1
mov eax, dword [eax + 8]
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
mov eax, dword [0x40801c]
shl eax, 2
sub eax, dword [ebp - 0x2c]
mov dword [esp + 8], eax
mov eax, dword [0x40805c]
mov dword [esp], eax
call sub.cygwin1.dll_fwrite
cmp esi, edi
je 0x401d70
mov edx, dword [ebp - 0x303c]
movzx eax, byte [edx + edi]
mov dword [esp + 8], eax
mov eax, dword [0x408018]
mov dword [esp + 4], eax
mov eax, dword [0x40803c]
mov dword [esp], eax
call sub.cygwin1.dll_sprintf
mov eax, dword [0x40803c]
mov dword [esp], eax
mov dword [ebp - 0x20], eax
call sub.cygwin1.dll_strlen
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [ebp - 0x24], eax
mov eax, dword [0x40805c]
mov dword [ebp - 0x28], eax
mov eax, dword [0x40801c]
shl eax, 2
mov dword [ebp - 0x2c], eax
mov eax, dword [0x408058]
mov dword [esp], eax
call sub.cygiconv_2.dll_libiconv
mov eax, dword [ebp - 0x3048]
lea edx, [ebp - 0x28]
mov dword [esp + 0xc], edx
mov edx, dword [ebp - 0x3050]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
mov eax, dword [0x408058]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.cygiconv_2.dll_libiconv
cmp eax, 0xffffffff
jne 0x401dd5
mov ebx, dword [0x40803c]
mov dword [esp], str.cannot_convert_byte_substitution_to_target_encoding:__s
call sub.cygintl_8.dll_libintl_gettext
mov dword [esp + 4], 0
mov dword [esp + 0xc], ebx
mov dword [esp], 1
mov dword [esp + 8], eax
call fcn.004034c0
jmp 0x401e0c
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0x3054], eax
jmp 0x401c19
cmp dword [ebp - 0x3054], 0
je 0x401b51
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fflush
cmp dword [0x408074], 0
jne 0x401fa5
mov dword [esp], str._s:_I_O_error
call sub.cygintl_8.dll_libintl_gettext
mov edx, dword [ebp - 0x304c]
mov dword [esp], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x3054]
mov dword [esp + 4], eax
call fcn.004034c0
mov dword [ebp - 0x3044], 1
jmp 0x401b51
call fcn.004036c0
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp], 0xa
mov dword [esp + 4], eax
call sub.cygwin1.dll_putc
jmp 0x401f61