Function at 0x104e0db
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x34
push edi
xor edi, edi
cmp dword [ebp + 0xc], 2
mov dword [ebp - 0x10], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x20], edi
jae 0x104e104
mov dword [ebp - 0xc], 0x80070057
jmp 0x104e39b
push esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
je 0x104e11b
cmp esi, edi
jne 0x104e143
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e133
jle 0x104e138
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e138
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e387
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x104e17a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e16a
jle 0x104e16f
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e16f
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e387
mov eax, dword [ebp - 0x20]
and eax, 0xfffffff9
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
je 0x104e191
mov dword [ebp - 0xc], edi
jmp 0x104e1b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e1a9
jle 0x104e1ae
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e1ae
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e387
cmp dword [ebp + 0x14], edi
je 0x104e1f3
lea eax, [ebp - 8]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.0104d5c0
mov dword [ebp - 0xc], eax
cmp dword [ebp - 8], edi
je 0x104e1e4
push dword [ebp + 8]
push 0x1001624
call fcn.0104d8d2
pop ecx
pop ecx
lea eax, [ebp - 0x30]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0x18]
cmp eax, edi
je 0x104e1f3
mov dword [eax], edi
mov esi, dword [sym.imp.msvcrt.dll_wprintf]
push ebx
mov ebx, 0x101769c
push dword [ebp - 0x14]
call fcn.0104dbc4
test eax, eax
jne 0x104e2da
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push eax
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x14]
call edi
test eax, eax
jne 0x104e256
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x104e241
jle 0x104e246
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e246
mov eax, 0x80004005
mov dword [ebp - 0xc], eax
test eax, eax
jl 0x104e386
jmp 0x104e3d1
cmp dword [ebp - 0x18], 0
jne 0x104e268
mov dword [ebp - 0x10], 0xa
jmp 0x104e3d1
push 1
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp - 1]
push eax
push 0
call dword [sym.imp.msvcrt.dll__getmbcp]
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x104e28a
and dword [ebp - 0x10], eax
push 0xd
pop eax
cmp ax, word [ebp - 0x10]
jne 0x104e3d1
push 0
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x14]
call edi
test eax, eax
je 0x104e2b5
and dword [ebp - 0xc], 0
jmp 0x104e3d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x104e2cd
jle 0x104e2d2
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e2d2
mov eax, 0x80004005
mov dword [ebp - 0xc], eax
jmp 0x104e3d1
cmp dword [ebp + 0x14], 0
je 0x104e3bc
xor eax, eax
lea edi, [ebp - 0x34]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputW]
xor eax, eax
inc eax
cmp ax, word [ebp - 0x34]
jne 0x104e1ff
mov eax, dword [ebp - 0x1c]
cmp dword [eax], 1
jne 0x104e1ff
mov ecx, eax
mov al, byte [ecx + 0xa]
test al, al
je 0x104e330
cbw
movzx eax, ax
mov dword [ebp - 0x10], eax
jmp 0x104e3d1
movzx eax, word [ecx + 6]
xor ecx, ecx
cmp cx, ax
je 0x104e1ff
movzx eax, ax
cmp eax, 0x10
jl 0x104e350
cmp eax, 0x11
jle 0x104e1ff
cmp dword [ebp - 8], 0
jbe 0x104e365
push 8
push 8
push ebx
call esi
add esp, 0xc
dec dword [ebp - 8]
jne 0x104e356
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x104e372
mov dword [eax], 1
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 8]
mov ax, word [eax + 6]
mov ecx, dword [ebp + 8]
inc dword [ebp - 8]
mov word [ecx + edx*2], ax
pop ebx
xor edi, edi
pop esi
cmp dword [ebp - 0x20], edi
je 0x104e39b
push dword [ebp - 0x20]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp + 0xc]
jb 0x104e49f
cmp dword [ebp - 0xc], edi
jl 0x104e4a8
mov dword [ebp - 0xc], 0x8007007a
jmp 0x104e4a8
push 0
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
mov ecx, dword [ebp - 0x10]
movzx eax, cx
sub eax, 3
je 0x104e493
sub eax, 5
je 0x104e453
dec eax
dec eax
je 0x104e484
sub eax, 3
je 0x104e484
sub eax, 0xe
je 0x104e435
mov eax, dword [ebp + 0xc]
dec eax
cmp dword [ebp - 8], eax
jae 0x104e1ff
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 8]
inc dword [ebp - 8]
cmp dword [ebp + 0x10], 0
mov word [eax + edx*2], cx
je 0x104e1ff
movzx eax, word [ebp - 0x10]
push eax
push 0x1017690
call fcn.0104d8d2
pop ecx
pop ecx
jmp 0x104e1ff
cmp dword [ebp - 8], 0
jbe 0x104e1ff
push 8
push 8
push ebx
call esi
add esp, 0xc
dec dword [ebp - 8]
jne 0x104e43f
jmp 0x104e1ff
cmp dword [ebp - 8], 0
jbe 0x104e1ff
mov edx, dword [ebp - 8]
mov ecx, dword [ebp + 8]
xor eax, eax
dec dword [ebp - 8]
mov word [ecx + edx*2], ax
cmp dword [ebp + 0x10], eax
je 0x104e1ff
push 8
push 8
push ebx
call esi
add esp, 0xc
jmp 0x104e1ff
push 0x100168c
call fcn.0104d940
jmp 0x104e386
mov dword [ebp - 0xc], 0x800704c7
jmp 0x104e386
mov edx, dword [ebp + 8]
xor ecx, ecx
mov word [edx + eax*2], cx
mov eax, dword [ebp - 0xc]
pop edi
leave
ret 0x14