Function at 0x47f390
Capabilities:
Read file on windows
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
cmp dword [ebp + 8], 0
push ebx
push esi
mov esi, ecx
je 0x47f853
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x47f853
lea eax, [esi + 0x248]
xor ecx, ecx
push edi
mov word [eax], cx
lea edi, [esi + 0x6bc]
mov ecx, esi
mov dword [ebp - 8], eax
mov dword [ebx], edi
call fcn.0047d440
test eax, eax
je 0x47f848
mov eax, dword [ebp + 0xc]
cmp eax, 0x30
jb 0x47f3e2
mov eax, 0x30
mov edx, dword [ebp + 8]
push eax
push edx
lea eax, [esi + 0x680]
push eax
call fcn.004c9f70
mov eax, dword [esi + 0x6b0]
add esp, 0xc
mov dword [ebp - 4], 0
mov ecx, 0x30
mov dword [ebp - 0xc], edi
test eax, eax
je 0x47f420
mov edx, dword [esi + 0x6b8]
cmp edx, ecx
jbe 0x47f420
mov dword [ebp - 0xc], eax
mov ecx, edx
mov dword [ebx], eax
cmp dword [esi + 0x664], 0
je 0x47f431
lea eax, [esi + 0x668]
jmp 0x47f433
xor eax, eax
mov ebx, dword [ebp + 0xc]
push eax
mov eax, dword [ebp - 0xc]
lea edx, [ebp - 4]
push edx
mov edx, dword [esi + 0x658]
push ecx
mov ecx, dword [ebp + 8]
push eax
push ebx
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_TransactNamedPipe]
mov edi, eax
test edi, edi
je 0x47f45c
xor eax, eax
jmp 0x47f462
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x664], 0
mov dword [esi + 0x6ec], eax
je 0x47f4f7
test edi, edi
jne 0x47f574
cmp eax, 0x3e5
jne 0x47f4fb
mov eax, dword [esi + 0x660]
push 0x7530
test eax, eax
je 0x47f4ae
mov ecx, dword [esi + 0x678]
push edi
lea edx, [ebp - 0x14]
push edx
push 2
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
jmp 0x47f4bb
mov eax, dword [esi + 0x678]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x47f555
cmp eax, 1
je 0x47f555
mov eax, dword [esi + 0x658]
push 0
lea ecx, [ebp - 4]
push ecx
lea edx, [esi + 0x668]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x6ec], eax
test edi, edi
jne 0x47f574
cmp eax, 0x6d
jne 0x47f522
lea edx, [esi + 0x6f8]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, esi
call fcn.0047d3f0
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp eax, 0xea
je 0x47f574
xor ecx, ecx
cmp ebx, 0x30
jb 0x47f536
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx + 0xc]
push eax
mov eax, dword [ebp - 8]
push ecx
lea edx, [esi + 0x208]
push edx
push str._s:_TransactNamedPipe_failed__Cmd_i__ErrCode_u_
push 0x208
push eax
call fcn.0044cff0
add esp, 0x18
lea ecx, [esi + 0x6f8]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, esi
call fcn.0047d3f0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 4]
cmp ecx, 0x30
jae 0x47f5a7
mov edx, dword [ebp - 8]
push 0x30
push ecx
add esi, 0x208
push esi
push str._s:_Only__i_bytes_recieved__required__i_bytes_at_least_
push 0x208
push edx
call fcn.0044cff0
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0xc]
mov edi, dword [esi + 0x68c]
cmp edx, edi
je 0x47f5c7
push edi
push edx
add esi, 0x208
push esi
push str._s:_Invalid_CmdID_i_recieved__required_CmdID_i_
jmp 0x47f618
mov edx, dword [ebp - 0xc]
cmp dword [edx + 4], 0x8b
je 0x47f604
mov ecx, dword [edx + 0xc]
mov edx, dword [ebp - 8]
push 0x8b
push ecx
add esi, 0x208
push esi
push str._s:_Old_version_packet_recieved___i___required___i__
push 0x208
push edx
call fcn.0044cff0
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [edx]
cmp edx, ecx
jae 0x47f634
push ecx
push edx
add esi, 0x208
push esi
push str._s:_Invalid_packet_size___i___must_be_greater_or_equal_to__i_
mov eax, dword [ebp - 8]
push 0x208
push eax
call fcn.0044cff0
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp eax, 0xea
jne 0x47f514
mov eax, dword [esi + 0x6b0]
mov ebx, edx
test eax, eax
je 0x47f66f
cmp dword [esi + 0x6b8], ebx
jl 0x47f66f
lea edx, [esi + 0x6bc]
cmp dword [ebp - 0xc], edx
jne 0x47f6e8
push ecx
push edx
push eax
call fcn.004c9f70
add esp, 0xc
jmp 0x47f6e5
mov ecx, dword [esi + 0x65c]
push ebx
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x47f6ae
mov edx, dword [ebp - 8]
push ebx
add esi, 0x208
push esi
push str._s:_Cant_allocate__u_bytes_
push 0x208
push edx
call fcn.0044cff0
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
push eax
push ecx
push edi
call fcn.004c9f70
mov eax, dword [esi + 0x6b0]
add esp, 0xc
test eax, eax
je 0x47f6d9
mov edx, dword [esi + 0x65c]
push eax
push 0
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [esi + 0x6b8], ebx
mov dword [esi + 0x6b0], edi
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
mov eax, dword [esi + 0x6b0]
mov dword [edx], eax
mov edx, dword [esi + 0x6b0]
add edx, ecx
sub ebx, ecx
mov dword [ebp + 8], edx
test ebx, ebx
jg 0x47f723
mov ecx, dword [esi + 0x658]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebp + 8]
cmp dword [esi + 0x664], 0
je 0x47f734
lea eax, [esi + 0x668]
jmp 0x47f736
xor eax, eax
mov ecx, dword [esi + 0x658]
push eax
lea eax, [ebp - 4]
push eax
push ebx
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
test edi, edi
je 0x47f754
xor eax, eax
jmp 0x47f75a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x664], 0
mov dword [esi + 0x6ec], eax
je 0x47f7e3
test edi, edi
jne 0x47f7ee
cmp eax, 0x3e5
jne 0x47f7e7
mov eax, dword [esi + 0x660]
push 0x7530
test eax, eax
je 0x47f7a2
mov edx, dword [esi + 0x678]
mov dword [ebp - 0x10], eax
push edi
lea eax, [ebp - 0x14]
push eax
push 2
mov dword [ebp - 0x14], edx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
jmp 0x47f7af
mov ecx, dword [esi + 0x678]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x47f803
cmp eax, 1
je 0x47f803
mov ecx, dword [esi + 0x658]
push 0
lea edx, [ebp - 4]
push edx
lea eax, [esi + 0x668]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x6ec], eax
test edi, edi
jne 0x47f7ee
cmp eax, 0xea
jne 0x47f822
mov eax, dword [ebp - 4]
add dword [ebp + 8], eax
sub ebx, eax
test ebx, ebx
jg 0x47f720
jmp 0x47f704
lea edx, [esi + 0x6f8]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, esi
call fcn.0047d3f0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
test ebx, ebx
jle 0x47f704
mov eax, dword [ebp - 8]
push ebx
add esi, 0x208
push esi
push str._s:_Cant_read__u_bytes_
push 0x208
push eax
call fcn.0044cff0
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc