Function at 0x401890
Capabilities:
Read file on windows
Read pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x360
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ebx, eax
lea eax, [ebp - 0x324]
push 0x104
push 0
push eax
mov dword [ebp - 0x340], ebx
call fcn.00402a40
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 3
je 0x4018ec
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ee3
mov esp, ebp
pop ebp
ret 0x10
mov ebx, dword [sym.imp.USER32.dll_TranslateMessage]
push edi
mov edi, dword [sym.imp.USER32.dll_PeekMessageA]
push esi
nop word [eax + eax]
lea esi, [ebp - 0x110]
nop word [eax + eax]
push 0x5ff
push 0xfa
push 0
push 0
push 0
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
test eax, eax
jne 0x401990
nop word [eax + eax]
push 1
push 0
push 0
push 0
lea eax, [ebp - 0x360]
push eax
call edi
test eax, eax
je 0x401970
lea eax, [ebp - 0x360]
push eax
call ebx
lea eax, [ebp - 0x360]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 1
push 0
push 0
push 0
lea eax, [ebp - 0x360]
push eax
call edi
test eax, eax
jne 0x401945
push 0x5ff
push 0xfa
push 0
push 0
push 0
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
test eax, eax
je 0x401930
nop word [eax + eax]
push 0
lea eax, [ebp - 0x33c]
mov dword [ebp - 0x338], esi
push eax
push 0
push 0
push 0
push dword [ebp - 0x340]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x401c6b
cmp dword [ebp - 0x33c], 0
je 0x401a06
push 0
lea eax, [ebp - 0x33c]
push eax
push 1
push esi
push dword [ebp - 0x340]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401c6b
cmp dword [ebp - 0x33c], 1
jne 0x401c6b
inc esi
lea eax, [ebp - 6]
cmp esi, eax
je 0x401c53
mov eax, dword [ebp - 0x338]
cmp byte [eax], 0xa
jne 0x401990
lea eax, [ebp - 0x110]
cmp esi, eax
je 0x401910
cmp byte [esi - 1], 0xa
lea ecx, [esi - 1]
jne 0x401910
cmp byte [ecx - 1], 0xd
lea eax, [ecx - 1]
cmove ecx, eax
mov byte [ecx], 0
cmp byte [ebp - 0x110], 0x46
jne 0x401a69
cmp byte [ebp - 0x10f], 0x49
jne 0x401a69
cmp byte [ebp - 0x10e], 0x4c
jne 0x401a69
lea eax, [ebp - 0x10d]
push eax
lea eax, [ebp - 0x324]
push 0x104
push eax
call fcn.00404da4
add esp, 0xc
jmp 0x401900
cmp byte [ebp - 0x324], 0
je 0x401900
mov esi, dword [str._NewWindow]
mov eax, 0x41b8c0
mov dword [ebp - 0x338], 0
test esi, esi
je 0x401afa
nop
add eax, 4
mov dword [ebp - 0x344], eax
lea eax, [ebp - 0x324]
push eax
lea eax, [ebp - 0x220]
push 0x10f
push eax
call fcn.00404da4
push esi
lea eax, [ebp - 0x220]
push 0x10f
push eax
call fcn.00406ca0
mov esi, dword [sym.imp.USER32.dll_GetDesktopWindow]
lea eax, [ebp - 0x338]
add esp, 0x18
push eax
push 5
lea eax, [ebp - 0x220]
push eax
call esi
push eax
call fcn.00401ded
mov eax, dword [ebp - 0x338]
test eax, eax
jne 0x401b44
mov eax, dword [ebp - 0x344]
mov esi, dword [eax]
test esi, esi
jne 0x401a90
mov esi, dword [sym.imp.USER32.dll_GetDesktopWindow]
mov byte [ebp - 0x220], 0
push 0x41997c
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x401bb1
cmp byte [ebp - 0x220], al
je 0x401900
push eax
push 1
lea eax, [ebp - 0x220]
push eax
call esi
push eax
call fcn.00401ded
jmp 0x401900
cmp dword [eax + 0x34], 0
jne 0x401b07
push 0
lea eax, [ebp - 0x334]
push eax
push 0
push 0x30
call dword [sym.imp.USER32.dll_SystemParametersInfoA]
mov ecx, dword [ebp - 0x338]
mov eax, dword [ebp - 0x330]
mov dword [ecx + 0x24], eax
mov ecx, dword [ebp - 0x338]
mov eax, dword [ebp - 0x328]
mov dword [ecx + 0x2c], eax
mov eax, dword [ebp - 0x338]
mov ecx, dword [ebp - 0x334]
mov dword [eax + 0x20], ecx
mov ecx, dword [ebp - 0x32c]
mov eax, ecx
sub eax, dword [ebp - 0x334]
cdq
and edx, 3
add eax, edx
sar eax, 2
sub ecx, eax
mov eax, dword [ebp - 0x338]
mov dword [eax + 0x28], ecx
jmp 0x401b07
push 0x419980
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x401bde
push eax
push 2
lea eax, [ebp - 0x324]
push eax
call esi
push eax
call fcn.00401ded
jmp 0x401900
cmp byte [ebp - 0x110], 0x43
jne 0x401900
cmp byte [ebp - 0x10f], 0x4f
jne 0x401900
cmp byte [ebp - 0x10e], 0x4e
jne 0x401900
lea eax, [ebp - 0x10d]
push eax
call fcn.0040722a
add esp, 4
push eax
push 0xf
lea eax, [ebp - 0x324]
push eax
call esi
push eax
call fcn.00401ded
test eax, eax
je 0x401900
cmp byte [ebp - 0x220], 0
je 0x401900
push 0
push 9
lea eax, [ebp - 0x220]
push eax
call esi
push eax
call fcn.00401ded
jmp 0x401900
pop esi
pop edi
mov eax, 2
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ee3
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp - 4]
xor eax, eax
pop esi
pop edi
xor ecx, ebp
pop ebx
call fcn.00401ee3
mov esp, ebp
pop ebp
ret 0x10