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

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x14c
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x134], eax
xor eax, eax
mov dword [ebp - 0x138], eax
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x61047360
mov edi, dword [ebx + 0x3d0]
test edi, edi
jne 0x610474fe
mov eax, dword [ebx + 0x398]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x130], edx
mov edx, dword [eax + 0x1c]
mov eax, edx
and eax, 1
test al, al
je 0x61047170
test dl, 8
je 0x61047170
mov eax, dword [ebp + 0x10]
shr eax, 1
mov dword [ebp - 0x130], eax
jne 0x61047170
mov eax, 1
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0x101
jbe 0x61047187
mov eax, 0x101
mov dword [ebp - 0x130], eax
mov eax, dword [ebx]
lea edi, [ebp - 0x12c]
mov dword [esp], ebx
call dword [eax + 0xc4]
mov esi, dword [eax]
xor eax, eax
mov dword [ebp - 0x12c], eax
lea esi, [esi]
lea edi, [edi]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.KERNEL32.dll_PeekNamedPipe
sub esp, 0x18
test eax, eax
je 0x610474c9
mov eax, dword [ebp - 0x12c]
test eax, eax
jne 0x6104725f
mov eax, dword [ebx]
mov dword [esp], ebx
call dword [eax + 0xcc]
test al, al
jne 0x61047360
mov eax, dword [ebp - 0x12c]
test eax, eax
jne 0x61047235
mov eax, dword [ebx + 0x398]
test byte [eax + 0x25], 2
jne 0x61047360
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x61047360
mov dword [esp], ebx
call fcn.6102acc0
test al, al
jne 0x61047249
mov dword [esp], 0xa
call sub.KERNEL32.dll_Sleep
sub esp, 4
jmp 0x610471b0
call sym.cygwin1.dll___errno
mov dword [eax], 0xb
mov eax, 0xffffffff
mov dword [ebp - 0x138], eax
mov dword [esp + 0xc], edi
mov edx, dword [ebp - 0x130]
lea edi, [ebp - 0x128]
mov dword [esp + 0x10], 0
mov dword [esp + 8], edx
mov dword [esp + 4], edi
mov dword [esp], esi
call sub.KERNEL32.dll_ReadFile
sub esp, 0x14
test eax, eax
je 0x610474c9
mov ecx, dword [0x610f08a0]
test ecx, ecx
jne 0x61047496
mov eax, dword [ebx + 0x398]
xor edx, edx
mov dword [eax + 0x80], edx
mov edx, dword [ebx + 0x39c]
test edx, edx
jne 0x61047480
test byte [eax + 0x25], 2
jne 0x6104713e
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x6104713e
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp + 0xc]
test ecx, ecx
je 0x610472e8
mov byte [esi], 0
mov esi, dword [ebp + 0xc]
mov eax, dword [ebx + 0x398]
inc esi
movzx eax, byte [eax + 0x1c]
xor al, 1
and al, 1
test al, al
jne 0x6104745b
mov edx, dword [ebp - 0x12c]
dec edx
cmp edx, 0xffffffff
mov dword [ebp - 0x12c], edx
je 0x6104734b
movzx ecx, byte [edi]
cmp cl, 0xa
je 0x6104742e
cmp cl, 0xd
je 0x610473f6
inc dword [ebp - 0x134]
mov edx, dword [ebp + 0xc]
mov eax, esi
sub eax, edx
cmp eax, dword [ebp + 0x10]
jge 0x610473a7
mov byte [esi], cl
inc edi
mov edx, dword [ebp - 0x12c]
inc esi
lea eax, [edx - 1]
cmp eax, 0xffffffff
mov edx, eax
mov dword [ebp - 0x12c], eax
jne 0x6104730a
mov ecx, dword [ebp + 0xc]
sub esi, ecx
mov dword [ebp - 0x138], esi
lea esi, [esi]
lea edi, [edi]
mov eax, dword [0x610f08a0]
test eax, eax
jne 0x61047377
mov eax, dword [ebp - 0x138]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], 0x61047068
mov eax, dword [ebp - 0x138]
mov dword [esp + 8], 0x61047020
mov dword [esp + 4], 0x100
mov dword [esp + 0x10], eax
mov dword [esp], 0x610f089c
call fcn.6108fd50
jmp 0x61047369
cmp cl, 0xa
je 0x610473ea
mov edx, dword [ebp - 0x12c]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0x61047080
mov dword [esp + 8], 0x61047020
mov dword [esp + 4], 0x8000
mov dword [esp], 0x610f089c
call fcn.6108fd50
mov edi, 1
mov dword [ebx + 0x3d0], edi
jmp 0x6104734b
mov edx, dword [ebp - 0x12c]
test edx, edx
je 0x610473da
jmp 0x610473b2
mov eax, dword [ebx + 0x398]
test byte [eax + 0x1c], 0x10
je 0x61047411
cmp dword [ebp - 0x134], 0
jne 0x61047411
inc edi
jmp 0x6104733b
test byte [eax + 0x1c], 4
je 0x61047421
mov byte [edi], 0xa
mov cl, 0xa
jmp 0x61047325
xor eax, eax
mov dword [ebp - 0x134], eax
jmp 0x61047325
mov eax, dword [ebx + 0x398]
test byte [eax + 0x1c], 8
je 0x6104744f
mov byte [esi], 0xd
xor eax, eax
inc esi
mov dword [ebp - 0x134], eax
mov eax, dword [ebx + 0x398]
movzx ecx, byte [edi]
test byte [eax + 0x1c], 0x20
je 0x61047325
jmp 0x61047421
mov dword [esp], esi
mov eax, dword [ebp - 0x12c]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
call sym.cygwin1.dll__memcpy
mov edx, dword [ebp - 0x12c]
add esi, edx
jmp 0x6104734b
mov dword [esp], edx
call sub.KERNEL32.dll_SetEvent
mov eax, dword [ebx + 0x398]
sub esp, 4
jmp 0x610472bc
mov dword [esp + 0xc], 0x610470a9
mov eax, dword [ebp - 0x12c]
mov dword [esp + 8], 0x61047020
mov dword [esp + 4], 0x100
mov dword [esp + 0x10], eax
mov dword [esp], 0x610f089c
call fcn.6108fd50
jmp 0x610472a0
call sub.KERNEL32.dll_GetLastError
xor edx, edx
cmp eax, 0x6d
mov dword [ebp - 0x138], edx
je 0x61047360
mov eax, 0x610470c0
mov edx, 0x186
call fcn.61022e70
mov eax, 0xffffffff
mov dword [ebp - 0x138], eax
jmp 0x61047360
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x6104750b
mov eax, dword [ebp + 0xc]
mov byte [eax], 0xa
xor ecx, ecx
mov edx, 1
mov dword [ebx + 0x3d0], ecx
mov dword [ebp - 0x138], edx
jmp 0x61047360