Function at 0x40fb90
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x10038
call fcn.0049f7e0
sub esp, eax
cmp edx, 0xfffffff5
mov eax, dword [esp + eax]
mov dword [ebp - 0x10024], eax
je 0x40fdd6
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [ebp - 0x1002c], str.stderr
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll__fileno_1
cmp eax, 0xffffffff
je 0x40fdf9
test eax, eax
js 0x40fc90
mov dword [esp], eax
call sub.msvcrt.dll__dup
cmp eax, 0xffffffff
mov esi, eax
je 0x40fe40
mov dword [esp + 4], 0x8000
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__setmode]
cmp eax, 0xffffffff
je 0x40fe78
mov dword [esp + 4], 0x5211bb
mov dword [esp], esi
call sub.msvcrt.dll__fdopen
test eax, eax
mov ebx, eax
je 0x40febb
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_setvbuf
cmp eax, 0xffffffff
jne 0x40fc92
call dword [sym.imp.msvcrt.dll__errno]
mov esi, 1
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00423fd0
mov dword [esp + 4], str.Failed_to_unbuffer__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00428b20
jmp 0x40fd37
xor ebx, ebx
lea edi, [ebp - 0x10020]
lea esi, [ebp - 0x10018]
nop
mov eax, dword [ebp - 0x10024]
mov dword [ebp - 0x10020], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0x10000
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40fd64
test ebx, ebx
je 0x40fca0
mov eax, dword [ebp - 0x10020]
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 1
mov dword [esp], esi
mov dword [esp + 8], eax
call fcn.00428c50
mov edx, dword [ebp - 0x10020]
cmp eax, edx
je 0x40fca0
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov esi, 1
mov ecx, dword [ebp - 0x1002c]
mov dword [esp + 0xc], edx
mov dword [esp + 4], str.Only_wrote__zu_of__lu_bytes_to__s_n
add eax, 0x40
mov dword [esp + 0x10], ecx
mov dword [esp], eax
call fcn.00428b20
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov eax, dword [ebp - 0x10024]
test eax, eax
je 0x40fd5a
mov dword [esp], eax
lea ecx, [ebp - 0x10024]
call fcn.00422e10
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor esi, esi
cmp eax, 0x6d
je 0x40fdc9
lea edx, [ebp - 0x1001c]
mov dword [esp + 4], eax
mov dword [esp], edx
call fcn.0042d220
mov eax, dword [ebp - 0x1001c]
mov dword [esp + 4], str.Failed_to_read_from__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00428b20
mov eax, dword [ebp - 0x1001c]
lea esi, [eax - 0xc]
cmp esi, 0x51af30
jne 0x40fee8
mov esi, 1
test ebx, ebx
jne 0x40fd37
jmp 0x40fd3f
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [ebp - 0x1002c], str.stdout
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll__fileno_1
cmp eax, 0xffffffff
jne 0x40fbd8
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00423fd0
mov dword [esp + 4], str.Failed_to_get_file_descriptor_for__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00428b20
mov esi, 1
jmp 0x40fd3f
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00423fd0
mov dword [esp + 4], str.Failed_to_duplicate_file_descriptor_for__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00428b20
jmp 0x40fe2f
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00423fd0
mov dword [esp + 4], str.Failed_to_set_binary_mode_for_duplicate_of__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00428b20
mov dword [esp], esi
call sub.msvcrt.dll__close
jmp 0x40fe2f
nop
lea esi, [esi]
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00423fd0
mov dword [esp + 4], str.Failed_to_open_duplicate_stream_for__s:__s_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1002c]
mov dword [esp + 8], eax
jmp 0x40fe9e
sub eax, 4
call fcn.00512c08
test eax, eax
jg 0x40fdc4
lea eax, [ebp - 0x10025]
mov ecx, esi
mov dword [esp], eax
call fcn.004df650
push eax
jmp 0x40fdc4