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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 0x18
push ebx
push esi
mov esi, ecx
push edi
test eax, eax
je 0x4818b2
mov edi, dword [ebp + 8]
test edi, edi
je 0x4818b2
xor ecx, ecx
lea ebx, [esi + 0x24c]
mov word [ebx], cx
lea ecx, [esi + 0x6c4]
mov dword [ebp - 0x14], ecx
mov dword [eax], ecx
mov ecx, esi
call fcn.0047e8d8
test eax, eax
je 0x4818b2
mov eax, dword [ebp + 0xc]
push 0x30
pop ecx
cmp eax, ecx
cmova eax, ecx
push eax
lea eax, [esi + 0x688]
push edi
push eax
call fcn.004f5d30
and dword [ebp + 8], 0
lea edx, [esi + 0x6c4]
mov eax, dword [esi + 0x6b8]
add esp, 0xc
mov dword [ebp - 0xc], 0x30
mov dword [ebp - 0x10], edx
test eax, eax
je 0x481766
mov ecx, dword [esi + 0x6c0]
cmp ecx, 0x30
jbe 0x481766
mov ebx, dword [ebp + 0x10]
mov edx, eax
mov dword [ebp - 0x10], eax
mov dword [ebx], eax
lea ebx, [esi + 0x24c]
jmp 0x481769
mov ecx, dword [ebp - 0xc]
lea eax, [esi + 0x66c]
mov dword [ebp - 0xc], eax
xor eax, eax
cmp dword [esi + 0x668], eax
cmovne eax, dword [ebp - 0xc]
push eax
lea eax, [ebp + 8]
push eax
push ecx
push edx
push dword [ebp + 0xc]
push edi
push dword [esi + 0x65c]
call dword [sym.imp.KERNEL32.dll_TransactNamedPipe]
mov ecx, eax
mov dword [ebp - 4], ecx
test ecx, ecx
je 0x4817a2
xor eax, eax
jmp 0x4817ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
cmp dword [esi + 0x668], 0
mov edx, 0x7530
mov dword [esi + 0x6f4], eax
mov dword [ebp - 0xc], 1
je 0x481837
test ecx, ecx
jne 0x48188d
cmp eax, 0x3e5
jne 0x48183d
mov eax, dword [esi + 0x664]
mov ecx, dword [esi + 0x67c]
push edx
test eax, eax
je 0x4817fc
mov dword [ebp - 4], eax
lea eax, [ebp - 8]
push 0
push eax
push 2
mov dword [ebp - 8], ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
jmp 0x481803
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x481870
cmp eax, 1
je 0x481870
push 0
lea eax, [ebp + 8]
push eax
lea eax, [esi + 0x66c]
push eax
push dword [esi + 0x65c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x6f4], eax
cmp dword [ebp - 4], 0
jne 0x48188d
cmp eax, 0x6d
je 0x481874
cmp eax, 0xea
je 0x48188d
xor ecx, ecx
cmp dword [ebp + 0xc], 0x30
jb 0x481854
mov ecx, dword [edi + 0xc]
push eax
push ecx
lea eax, [esi + 0x20c]
push eax
push str._s:_TransactNamedPipe_failed__Cmd_i__ErrCode_u_
push 0x208
push ebx
call fcn.004e1e5a
add esp, 0x18
and dword [ebp - 0xc], 0
lea ecx, [esi + 0x700]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, esi
call fcn.004782ef
mov eax, dword [ebp - 0xc]
jmp 0x4818b4
mov ecx, dword [ebp + 8]
cmp ecx, 0x30
jae 0x4818bb
push 0x30
push ecx
lea eax, [esi + 0x20c]
push eax
push str._s:_Only__i_bytes_received__required__i_bytes_at_least_
push 0x208
push ebx
call fcn.004e1e5a
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0xc
mov edx, dword [esi + 0x694]
cmp dword [edi + 0xc], edx
je 0x4818d8
push edx
push dword [edi + 0xc]
lea eax, [esi + 0x20c]
push eax
push str._s:_Invalid_CmdID_i_received__required_CmdID_i_
jmp 0x4818a4
mov edx, dword [ebp - 0x10]
mov edi, 0xa6
cmp dword [edx + 4], edi
je 0x4818f7
push edi
push dword [edx + 0xc]
lea eax, [esi + 0x20c]
push eax
push str._s:_Old_version_packet_received___i___required___i__
jmp 0x4818a4
mov edi, dword [edx]
cmp edi, ecx
jae 0x48190d
push ecx
push edi
lea eax, [esi + 0x20c]
push eax
push str._s:_Invalid_packet_size___i___must_be_greater_or_equal_to__i_
jmp 0x4818a4
cmp eax, 0xea
jne 0x481a8e
mov eax, dword [esi + 0x6b8]
test eax, eax
je 0x481942
cmp dword [esi + 0x6c0], edi
jl 0x481942
cmp edx, dword [ebp - 0x14]
jne 0x481957
push ecx
lea ecx, [esi + 0x6c4]
push ecx
push eax
call fcn.004f5d30
add esp, 0xc
jmp 0x481954
push ecx
push edx
push edi
mov ecx, esi
call fcn.00477437
test eax, eax
je 0x4818b2
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
sub edi, ecx
mov eax, dword [esi + 0x6b8]
mov dword [edx], eax
mov edx, dword [esi + 0x6b8]
add edx, ecx
mov dword [ebp + 0x10], edx
test edi, edi
jle 0x481a82
xor eax, eax
lea ecx, [esi + 0x66c]
cmp dword [esi + 0x668], eax
cmovne eax, ecx
push eax
lea eax, [ebp + 8]
push eax
push edi
push edx
push dword [esi + 0x65c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, eax
mov dword [ebp + 0xc], ecx
test ecx, ecx
je 0x4819a8
xor eax, eax
jmp 0x4819b1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0xc]
cmp dword [esi + 0x668], 0
mov dword [esi + 0x6f4], eax
je 0x481a3d
test ecx, ecx
jne 0x481a4a
cmp eax, 0x3e5
jne 0x481a43
mov eax, dword [esi + 0x664]
mov ecx, dword [esi + 0x67c]
push 0x7530
test eax, eax
je 0x4819fa
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x18]
push 0
push eax
push 2
mov dword [ebp - 0x18], ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
jmp 0x481a01
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x481870
cmp eax, 1
je 0x481870
push 0
lea eax, [ebp + 8]
push eax
lea eax, [esi + 0x66c]
push eax
push dword [esi + 0x65c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov dword [ebp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x6f4], eax
cmp dword [ebp + 0xc], 0
jne 0x481a4a
cmp eax, 0xea
jne 0x481a5e
mov edx, dword [ebp + 0x10]
add edx, dword [ebp + 8]
sub edi, dword [ebp + 8]
mov dword [ebp + 0x10], edx
test edi, edi
jg 0x481977
test edi, edi
jle 0x481a82
push edi
lea eax, [esi + 0x20c]
push eax
push str._s:_Cant_read__u_bytes_
push 0x208
push ebx
call fcn.004e1e5a
add esp, 0x14
jmp 0x4818b2
push dword [esi + 0x65c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
xor eax, eax
inc eax
jmp 0x4818b4