Function at 0x415590
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x10014
call fcn.004f1a00
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edi, ecx
mov dword [esp + 4], ecx
mov esi, str.stdout
mov ebp, str.stderr
lea ecx, [eax + 0x20]
add eax, 0x40
cmp edx, 0xfffffff5
cmove ebp, esi
cmove eax, ecx
push eax
call sub.msvcrt.dll__fileno_1
add esp, 4
cmp eax, 0xffffffff
je 0x415662
test eax, eax
js 0x415695
push eax
call sub.msvcrt.dll__dup
add esp, 4
mov ebx, eax
cmp eax, 0xffffffff
je 0x41577b
push 0x8000
push ebx
call dword [sym.imp.msvcrt.dll__setmode]
add esp, 8
cmp eax, 0xffffffff
je 0x4157ae
push 0x573fd5
push ebx
call sub.msvcrt.dll__fdopen
add esp, 8
mov esi, eax
test eax, eax
je 0x415806
push 0
push 4
push 0
push esi
call sub.msvcrt.dll_setvbuf
add esp, 0x10
cmp eax, 0xffffffff
jne 0x415697
mov edi, dword [sym.imp.msvcrt.dll__iob]
add edi, 0x40
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
call fcn.0043bb30
add esp, 4
push eax
push ebp
push str.adb:_failed_to_unbuffer__s:__s_n
push edi
call fcn.00439e80
add esp, 0x10
jmp 0x415838
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x40
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
call fcn.0043bb30
add esp, 4
push eax
push ebp
push str.adb:_failed_to_get_file_descriptor_for__s:__s_n
push esi
call fcn.00439e80
add esp, 0x10
mov edi, 1
jmp 0x41584a
xor esi, esi
mov dword [esp + 0xc], ebp
mov ebx, esp
lea ebp, [esp + 0x14]
mov dword [esp], 0
push 0
push ebx
push 0x10000
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x415709
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
nop word cs:[eax + eax]
nop dword [eax]
test esi, esi
je 0x4156ef
push esi
push dword [esp + 4]
push 1
push ebp
call fcn.00439f70
add esp, 0x10
mov ecx, dword [esp]
cmp eax, ecx
jne 0x4157e7
mov dword [esp], 0
push 0
push ebx
push 0x10000
push ebp
push dword [esp + 0x14]
call edi
test eax, eax
jne 0x4156d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
cmp eax, 0x6d
je 0x41583d
mov edi, dword [sym.imp.msvcrt.dll__iob]
lea ecx, [esp + 0x10]
add edi, 0x40
push eax
push ecx
call fcn.004cfe30
add esp, 8
push dword [esp + 0x10]
push dword [esp + 0x10]
push str.adb:_failed_to_read_from__s:__s_n
push edi
call fcn.00439e80
add esp, 0x10
mov eax, dword [esp + 0x10]
lea ecx, [eax - 0xc]
cmp ecx, 0x56dff0
je 0x415838
mov edx, 0xffffffff
lock xadd dword [eax - 4], edx
test edx, edx
jg 0x415838
lea eax, [esp + 8]
push eax
call fcn.00533980
jmp 0x415838
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x40
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
call fcn.0043bb30
add esp, 4
push eax
push ebp
push str.adb:_failed_to_duplicate_file_descriptor_for__s:__s_n
push esi
call fcn.00439e80
add esp, 0x10
mov edi, 1
jmp 0x41584a
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x40
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
call fcn.0043bb30
add esp, 4
push eax
push ebp
push str.adb:_failed_to_set_binary_mode_for_duplicate_of__s:__s_n
push esi
call fcn.00439e80
add esp, 0x10
push ebx
call sub.msvcrt.dll__close
add esp, 4
mov edi, 1
jmp 0x41584a
mov edx, dword [sym.imp.msvcrt.dll__iob]
add edx, 0x40
push dword [esp + 0xc]
push ecx
push eax
push str.adb:_error:_only_wrote__zu_of__lu_bytes_to__s_n
push edx
call fcn.00439e80
add esp, 0x14
jmp 0x415838
mov edi, dword [sym.imp.msvcrt.dll__iob]
add edi, 0x40
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
call fcn.0043bb30
add esp, 4
push eax
push ebp
push str.adb:_failed_to_open_duplicate_stream_for__s:__s_n
push edi
call fcn.00439e80
add esp, 0x10
push ebx
call sub.msvcrt.dll__close
add esp, 4
mov edi, 1
test esi, esi
je 0x41584a
push esi
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [esp + 4]
test eax, eax
je 0x41585c
lea ecx, [esp + 4]
push eax
call fcn.004342c0
mov eax, edi
add esp, 0x10014
pop esi
pop edi
pop ebx
pop ebp
ret