Function at 0x401744
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xac
mov dword [esp + 0x1c], eax
mov eax, dword [0x40e278]
test eax, eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], 0
je 0x4017be
mov ebp, dword [0x40e138]
test ebp, ebp
jne 0x401b2a
mov edx, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add edx, 0x20
push edx
push dword [0x40e198]
call sub.msvcrt.dll_fputs
mov edi, dword [0x40e138]
add esp, 0x10
test edi, edi
je 0x4017a8
mov eax, dword [0x40b0c4]
cmp byte [eax], 0
jne 0x401cf0
mov esi, dword [0x40e248]
test esi, esi
je 0x401d08
mov dword [esp + 0x14], 1
mov ebx, dword [0x40e288]
test ebx, ebx
je 0x40190a
mov eax, dword [0x40e328]
cmp eax, dword [esp + 0x18]
jb 0x401a73
mov esi, dword [esp + 0x14]
test esi, esi
je 0x401848
mov ecx, dword [0x40e138]
test ecx, ecx
mov bl, byte [esp + 0xc0]
jne 0x401c86
mov ebp, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add ebp, 0x20
push ebp
movsx eax, bl
push eax
call sub.msvcrt.dll_fputc
mov ebx, dword [0x40e138]
add esp, 0x10
test ebx, ebx
mov dword [esp + 8], ebx
je 0x401852
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
je 0x401852
sub esp, 8
push eax
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
mov edx, dword [0x40e138]
mov dword [esp + 8], edx
jmp 0x401852
mov edi, dword [0x40e138]
mov dword [esp + 8], edi
mov ecx, dword [0x40b0c0]
mov ebx, dword [0x40e348]
mov esi, dword [0x40e34c]
mov ebp, 4
mov dword [esp + 0x10], ecx
lea edi, [esp + 0xa0]
push 0
push 0xa
push esi
push ebx
call fcn.00408cf0
add eax, 0x30
add esp, 0x10
dec edi
mov byte [edi], al
push 0
push 0xa
push esi
push ebx
call fcn.00408ed0
mov ebx, eax
mov eax, edx
dec ebp
add esp, 0x10
or eax, ebx
mov esi, edx
jne 0x401874
mov esi, dword [0x40e158]
test esi, esi
je 0x4018b7
mov eax, ebp
jmp 0x4018b4
dec edi
mov byte [edi], 0x20
dec eax
jns 0x4018b0
mov ebx, dword [esp + 8]
test ebx, ebx
je 0x4018cc
mov ecx, dword [esp + 0x10]
cmp byte [ecx], 0
jne 0x401d6c
mov ecx, dword [sym.imp.msvcrt.dll__iob]
add ecx, 0x20
push ecx
lea edx, [esp + 0xa4]
sub edx, edi
push edx
push 1
push edi
call sub.msvcrt.dll_fwrite
mov ebp, dword [0x40e138]
add esp, 0x10
test ebp, ebp
je 0x401902
mov edi, dword [esp + 0x10]
cmp byte [edi], 0
jne 0x401d3c
mov dword [esp + 0x14], 1
mov edi, dword [0x40e298]
test edi, edi
je 0x401a00
mov ebx, dword [0x40e1e8]
sub dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x1c]
mov ebp, ecx
sar ebp, 0x1f
mov eax, dword [0x40e318]
mov ebx, ecx
mov edx, dword [0x40e31c]
add ebx, eax
mov esi, ebp
adc esi, edx
cmp esi, edx
ja 0x401968
jb 0x401948
cmp ebx, eax
jae 0x401968
sub esp, 0xc
push str.input_is_too_large_to_count
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 2
call fcn.004072c8
add esp, 0x10
nop
cmp dword [0x40e068], 2
mov edx, ebx
je 0x401c3d
mov eax, ebx
mov esi, eax
mov edi, dword [esp + 0x14]
sar esi, 0x1f
test edi, edi
mov ebx, eax
je 0x401b50
mov edx, dword [0x40e138]
test edx, edx
movzx edi, byte [esp + 0xc0]
jne 0x401cac
mov edx, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add edx, 0x20
mov eax, edi
push edx
movsx ecx, al
push ecx
call sub.msvcrt.dll_fputc
mov ebp, dword [0x40e138]
add esp, 0x10
test ebp, ebp
mov dword [esp + 4], ebp
je 0x401b5a
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
je 0x401b5a
sub esp, 8
push eax
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
mov edi, dword [0x40e138]
mov dword [esp + 4], edi
jmp 0x401b5a
mov edi, dword [esp + 0x14]
test edi, edi
je 0x401a68
mov eax, dword [0x40e158]
test eax, eax
jne 0x401c1d
mov edx, dword [0x40e138]
test edx, edx
mov bl, byte [esp + 0xc0]
je 0x401a34
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
jne 0x401d24
mov ecx, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add ecx, 0x20
push ecx
movsx ebp, bl
push ebp
call sub.msvcrt.dll_fputc
mov ebx, dword [0x40e138]
add esp, 0x10
test ebx, ebx
je 0x401a68
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
jne 0x401cd2
lea esi, [esi]
add esp, 0xac
pop ebx
pop esi
pop edi
pop ebp
ret
xor ebx, ebx
cmp eax, dword [esp + 0x1c]
mov edx, eax
jae 0x401aa4
movzx esi, byte [0x40e6a8]
mov eax, dword [esp + 0x1c]
sub eax, edx
push ecx
push eax
push esi
push edx
call sub.msvcrt.dll_memchr
add esp, 0x10
test eax, eax
je 0x401aa4
lea edx, [eax + 1]
inc ebx
cmp edx, dword [esp + 0x1c]
jb 0x401a84
mov eax, dword [0x40e348]
mov ebp, dword [0x40e34c]
xor esi, esi
add ebx, eax
adc esi, ebp
cmp esi, ebp
ja 0x401ac7
jb 0x401d84
cmp ebx, eax
jb 0x401d84
mov edi, ebx
add edi, 1
mov ebp, esi
adc ebp, 0
cmp ebp, esi
ja 0x401b0f
jb 0x401adb
cmp edi, ebx
jae 0x401b0f
mov edx, dword [esp + 0x1c]
sub esp, 0xc
mov dword [0x40e328], edx
push str.input_is_too_large_to_count
mov dword [0x40e348], ebx
mov dword [0x40e34c], esi
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 2
call fcn.004072c8
add esp, 0x10
mov dword [0x40e348], edi
mov edi, dword [esp + 0x18]
mov dword [0x40e34c], ebp
mov dword [0x40e328], edi
jmp 0x4017db
mov eax, dword [0x40b0c4]
cmp byte [eax], 0
je 0x401775
sub esp, 8
push eax
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x401775
mov ebp, dword [0x40e138]
mov dword [esp + 4], ebp
mov ecx, dword [0x40b0bc]
mov ebp, 6
mov dword [esp + 0xc], ecx
lea edi, [esp + 0x60]
lea esi, [esi]
push 0
push 0xa
push esi
push ebx
call fcn.00408cf0
add eax, 0x30
add esp, 0x10
dec edi
mov byte [edi], al
push 0
push 0xa
push esi
push ebx
call fcn.00408ed0
mov ebx, eax
mov eax, edx
dec ebp
add esp, 0x10
or eax, ebx
mov esi, edx
jne 0x401b70
mov esi, dword [0x40e158]
test esi, esi
je 0x401bb3
mov eax, ebp
jmp 0x401bb0
dec edi
mov byte [edi], 0x20
dec eax
jns 0x401bac
mov ebx, dword [esp + 4]
test ebx, ebx
je 0x401bc8
mov ecx, dword [esp + 0xc]
cmp byte [ecx], 0
jne 0x401d54
mov ecx, dword [sym.imp.msvcrt.dll__iob]
add ecx, 0x20
push ecx
lea ebp, [esp + 0xa4]
sub ebp, edi
sub ebp, 0x40
push ebp
push 1
push edi
call sub.msvcrt.dll_fwrite
mov edx, dword [0x40e138]
add esp, 0x10
test edx, edx
je 0x401a08
mov edi, dword [esp + 0xc]
cmp byte [edi], 0
je 0x401a08
sub esp, 8
push edi
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x401a08
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x20
push esi
push 2
push 1
push 0x40b636
call sub.msvcrt.dll_fwrite
add esp, 0x10
jmp 0x401a15
mov eax, dword [0x40e028]
test eax, eax
jne 0x401977
mov eax, dword [0x40b0d0]
mov ecx, dword [0x40e398]
cmp edx, dword [ecx + eax*8]
mov ebx, dword [ecx + eax*8 - 8]
jl 0x401da7
inc eax
mov ebx, dword [0x40e088]
cmp eax, ebx
mov esi, eax
jge 0x401c7b
cmp dword [ecx + eax*8], edx
jg 0x401c7b
inc eax
cmp eax, ebx
mov esi, eax
jl 0x401c6f
mov dword [0x40b0d0], esi
jmp 0x401dbf
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
je 0x4017f8
sub esp, 8
push eax
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x4017f8
mov eax, dword [0x40b0b8]
cmp byte [eax], 0
je 0x4019a2
sub esp, 8
push eax
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x4019a2
sub esp, 8
push eax
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
add esp, 0xac
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 8
push eax
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x4017a8
mov ecx, dword [sym.imp.msvcrt.dll__iob]
sub esp, 8
add ecx, 0x20
push ecx
push 0
call sub.msvcrt.dll_fputc
add esp, 0x10
jmp 0x4017be
sub esp, 8
push eax
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x401a34
sub esp, 8
push edi
push dword [0x40b0c8]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x401902
sub esp, 8
push ecx
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x401bc8
sub esp, 8
push ecx
push dword [0x40b0cc]
call dword [sym.imp.libintl3.dll_libintl_printf]
add esp, 0x10
jmp 0x4018cc
sub esp, 0xc
push str.input_is_too_large_to_count
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 2
call fcn.004072c8
add esp, 0x10
jmp 0x401ac7
cmp edx, ebx
jge 0x401dbf
dec eax
cmp eax, 1
mov ebx, eax
jle 0x401db9
cmp dword [ecx + eax*8 - 8], edx
jg 0x401dab
mov dword [0x40b0d0], ebx
mov eax, dword [ecx + eax*8 + 4]
add eax, edx
jmp 0x401979