Function at 0x40f890
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov ebx, dword [ebp + 0x14]
call 0x40f8a1
pop eax
mov dword [ebp - 0x20], eax
test ebx, ebx
je 0x40f96e
mov edi, dword [ebp + 0x10]
lea esi, [ebp - 0x1c]
jmp 0x40f8d8
test ebx, ebx
je 0x40f96e
mov ecx, esi
mov edx, 0xfffffff4
push dword [ebp + 0xc]
push ebx
push edi
call fcn.0040f9e0
add esp, 0xc
movzx eax, byte [ebp - 0x1c]
cmp eax, 4
jne 0x40f910
mov ecx, dword [ebp - 0x18]
test ecx, ecx
je 0x40f976
mov eax, ebx
sub eax, ecx
jb 0x40f993
add edi, ecx
mov ebx, eax
jmp 0x40f8d0
mov eax, dword [eax*4 + 0x40f9cc]
add eax, dword [ebp - 0x20]
jmp eax
mov eax, dword [ebp + 8]
mov byte [eax], 4
jmp 0x40f98b
mov esi, 0x49bc70
jmp 0x40f980
mov eax, dword [ebp + 8]
movsd xmm0, qword [esi]
movsd qword [eax], xmm0
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, ebx
push 0x49bc78
call fcn.004033b0
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
mov edi, eax
cmp dword [edx + 4], 0
je 0x40f9b8
mov eax, dword [ebp - 0x10]
mov edx, dword [eax + 8]
call fcn.004028a0
mov ecx, esi
mov edx, 4
call fcn.004028a0
push edi
call fcn.004423e0
nop
fild word [eax]
add byte [eax], al
jnp 0x40f9d2
add byte [eax], al
adc al, 0
add byte [eax], al
add dword [eax], 0
add byte [edi], cl
pop ds
inc eax
add byte [ebp - 0x77], dl
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x3c
mov edi, dword [ebp + 0xc]
mov esi, ecx
test edi, edi
je 0x40fa08
push edx
call sub.KERNEL32.dll_GetStdHandle
test eax, eax
je 0x40fa14
cmp eax, 0xffffffff
jne 0x40fa27
call sub.KERNEL32.dll_GetLastError
jmp 0x40fa19
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x40fa1f
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x28]
push ecx
mov dword [ebp - 0x10], eax
push eax
call sub.KERNEL32.dll_GetConsoleMode
test eax, eax
je 0x40fa93
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x40fab3
cmp al, 4
jae 0x40fbfe
mov ecx, dword [ebp + 8]
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x40fb06
mov byte [ebx + eax], cl
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx eax, byte [eax + 0x49cad6]
cmp cl, al
mov dword [ebp - 0x38], eax
jae 0x40fb0c
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x40fa1f
mov edx, dword [ebp - 0x10]
lea ecx, [ebp - 0x28]
push edi
push dword [ebp + 8]
call fcn.0040fca0
add esp, 8
movsd xmm0, qword [ebp - 0x28]
movsd qword [esi], xmm0
jmp 0x40fa1f
cmp edi, 0x1000
mov eax, 0x1000
cmovb eax, edi
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x34]
push eax
call fcn.00404460
add esp, 4
cmp dword [ebp - 0x34], 0
je 0x40fb41
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x40fb5b
cmp eax, edi
ja 0x40fc3f
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x28]
push eax
call fcn.00404460
add esp, 4
cmp dword [ebp - 0x28], 0
jne 0x40fc4d
mov eax, dword [ebp - 0x24]
mov edi, dword [ebp - 0x20]
jmp 0x40fb47
mov byte [ebx + 4], 0
jmp 0x40fb32
mov edi, eax
movzx eax, cl
cmp cl, 5
jae 0x40fc2e
lea ecx, [ebp - 0x34]
mov edx, ebx
push eax
call fcn.00404460
add esp, 4
cmp dword [ebp - 0x34], 0
mov byte [ebx + 4], 0
je 0x40fb7b
mov byte [esi], 2
mov dword [esi + 4], 0x49cc28
jmp 0x40fa1f
mov eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x10]
mov ecx, esi
push edi
push eax
call fcn.0040fd70
add esp, 8
jmp 0x40fa1f
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x49cad6]
cmp ecx, edi
jbe 0x40fbd1
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x40fbd8
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, edi
mov dword [ebp - 0x3c], ecx
jne 0x40fc74
mov ebx, edi
mov edx, dword [ebp - 0x10]
lea edi, [ebp - 0x28]
mov ecx, edi
push ebx
push eax
call fcn.0040fd70
add esp, 8
movzx eax, byte [ebp - 0x28]
cmp al, 4
jne 0x40fbe2
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x48], ebx
cmp eax, ebx
mov dword [ebp - 0x40], eax
je 0x40fa87
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x48]
push 0x49ccc8
push edi
call fcn.00410130
mov al, 2
mov ecx, 0x49cc28
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x40fa1f
movzx ecx, byte [ebp - 0x25]
movzx edi, word [ebp - 0x27]
mov edx, dword [ebp - 0x24]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x40fa1f
mov dword [ebp - 0x28], 0x49cc90
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], 4
mov dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x28]
mov edx, 0x49cc98
call fcn.00403350
mov ecx, eax
mov edx, 4
push 0x49cca8
call fcn.00403ab0
mov ecx, eax
mov edx, edi
push 0x49cc34
call fcn.00403ab0
movsd xmm0, qword [ebp - 0x24]
movsd qword [ebp - 0x48], xmm0
lea eax, [ebp - 0x48]
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
push 0x49cc44
push 0x49a9b0
push eax
call fcn.00404a20
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x38]
lea edx, [ebp - 0x3c]
push 0x49ccb8
lea eax, [ebp - 0x28]
push eax
call fcn.00410130
mov esi, eax
push dword [ebp - 0x10]
call sub.KERNEL32.dll_CloseHandle
push esi
call fcn.004423e0
nop