Function at 0x104e0f8
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 0x104e121
mov dword [ebp - 0xc], 0x80070057
jmp 0x104e3b8
push esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
je 0x104e138
cmp esi, edi
jne 0x104e160
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e150
jle 0x104e155
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e155
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e3a4
lea eax, [ebp - 0x20]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x104e197
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e187
jle 0x104e18c
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e18c
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e3a4
mov eax, dword [ebp - 0x20]
and eax, 0xfffffff9
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
je 0x104e1ae
mov dword [ebp - 0xc], edi
jmp 0x104e1d6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x104e1c6
jle 0x104e1cb
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e1cb
mov eax, 0x80004005
cmp eax, edi
mov dword [ebp - 0xc], eax
jl 0x104e3a4
cmp dword [ebp + 0x14], edi
je 0x104e210
lea eax, [ebp - 8]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.0104d5dd
mov dword [ebp - 0xc], eax
cmp dword [ebp - 8], edi
je 0x104e201
push dword [ebp + 8]
push 0x1001624
call fcn.0104d8ef
pop ecx
pop ecx
lea eax, [ebp - 0x30]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0x18]
cmp eax, edi
je 0x104e210
mov dword [eax], edi
mov esi, dword [sym.imp.msvcrt.dll_wprintf]
push ebx
mov ebx, 0x101769c
push dword [ebp - 0x14]
call fcn.0104dbe1
test eax, eax
jne 0x104e2f7
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 0x104e273
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x104e25e
jle 0x104e263
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e263
mov eax, 0x80004005
mov dword [ebp - 0xc], eax
test eax, eax
jl 0x104e3a3
jmp 0x104e3ee
cmp dword [ebp - 0x18], 0
jne 0x104e285
mov dword [ebp - 0x10], 0xa
jmp 0x104e3ee
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 0x104e2a7
and dword [ebp - 0x10], eax
push 0xd
pop eax
cmp ax, word [ebp - 0x10]
jne 0x104e3ee
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 0x104e2d2
and dword [ebp - 0xc], 0
jmp 0x104e3ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x104e2ea
jle 0x104e2ef
and eax, 0xffff
or eax, 0x80070000
jmp 0x104e2ef
mov eax, 0x80004005
mov dword [ebp - 0xc], eax
jmp 0x104e3ee
cmp dword [ebp + 0x14], 0
je 0x104e3d9
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 0x104e21c
mov eax, dword [ebp - 0x1c]
cmp dword [eax], 1
jne 0x104e21c
mov ecx, eax
mov al, byte [ecx + 0xa]
test al, al
je 0x104e34d
cbw
movzx eax, ax
mov dword [ebp - 0x10], eax
jmp 0x104e3ee
movzx eax, word [ecx + 6]
xor ecx, ecx
cmp cx, ax
je 0x104e21c
movzx eax, ax
cmp eax, 0x10
jl 0x104e36d
cmp eax, 0x11
jle 0x104e21c
cmp dword [ebp - 8], 0
jbe 0x104e382
push 8
push 8
push ebx
call esi
add esp, 0xc
dec dword [ebp - 8]
jne 0x104e373
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x104e38f
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 0x104e3b8
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 0x104e4bc
cmp dword [ebp - 0xc], edi
jl 0x104e4c5
mov dword [ebp - 0xc], 0x8007007a
jmp 0x104e4c5
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 0x104e4b0
sub eax, 5
je 0x104e470
dec eax
dec eax
je 0x104e4a1
sub eax, 3
je 0x104e4a1
sub eax, 0xe
je 0x104e452
mov eax, dword [ebp + 0xc]
dec eax
cmp dword [ebp - 8], eax
jae 0x104e21c
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 0x104e21c
movzx eax, word [ebp - 0x10]
push eax
push 0x1017690
call fcn.0104d8ef
pop ecx
pop ecx
jmp 0x104e21c
cmp dword [ebp - 8], 0
jbe 0x104e21c
push 8
push 8
push ebx
call esi
add esp, 0xc
dec dword [ebp - 8]
jne 0x104e45c
jmp 0x104e21c
cmp dword [ebp - 8], 0
jbe 0x104e21c
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 0x104e21c
push 8
push 8
push ebx
call esi
add esp, 0xc
jmp 0x104e21c
push 0x100168c
call fcn.0104d95d
jmp 0x104e3a3
mov dword [ebp - 0xc], 0x800704c7
jmp 0x104e3a3
mov edx, dword [ebp + 8]
xor ecx, ecx
mov word [edx + eax*2], cx
mov eax, dword [ebp - 0xc]
pop edi
leave
ret 0x14