Function at 0x402290
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xc
mov ecx, dword [0x40e258]
mov edi, eax
test ecx, ecx
mov al, byte [0x40e6a8]
mov dword [esp + 4], edx
mov byte [esp + 3], al
mov dl, al
jne 0x40237c
mov esi, dword [0x40e368]
test esi, esi
jle 0x40237c
mov eax, dword [0x40e338]
test eax, eax
je 0x402548
cmp eax, edi
mov ebx, eax
jb 0x40230b
jmp 0x40237c
sub esp, 0xc
push 0x2d
lea edx, [ebp + 1]
mov eax, dword [0x40e338]
call fcn.00401dcc
mov esi, dword [0x40e368]
add esp, 0x10
test esi, esi
jle 0x402376
mov ebx, dword [0x40e338]
cmp ebx, edi
jae 0x402376
mov dl, byte [0x40e6a8]
mov eax, edi
sub eax, ebx
push ecx
movzx ebp, dl
push eax
push ebp
push ebx
call sub.msvcrt.dll_memchr
mov edx, dword [0x40e358]
add esp, 0x10
lea ecx, [esi - 1]
test edx, edx
mov ebp, eax
mov dword [0x40e368], ecx
jne 0x4022dc
push 0
mov edx, eax
lea ecx, [esp + 0xc]
sub edx, ebx
push ecx
inc edx
push edx
push ebx
call fcn.00404d78
add esp, 0x10
mov esi, dword [0x40e268]
inc eax
setne bl
test esi, esi
sete al
xor eax, ebx
test al, 1
jne 0x4022dc
mov dword [0x40e368], 0
mov esi, dword [0x40e368]
test esi, esi
jg 0x4022fb
mov ecx, dword [0x40e258]
test ecx, ecx
mov esi, edi
jne 0x4023fd
mov ebp, dword [0x40e338]
test ebp, ebp
mov ecx, ebp
je 0x4024ac
xor eax, eax
mov edx, dword [0x40e2a8]
cmp eax, edx
jge 0x4023b3
nop
cmp esi, ecx
jbe 0x4023ae
dec esi
mov bl, byte [esp + 3]
cmp byte [esi - 1], bl
jne 0x4023a4
inc eax
cmp eax, edx
jl 0x4023a0
test edx, edx
jne 0x4024d0
mov eax, dword [0x40e2b8]
test eax, eax
jne 0x4024d0
cmp esi, edi
jae 0x4023fd
movsx ebp, byte [esp + 3]
lea esi, [esi]
mov edx, edi
sub edx, esi
push ebx
push edx
push ebp
push esi
call sub.msvcrt.dll_memchr
mov ebx, eax
inc ebx
mov eax, esi
mov edx, ebx
mov dword [esp], 0x2d
call fcn.00401dcc
add esp, 0x10
cmp ebx, edi
mov esi, ebx
jb 0x4023d4
mov ebp, dword [esp + 0x20]
test ebp, ebp
je 0x402557
xor edi, edi
cmp esi, dword [esp + 4]
jae 0x40246a
cmp edi, dword [0x40e358]
jge 0x40246a
movsx ebp, byte [esp + 3]
jmp 0x402431
inc edi
cmp ebx, dword [esp + 4]
mov esi, ebx
jae 0x40246a
cmp edi, dword [0x40e358]
jge 0x40246a
mov eax, dword [esp + 4]
sub eax, esi
push edx
push eax
push ebp
push esi
call sub.msvcrt.dll_memchr
mov ecx, dword [0x40e258]
add esp, 0x10
test ecx, ecx
lea ebx, [eax + 1]
jne 0x402420
sub esp, 0xc
push 0x3a
mov eax, esi
mov edx, ebx
call fcn.00401dcc
add esp, 0x10
inc edi
cmp ebx, dword [esp + 4]
mov esi, ebx
jb 0x402429
mov edx, dword [esp + 0x20]
mov ebx, dword [0x40e1f8]
mov dword [edx], edi
sub ebx, esi
mov edi, dword [0x40e218]
sub edi, ebx
mov dword [0x40e228], edi
mov ebp, dword [0x40e258]
test ebp, ebp
jne 0x4024b7
mov eax, dword [0x40e2b8]
mov dword [0x40e368], eax
mov dword [0x40e0a8], 1
add esp, 0xc
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [0x40e1e8]
jmp 0x402392
xor eax, eax
mov dword [0x40e368], eax
mov dword [0x40e0a8], 1
add esp, 0xc
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [0x40e0a8]
test edx, edx
je 0x4023c8
cmp esi, ebp
je 0x4023c8
mov ebp, dword [0x40e138]
test ebp, ebp
je 0x4024fe
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
jne 0x402592
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x20
push ebx
push 2
push 1
push 0x40b648
call sub.msvcrt.dll_fwrite
mov ecx, dword [0x40e138]
add esp, 0x10
test ecx, ecx
je 0x40252d
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
jne 0x40257d
mov eax, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add eax, 0x20
push eax
push 0xa
call sub.msvcrt.dll_fputc
add esp, 0x10
jmp 0x4023c8
mov eax, dword [0x40e1e8]
mov dword [0x40e338], eax
jmp 0x4022d1
mov esi, dword [0x40e258]
test esi, esi
jne 0x4024b7
sub esp, 0xc
push 0x3a
mov edx, dword [esp + 0x14]
mov eax, edi
call fcn.00401dcc
add esp, 0x10
jmp 0x402486
sub esp, 8
push eax
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x40252d
sub esp, 8
push eax
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x4024fe