Function at 0x413e58
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x58
lea eax, [ebp - 0x18]
mov edi, dword [ebp + 0xc]
mov esi, ecx
mov dword [eax - 4], esp
or dword [eax + 8], 0xffffffff
mov dword [eax + 4], 0x41aa50
mov ecx, dword fs:[0]
test edi, edi
mov dword [eax], ecx
mov dword fs:[0], eax
je 0x413eab
push edx
call dword [sym.imp.kernel32.dll_GetStdHandle]
cmp eax, 0xffffffff
je 0x413eb7
mov ebx, eax
test eax, eax
jne 0x413ed5
mov eax, ebx
push 6
pop ebx
mov dword [esi + 4], ebx
mov dword [esi], eax
jmp 0x414070
and dword [esi + 4], 0
mov byte [esi], 4
jmp 0x414070
lea ebx, [ebp - 0x48]
mov ecx, ebx
call fcn.00401323
cmp byte [ebx], 4
jne 0x413ecb
mov ebx, dword [ebp - 0x44]
jmp 0x413ed5
mov eax, dword [ebp - 0x48]
mov ebx, dword [ebp - 0x44]
cmp al, 4
jne 0x413ea1
lea eax, [ebp - 0x48]
and dword [eax], 0
push eax
push ebx
call dword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x413f97
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x413fe6
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x4140c6
mov cl, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x414036
mov byte [ebx + eax], cl
mov cl, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx eax, byte [eax + 0x42d655]
cmp al, cl
mov dword [ebp - 0x54], eax
ja 0x4140b3
mov edi, eax
movzx eax, cl
cmp cl, 5
jae 0x41413f
lea ecx, [ebp - 0x2c]
mov edx, ebx
push eax
call fcn.0040a8fa
pop eax
lea eax, [ebp - 0x2c]
mov byte [ebx + 4], 0
cmp dword [eax], 0
jne 0x41403a
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x28]
cmp ecx, edi
mov dword [ebp - 0x58], ecx
jne 0x414180
mov edx, dword [ebp - 0x20]
mov ebx, edi
lea edi, [ebp - 0x48]
mov ecx, edi
push ebx
push eax
call fcn.004141c1
pop eax
pop ecx
cmp byte [edi], 4
jne 0x41409a
mov eax, dword [ebp - 0x44]
jmp 0x4140a5
lea eax, [ebp - 0x50]
mov ecx, 0x103
and dword [eax + 4], 0
mov dword [eax], ecx
push 0
push 0
push edi
push dword [ebp + 8]
push eax
push 0
push 0
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtWriteFile]
mov ecx, 0x103
cmp eax, ecx
jne 0x413fdb
push 0xffffffffffffffff
push ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x50]
cmp eax, 0x103
je 0x4140ef
test eax, eax
js 0x414049
mov eax, dword [ebp - 0x4c]
mov bl, 4
jmp 0x414052
mov eax, 0x1000
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x2c]
cmp edi, eax
cmovb eax, edi
push eax
call fcn.0040a8fa
pop eax
lea eax, [ebp - 0x2c]
cmp dword [eax], 0
je 0x41405c
cmp dword [ebp - 0x28], 0
je 0x414081
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp + 8]
cmp eax, edi
ja 0x41414e
lea edi, [ebp - 0x48]
mov ecx, edi
push eax
call fcn.0040a8fa
pop eax
cmp dword [edi], 0
jne 0x41415c
mov eax, dword [ebp - 0x44]
mov edi, dword [ebp - 0x40]
jmp 0x414062
mov byte [ebx + 4], 0
mov dword [esi + 4], 0x42f718
mov dword [esi], 2
jmp 0x414070
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x414070
mov eax, dword [ebp - 0x28]
mov edi, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
mov ecx, esi
push edi
push eax
call fcn.004141c1
pop eax
pop ecx
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x58
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x42d655]
cmp ecx, edi
jbe 0x41403a
mov byte [ebx], al
mov byte [ebx + 4], 1
jmp 0x4140b3
mov ecx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
cmp cl, 4
jne 0x4140bf
cmp eax, ebx
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x5c], ebx
jne 0x414198
mov dword [esi + 4], 1
jmp 0x413eaf
mov dword [esi], ecx
mov dword [esi + 4], eax
jmp 0x414070
lea ecx, [ebp - 0x48]
mov edx, 0x42f788
mov dword [ecx], 0x42f780
mov dword [ecx + 4], 1
and dword [ecx + 0x10], 0
mov dword [ecx + 8], 4
and dword [ecx + 0xc], 0
call fcn.004291cb
lea eax, [ebp - 0x64]
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x48], 0x42f46c
mov dword [ebp - 0x44], 1
and dword [ebp - 0x38], 0
and dword [ebp - 0x10], 0
lea edx, [ebp - 0x48]
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x40], ecx
and dword [eax], 0
and dword [ebp - 0x3c], 0
mov byte [eax + 4], 0
lea ecx, [ebp - 0x2c]
push edx
push eax
push ecx
call fcn.00414419
add esp, 0xc
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
call fcn.0041440a
push 7
pop ecx
int 0x29
ud2
push 4
pop edx
mov ecx, eax
push 0x42f798
call fcn.00429240
mov ecx, eax
mov edx, edi
push 0x42f724
call fcn.00429240
movsd xmm0, qword [ebp - 0x44]
lea eax, [ebp - 0x50]
movsd qword [eax], xmm0
push 0x2b
pop edx
mov ecx, str.called__Result::unwrap____on_an__Err__value
push 0x42f734
push 0x42da60
push eax
call fcn.004293d6
and dword [ebp - 0x48], 0
lea ecx, [ebp - 0x54]
lea edx, [ebp - 0x58]
push 0x42f7a8
lea eax, [ebp - 0x48]
push eax
call fcn.00429505
and dword [ebp - 0x48], 0
lea ecx, [ebp - 0x50]
lea edx, [ebp - 0x5c]
push 0x42f7b8
push edi
call fcn.00429505
push ebp
sub esp, 0x24
add ebp, 0xc
push dword [ebp - 0x20]
call sub.kernel32.dll_CloseHandle
add esp, 0x24
pop ebp
ret