Function at 0x4059a0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov eax, dword [ebp + 8]
movzx edx, byte [ebp + 0x10]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x10], eax
test dl, dl
mov byte [ebp - 0x11], dl
je 0x405bc8
movzx ecx, word [edi + 0x1c]
xor esi, esi
test cx, cx
jne 0x405a1e
jmp 0x405a45
movzx edx, word [edi + 0x22]
movzx eax, cx
sub eax, edx
mov edx, ebx
sub edx, eax
mov eax, dword [edi + 0x18]
mov eax, dword [eax + edx*4]
cmp dword [0x4101d0], 1
ja 0x405a00
cmp byte [sym.imp.cygncurses_8.dll__nc_user_definable], 0
jne 0x405a00
cmp byte [eax], 0x4f
je 0x405ae5
nop
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [ebp - 0x10]
movzx ecx, word [edi + 0x1c]
inc esi
movzx eax, cx
cmp eax, esi
jle 0x405a45
cmp esi, 0x2b
mov ebx, esi
jg 0x405a36
cmp dword [0x4101e0], 1
je 0x405a36
mov eax, dword [0x410250]
mov ebx, dword [eax + esi*4]
cmp ebx, 0x2b
jg 0x4059d0
mov eax, dword [0x410280]
mov eax, dword [eax + ebx*4]
jmp 0x4059e3
cmp byte [ebp - 0x11], 0
je 0x405bf7
movzx ecx, word [edi + 0x1e]
xor esi, esi
test cx, cx
jne 0x405abe
jmp 0x405b10
movzx edx, word [edi + 0x24]
movzx eax, cx
sub eax, edx
mov edx, ebx
sub edx, eax
mov eax, edx
movzx edx, word [edi + 0x22]
add eax, edx
mov edx, dword [edi + 0x18]
mov eax, dword [edx + eax*4]
cmp dword [0x4101d0], 1
ja 0x405aa0
cmp byte [sym.imp.cygncurses_8.dll__nc_user_definable], 0
jne 0x405aa0
cmp byte [eax], 0x4f
je 0x405af4
lea esi, [esi]
lea edi, [edi]
mov dword [esp + 8], eax
inc esi
mov dword [esp + 4], ebx
mov dword [esp], 1
call dword [ebp - 0x10]
movzx ecx, word [edi + 0x1e]
movzx eax, cx
cmp eax, esi
jle 0x405b10
cmp esi, 0x26
mov ebx, esi
jg 0x405ad6
cmp dword [0x4101e0], 1
je 0x405ad6
mov eax, dword [0x410260]
mov ebx, dword [eax + esi*4]
cmp ebx, 0x26
jg 0x405a60
mov eax, dword [0x410290]
mov eax, dword [eax + ebx*4]
jmp 0x405a7b
cmp byte [eax + 1], 0x54
jne 0x405a00
jmp 0x405a16
cmp byte [eax + 1], 0x54
jne 0x405aa0
inc esi
movzx eax, cx
cmp eax, esi
jg 0x405abe
lea esi, [esi]
lea edi, [edi]
cmp byte [ebp - 0x11], 0
je 0x405c56
movzx ecx, word [edi + 0x20]
xor esi, esi
test cx, cx
mov word [ebp - 0x14], cx
jne 0x405b97
jmp 0x405c26
movzx edx, word [edi + 0x26]
mov ecx, ebx
movzx eax, word [ebp - 0x14]
sub eax, edx
sub ecx, eax
movzx eax, word [edi + 0x24]
movzx edx, word [edi + 0x22]
add eax, ecx
add eax, edx
mov edx, dword [edi + 0x18]
mov eax, dword [edx + eax*4]
cmp dword [0x4101d0], 1
ja 0x405b70
cmp byte [sym.imp.cygncurses_8.dll__nc_user_definable], 0
jne 0x405b70
cmp byte [eax], 0x4f
je 0x405c47
nop
lea esi, [esi]
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], 2
call dword [ebp - 0x10]
movzx eax, word [edi + 0x20]
mov word [ebp - 0x14], ax
movzx eax, word [ebp - 0x14]
inc esi
cmp eax, esi
jle 0x405c26
cmp esi, 0x19d
mov ebx, esi
jg 0x405bb2
cmp dword [0x4101e0], 1
je 0x405bb2
mov eax, dword [0x410270]
mov ebx, dword [eax + esi*4]
cmp ebx, 0x19d
jg 0x405b30
mov eax, dword [0x4102a0]
mov eax, dword [eax + ebx*4]
jmp 0x405b50
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], str.____comparing_booleans._n
mov dword [esp + 0xc], eax
mov eax, 0x18
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sub.cygwin1.dll_fwrite
jmp 0x4059c1
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], str.____comparing_numbers._n
mov dword [esp + 0xc], eax
mov eax, 0x17
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
call sub.cygwin1.dll_fwrite
jmp 0x405a4f
mov dword [ebp + 0x10], 0x40b2ff
mov ecx, dword [ebp - 0x10]
mov dword [ebp + 0xc], 0
mov dword [ebp + 8], 3
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
jmp ecx
cmp byte [eax + 1], 0x54
jne 0x405b70
jmp 0x405b8a
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov esi, 0x17
mov ebx, 1
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], eax
mov dword [esp], str.____comparing_strings._n
call sub.cygwin1.dll_fwrite
jmp 0x405b1a