Function at 0x4161d0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x10038
call fcn.004abc90
sub esp, eax
cmp edx, 0xfffffff5
mov eax, dword [esp + eax]
mov dword [ebp - 0x10024], eax
je 0x416416
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 0x416439
test eax, eax
js 0x4162d0
mov dword [esp], eax
call sub.msvcrt.dll__dup
cmp eax, 0xffffffff
mov esi, eax
je 0x416480
mov dword [esp + 4], 0x8000
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__setmode]
cmp eax, 0xffffffff
je 0x4164b8
mov dword [esp + 4], 0x531693
mov dword [esp], esi
call sub.msvcrt.dll__fdopen
test eax, eax
mov ebx, eax
je 0x4164fb
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 0x4162d2
call dword [sym.imp.msvcrt.dll__errno]
mov esi, 1
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00431640
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.00431110
jmp 0x416377
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 0x4163a4
test ebx, ebx
je 0x4162e0
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.00431240
mov edx, dword [ebp - 0x10020]
cmp eax, edx
je 0x4162e0
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.00431110
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov eax, dword [ebp - 0x10024]
test eax, eax
je 0x41639a
mov dword [esp], eax
lea ecx, [ebp - 0x10024]
call fcn.0042c500
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 0x416409
lea edx, [ebp - 0x1001c]
mov dword [esp + 4], eax
mov dword [esp], edx
call fcn.00435b90
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.00431110
mov eax, dword [ebp - 0x1001c]
lea ecx, [eax - 0xc]
cmp ecx, 0x52bf90
jne 0x416528
mov esi, 1
test ebx, ebx
jne 0x416377
jmp 0x41637f
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 0x416218
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00431640
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.00431110
mov esi, 1
jmp 0x41637f
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00431640
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.00431110
jmp 0x41646f
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00431640
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.00431110
mov dword [esp], esi
call sub.msvcrt.dll__close
jmp 0x41646f
nop
lea esi, [esi]
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00431640
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 0x4164de
or edx, 0xffffffff
lock xadd dword [eax - 4], edx
test edx, edx
jg 0x416404
lea eax, [ebp - 0x10025]
mov dword [esp], eax
call fcn.004edad0
push eax
jmp 0x416404