Function at 0x471f20
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 0x47238a
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x47238a
lea eax, [esi + 0x248]
xor ecx, ecx
push edi
mov word [eax], cx
lea edi, [esi + 0x6b8]
mov ecx, esi
mov dword [ebp - 8], eax
mov dword [ebx], edi
call fcn.0046f7b0
test eax, eax
je 0x47237f
mov eax, dword [ebp + 0xc]
cmp eax, 0x30
jb 0x471f72
mov eax, 0x30
mov edx, dword [ebp + 8]
push eax
push edx
lea eax, [esi + 0x67c]
push eax
call fcn.004b0bb0
mov eax, dword [esi + 0x6ac]
add esp, 0xc
mov dword [ebp - 4], 0
mov ecx, 0x30
mov dword [ebp - 0xc], edi
test eax, eax
je 0x471fb0
mov edx, dword [esi + 0x6b4]
cmp edx, ecx
jbe 0x471fb0
mov dword [ebp - 0xc], eax
mov ecx, edx
mov dword [ebx], eax
cmp dword [esi + 0x664], 0
je 0x471fc1
lea eax, [esi + 0x668]
jmp 0x471fc3
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 0x471fec
xor eax, eax
jmp 0x471ff2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x664], 0
mov dword [esi + 0x6e8], eax
je 0x47207c
test edi, edi
je 0x47200c
mov ecx, dword [ebp - 4]
test ecx, ecx
jne 0x47207f
mov eax, dword [esi + 0x660]
push 0x7530
test eax, eax
je 0x472037
mov ecx, dword [esi + 0x678]
push 0
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 0x472044
mov eax, dword [esi + 0x678]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x4720d0
cmp eax, 1
je 0x4720d0
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 + 0x6e8], eax
mov ecx, dword [ebp - 4]
test edi, edi
jne 0x4720e2
cmp eax, 0x6d
jne 0x47209d
mov ecx, esi
call fcn.0046f780
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp eax, 0xea
je 0x4720e2
xor ecx, ecx
cmp ebx, 0x30
jb 0x4720b1
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.00441b50
add esp, 0x18
mov ecx, esi
call fcn.0046f780
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp ecx, 0x30
jae 0x472112
push 0x30
push ecx
mov ecx, dword [ebp - 8]
add esi, 0x208
push esi
push str._s:_Only__i_bytes_recieved__required__i_bytes_at_least_
push 0x208
push ecx
call fcn.00441b50
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 + 0x688]
cmp edx, edi
je 0x472132
push edi
push edx
add esi, 0x208
push esi
push str._s:_Invalid_CmdID_i_recieved__required_CmdID_i_
jmp 0x47217d
mov edx, dword [ebp - 0xc]
cmp dword [edx + 4], 0x7e
je 0x472169
mov ecx, dword [edx + 0xc]
mov edx, dword [ebp - 8]
push 0x7e
push ecx
add esi, 0x208
push esi
push str._s:_Old_version_packet_recieved___i___required___i__
push 0x208
push edx
call fcn.00441b50
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 0x472199
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.00441b50
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp eax, 0xea
jne 0x47208f
mov eax, dword [esi + 0x6ac]
mov ebx, edx
test eax, eax
je 0x4721d4
cmp dword [esi + 0x6b4], ebx
jl 0x4721d4
lea edx, [esi + 0x6b8]
cmp dword [ebp - 0xc], edx
jne 0x47224d
push ecx
push edx
push eax
call fcn.004b0bb0
add esp, 0xc
jmp 0x47224a
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 0x472213
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.00441b50
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.004b0bb0
mov eax, dword [esi + 0x6ac]
add esp, 0xc
test eax, eax
je 0x47223e
mov edx, dword [esi + 0x65c]
push eax
push 0
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [esi + 0x6b4], ebx
mov dword [esi + 0x6ac], edi
mov ecx, dword [ebp - 4]
mov eax, dword [esi + 0x6ac]
mov edx, dword [ebp + 0x10]
mov dword [edx], eax
mov eax, dword [esi + 0x6ac]
add eax, ecx
sub ebx, ecx
mov dword [ebp + 8], eax
test ebx, ebx
jg 0x472287
mov edx, dword [esi + 0x658]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 8]
mov edx, dword [esi + 0x658]
push 0
lea ecx, [ebp - 4]
push ecx
push ebx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
test edi, edi
je 0x4722a6
xor eax, eax
jmp 0x4722ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x664], 0
mov dword [esi + 0x6e8], eax
je 0x472339
test edi, edi
je 0x4722c5
cmp dword [ebp - 4], 0
jne 0x472339
mov eax, dword [esi + 0x660]
push 0x7530
test eax, eax
je 0x4722f0
mov ecx, dword [esi + 0x678]
push 0
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 0x4722fd
mov eax, dword [esi + 0x678]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x4720d0
cmp eax, 1
je 0x4720d0
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 + 0x6e8], eax
test edi, edi
jne 0x472344
cmp eax, 0xea
jne 0x472359
mov eax, dword [ebp - 4]
add dword [ebp + 8], eax
sub ebx, eax
test ebx, ebx
jg 0x472284
jmp 0x472269
test ebx, ebx
jle 0x472269
mov ecx, dword [ebp - 8]
push ebx
add esi, 0x208
push esi
push str._s:_Cant_read__u_bytes_
push 0x208
push ecx
call fcn.00441b50
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