Function at 0x1003d40
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 0x1004050
cmp edi, ebx
je 0x1004050
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 0x1004023
mov edi, dword [ebp + 0x18]
cmp edi, ebx
je 0x1004023
cmp dword [ebp + 0x14], ebx
je 0x1003de8
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.01002771
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
cmp esi, ebx
je 0x1003de0
push dword [ebp + 8]
movzx eax, word [0x100a3e0]
push 0x100147c
push eax
call fcn.01002954
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 0x1003e70
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 0x1003ff1
cmp dword [ebp - 0x14], 0
jne 0x1003e2e
mov dword [ebp - 8], 0xa
jmp 0x1003f26
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 0x1003e4e
and dword [ebp - 8], eax
push 0xd
pop eax
cmp ax, word [ebp - 8]
jne 0x1003f26
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 1]
push eax
push dword [ebp - 0xc]
call edi
jmp 0x1003f26
cmp dword [ebp + 0x14], 0
je 0x1003f12
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 0x1003deb
mov eax, dword [ebp - 0x18]
cmp dword [eax], ebx
jne 0x1003deb
mov ecx, eax
mov al, byte [ecx + 0xa]
test al, al
je 0x1003ec0
cbw
movzx eax, ax
mov dword [ebp - 8], eax
jmp 0x1003f26
movzx eax, word [ecx + 6]
xor ecx, ecx
cmp cx, ax
je 0x1003deb
movzx eax, ax
cmp eax, 0x10
jl 0x1003ee0
cmp eax, 0x11
jle 0x1003deb
test esi, esi
jbe 0x1003ef9
push 8
push 8
push 0x1001470
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003ee4
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 0x100402a
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 0x100400a
sub eax, 5
je 0x1003fa9
dec eax
dec eax
je 0x1003fdb
sub eax, 3
je 0x1003fdb
sub eax, 0xe
je 0x1003f87
mov eax, dword [ebp + 0xc]
dec eax
cmp esi, eax
jae 0x1003deb
mov eax, dword [ebp + 8]
mov word [eax + esi*2], cx
inc esi
cmp dword [ebp + 0x10], 0
je 0x1003deb
movzx eax, word [ebp - 8]
push eax
movzx eax, word [0x100a3e0]
push 0x1001464
push eax
call fcn.01002954
jmp 0x1003fd3
test esi, esi
jbe 0x1003deb
push 8
push 8
push 0x1001470
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
dec esi
jne 0x1003f8f
jmp 0x1003deb
test esi, esi
jbe 0x1003deb
mov ecx, dword [ebp + 8]
xor eax, eax
mov word [ecx + esi*2], ax
dec esi
cmp dword [ebp + 0x10], eax
je 0x1003deb
push 8
push 8
push 0x1001470
call dword [sym.imp.msvcrt.dll_wprintf]
add esp, 0xc
jmp 0x1003deb
movzx eax, word [0x100a3e0]
push 0x1001354
push eax
call fcn.01002954
pop ecx
pop ecx
jmp 0x100402a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004005
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x10], eax
jmp 0x100402a
call fcn.0100201c
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 0x1004042
mov eax, 0x8007007a
jmp 0x1004064
mov ecx, dword [ebp + 8]
xor eax, eax
mov word [ecx + esi*2], ax
mov eax, dword [ebp - 0x10]
jmp 0x1004064
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jle 0x1004064
and eax, 0xffff
or eax, 0x80070000
pop edi
pop esi
pop ebx
leave
ret 0x14