Function at 0x1003d90
Capabilities:
Read file on windows
Terminate process

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
mov dword [ebp - 0xc], edi
cmp edi, 0xffffffff
je 0x10040a0
cmp edi, ebx
je 0x10040a0
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 0x1004073
mov edi, dword [ebp + 0x18]
cmp edi, ebx
je 0x1004073
cmp dword [ebp + 0x14], ebx
je 0x1003e38
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.010027c1
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
cmp esi, ebx
je 0x1003e30
push dword [ebp + 8]
movzx eax, word [0x1009460]
push 0x1001458
push eax
call fcn.010029a4
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 0x1003ec0
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 0x1004041
cmp dword [ebp - 0x14], 0
jne 0x1003e7e
mov dword [ebp - 8], 0xa
jmp 0x1003f76
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 0x1003e9e
and dword [ebp - 8], eax
push 0xd
pop eax
cmp ax, word [ebp - 8]
jne 0x1003f76
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 1]
push eax
push dword [ebp - 0xc]
call edi
jmp 0x1003f76
cmp dword [ebp + 0x14], 0
je 0x1003f62
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]
mov eax, ebx
cmp ax, word [ebp - 0x34]
jne 0x1003e3b
mov eax, dword [ebp - 0x18]
cmp dword [eax], ebx
jne 0x1003e3b
mov ecx, eax
mov al, byte [ecx + 0xa]
test al, al
je 0x1003f10
cbw
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x1003f76
movzx eax, word [ecx + 6]
xor ecx, ecx
cmp cx, ax
je 0x1003e3b
movzx eax, ax
cmp eax, 0x10
jl 0x1003f30
cmp eax, 0x11
jle 0x1003e3b
test esi, esi
jbe 0x1003f49
push 8
push 8
push 0x100144c
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003f34
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 0x100407a
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 0x100405a
sub eax, 5
je 0x1003ff9
dec eax
dec eax
je 0x100402b
sub eax, 3
je 0x100402b
sub eax, 0xe
je 0x1003fd7
mov eax, dword [ebp + 0xc]
dec eax
cmp esi, eax
jae 0x1003e3b
mov eax, dword [ebp + 8]
mov word [eax + esi*2], cx
inc esi
cmp dword [ebp + 0x10], 0
je 0x1003e3b
movzx eax, word [ebp - 8]
push eax
movzx eax, word [0x1009460]
push 0x1001440
push eax
call fcn.010029a4
jmp 0x1004023
test esi, esi
jbe 0x1003e3b
push 8
push 8
push 0x100144c
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003fdf
jmp 0x1003e3b
test esi, esi
jbe 0x1003e3b
mov ecx, dword [ebp + 8]
xor eax, eax
mov word [ecx + esi*2], ax
dec esi
cmp dword [ebp + 0x10], eax
je 0x1003e3b
push 8
push 8
push 0x100144c
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
jmp 0x1003e3b
movzx eax, word [0x1009460]
push 0x1001330
push eax
call fcn.010029a4
pop ecx
pop ecx
jmp 0x100407a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004055
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x10], eax
jmp 0x100407a
call fcn.01001dac
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 0x1004092
mov eax, 0x8007007a
jmp 0x10040b4
mov ecx, dword [ebp + 8]
xor eax, eax
mov word [ecx + esi*2], ax
mov eax, dword [ebp - 0x10]
jmp 0x10040b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jle 0x10040b4
and eax, 0xffff
or eax, 0x80070000
pop edi
pop esi
pop ebx
leave
ret 0x14