Function at 0x1003c06
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
xor ebx, ebx
push edi
xor esi, esi
push 0xfffffffffffffff6
mov dword [ebp - 0x10], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0xc], edi
je 0x1003f11
cmp edi, ebx
je 0x1003f11
lea eax, [ebp - 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov eax, dword [ebp - 0x1c]
and eax, 0xfffffff9
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
cmp dword [ebp + 0xc], 2
jb 0x1003ee5
mov edi, dword [ebp + 0x18]
cmp edi, ebx
je 0x1003ee5
cmp dword [ebp + 0x14], ebx
je 0x1003cae
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.01002647
mov esi, dword [ebp - 0x20]
cmp esi, ebx
mov dword [ebp - 0x10], eax
je 0x1003ca6
push dword [ebp + 8]
movzx eax, word [0x10093f0]
push 0x100146c
push eax
call fcn.01002824
add esp, 0xc
lea eax, [ebp - 0x30]
mov dword [ebp - 0x18], eax
mov dword [edi], ebx
xor ebx, ebx
inc ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x1003d34
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 1]
push eax
push dword [ebp - 0xc]
call edi
test eax, eax
je 0x1003eb3
cmp dword [ebp - 0x14], 0
jne 0x1003cf4
mov dword [ebp - 8], 0xa
jmp 0x1003de8
push ebx
lea eax, [ebp - 8]
push eax
push ebx
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 0x1003d14
and dword [ebp - 8], eax
cmp word [ebp - 8], 0xd
jne 0x1003de8
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 1]
push eax
push dword [ebp - 0xc]
call edi
jmp 0x1003de8
cmp dword [ebp + 0x14], 0
je 0x1003dd4
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 - 0x14]
push eax
push ebx
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputW]
cmp word [ebp - 0x34], bx
jne 0x1003cb1
mov eax, dword [ebp - 0x18]
cmp dword [eax], ebx
jne 0x1003cb1
mov ecx, eax
mov al, byte [ecx + 0xa]
test al, al
je 0x1003d84
movsx ax, al
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x1003de8
movzx eax, word [ecx + 6]
test ax, ax
je 0x1003cb1
movzx eax, ax
cmp eax, 0x10
jl 0x1003da2
cmp eax, 0x11
jle 0x1003cb1
test esi, esi
jbe 0x1003dbb
push 8
push 8
push 0x1001460
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003da6
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 8]
mov dword [eax], ebx
mov eax, dword [ebp - 0x18]
mov ax, word [eax + 6]
mov word [ecx + esi*2], ax
inc esi
jmp 0x1003eec
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
mov ecx, dword [ebp - 8]
movzx eax, cx
sub eax, 3
je 0x1003ecc
sub eax, 5
je 0x1003e6b
dec eax
dec eax
je 0x1003e9d
sub eax, 3
je 0x1003e9d
sub eax, 0xe
je 0x1003e49
mov eax, dword [ebp + 0xc]
dec eax
cmp esi, eax
jae 0x1003cb1
mov eax, dword [ebp + 8]
mov word [eax + esi*2], cx
inc esi
cmp dword [ebp + 0x10], 0
je 0x1003cb1
movzx eax, word [ebp - 8]
push eax
movzx eax, word [0x10093f0]
push 0x1001454
push eax
call fcn.01002824
jmp 0x1003e95
test esi, esi
jbe 0x1003cb1
push 8
push 8
push 0x1001460
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003e51
jmp 0x1003cb1
test esi, esi
jbe 0x1003cb1
mov eax, dword [ebp + 8]
and word [eax + esi*2], 0
dec esi
cmp dword [ebp + 0x10], 0
je 0x1003cb1
push 8
push 8
push 0x1001460
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
jmp 0x1003cb1
movzx eax, word [0x10093f0]
push 0x1001344
push eax
call fcn.01002824
pop ecx
pop ecx
jmp 0x1003eec
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1003ec7
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x10], eax
jmp 0x1003eec
call fcn.01002039
push dword [ebp - 0x1c]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push 0
call dword [sym.imp.msvcrt.dll_exit]
mov dword [ebp - 0x10], 0x80070057
push dword [ebp - 0x1c]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
cmp esi, dword [ebp + 0xc]
jb 0x1003f04
mov eax, 0x8007007a
jmp 0x1003f25
mov eax, dword [ebp + 8]
and word [eax + esi*2], 0
mov eax, dword [ebp - 0x10]
jmp 0x1003f25
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jle 0x1003f25
and eax, 0xffff
or eax, 0x80070000
pop edi
pop esi
pop ebx
leave
ret 0x14