Function at 0x4fd860
Capabilities:
Connect pipe
Create pipe
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x868
mov byte [ebp - 0x821], 0
mov dword [ebp - 0x825], 0x74736574
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x400
mov dword [esp + 0x10], 0x400
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000003
mov dword [esp], str..PiPe_tests_pipe.c
call dword [sym.imp.kernel32.dll_CreateNamedPipeA]
sub esp, 0x20
mov esi, eax
mov eax, 0xa28
call fcn.004f6080
xor eax, eax
cmp esi, 0xffffffff
mov dword [esp + 4], str.cf_failed_n
setne al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventA]
mov edi, eax
sub esp, 0x10
mov dword [ebp - 0x840], eax
mov eax, 0xa2b
call fcn.004f6080
xor eax, eax
test edi, edi
mov dword [esp + 4], str.CreateEventA_failed_n
setne al
mov dword [esp], eax
call fcn.004f6800
lea eax, [ebp - 0x820]
mov dword [ebp - 0x810], edi
mov dword [ebp - 0x820], 0
mov dword [ebp - 0x81c], 0
mov dword [ebp - 0x818], 0
mov dword [ebp - 0x814], 0
mov dword [esp + 4], eax
mov dword [ebp - 0x838], esi
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_ConnectNamedPipe]
sub esp, 8
mov ebx, eax
mov eax, dword fs:[0x18]
mov esi, dword [eax + 0x34]
mov dword [ebp - 0x844], eax
mov eax, 0xa32
call fcn.004f6080
xor eax, eax
test ebx, ebx
mov dword [esp + 4], str.ConnectNamedPipe_succeeded_n
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa33
call fcn.004f6080
xor eax, eax
cmp esi, 0x3e5
mov dword [esp + 8], esi
sete al
mov dword [esp + 4], str.ConnectNamedPipe_set_error__li_n
mov dword [esp], eax
call fcn.004f6800
mov ecx, dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov dword [esp], edi
mov dword [esp + 4], 0
mov esi, ecx
mov dword [ebp - 0x850], ecx
call ecx
sub esp, 8
mov ebx, eax
mov eax, 0xa36
call fcn.004f6080
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 8], ebx
sete al
mov dword [esp + 4], 0x5ec470
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], str..PiPe_tests_pipe.c
call dword [sym.imp.kernel32.dll_CreateFileA]
sub esp, 0x1c
mov ebx, eax
mov eax, 0xa3a
call fcn.004f6080
xor eax, eax
cmp ebx, 0xffffffff
mov dword [esp + 4], str.cf_failed_n
setne al
mov dword [ebp - 0x83c], ebx
mov dword [esp], eax
call fcn.004f6800
mov dword [esp], edi
mov dword [esp + 4], 0
call esi
sub esp, 8
mov ebx, eax
mov eax, 0xa3d
call fcn.004f6080
xor eax, eax
test ebx, ebx
mov dword [esp + 8], ebx
sete al
mov dword [esp + 4], 0x5ec470
mov dword [esp], eax
call fcn.004f6800
mov edx, dword [sym.imp.kernel32.dll_ResetEvent]
mov dword [0x7efa10], 0
mov dword [esp], edi
mov dword [ebp - 0x848], edx
call edx
lea edx, [ebp - 0x820]
sub esp, 4
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x80c]
mov dword [esp + 4], edx
mov dword [esp + 0x10], 0x4f5e90
mov dword [esp + 8], 0x400
mov esi, dword [ebp - 0x838]
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_ReadFileEx]
sub esp, 0x14
mov ebx, eax
mov eax, 0xa43
call fcn.004f6080
mov eax, dword [ebp - 0x844]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str.ReadFileEx_failed__err_li_n
mov dword [esp + 8], eax
xor eax, eax
cmp ebx, 1
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa44
call fcn.004f6080
mov dword [esp + 4], str.completion_routine_called_before_ReadFileEx_returned_n
xor eax, eax
mov esi, dword [0x7efa10]
test esi, esi
mov esi, edi
sete al
mov dword [esp], eax
call fcn.004f6800
lea eax, [ebp - 0x82c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x825]
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [esp + 8], 4
mov ecx, dword [ebp - 0x83c]
mov dword [esp], ecx
mov dword [ebp - 0x854], eax
call eax
sub esp, 0x14
mov ebx, eax
mov eax, 0xa47
call fcn.004f6080
xor eax, eax
cmp ebx, 1
mov dword [esp + 4], str.WriteFile_failed_n
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa48
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], str.only__li_bytes_written_n
cmp eax, 4
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa4a
call fcn.004f6080
mov dword [esp + 4], str.completion_routine_called_during_WriteFile_n
xor eax, eax
mov edx, dword [0x7efa10]
test edx, edx
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, dword [sym.imp.kernel32.dll_WaitForSingleObjectEx]
mov dword [esp], edi
lea edi, [ebp - 0x40c]
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [ebp - 0x830], eax
call eax
sub esp, 0xc
mov ebx, eax
mov eax, 0xa4d
call fcn.004f6080
cmp ebx, 0xc0
mov dword [esp + 8], ebx
sete al
test ebx, ebx
mov dword [esp + 4], str.WaitForSingleObjectEx_returned__lx_n
sete dl
or eax, edx
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa4f
call fcn.004f6080
mov dword [esp + 4], str.completion_not_called_after_writing_pipe_n
xor eax, eax
cmp dword [0x7efa10], 1
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa50
call fcn.004f6080
mov eax, dword [0x7efa0c]
mov dword [esp + 4], str.completion_called_with_error__lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa51
call fcn.004f6080
mov eax, dword [0x7efa08]
mov dword [esp + 4], str.ReadFileEx_returned_only__ld_bytes_n
cmp eax, 4
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa52
call fcn.004f6080
mov dword [esp + 4], str.completion_called_with_wrong_overlapped_pointer_n
lea eax, [ebp - 0x820]
cmp dword [0x7efa04], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa53
call fcn.004f6080
mov dword [esp + 4], str.ReadFileEx_read_wrong_bytes_n
mov eax, dword [ebp - 0x80c]
cmp dword [ebp - 0x825], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov ecx, 0x100
mov eax, 0xaaaaaaaa
mov dword [ebp - 0x84c], 0x100
rep stosd dword es:[edi], eax
jmp 0x4fde5f
call fcn.0057d110
cmp ebx, 0xc0
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa66
sete al
test ebx, ebx
sete dl
mov dword [esp + 8], ebx
xor ebx, ebx
or eax, edx
mov dword [esp + 4], 0x5ec470
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
call fcn.0057d110
cmp dword [ebp - 0x834], 1
sete bl
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa68
mov dword [esp + 8], edi
mov dword [esp + 4], str.WriteFileEx_failed__err_li_n
mov dword [esp], ebx
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa69
mov eax, dword [0x7efa0c]
mov dword [esp + 4], str.completion_called_with_error__lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa6a
lea eax, [ebp - 0x820]
mov dword [esp + 4], str.completion_called_with_wrong_overlapped_pointer_n
cmp dword [0x7efa04], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
sub dword [ebp - 0x84c], 1
je 0x4fdf25
mov dword [0x7efa10], 0
mov dword [esp], esi
mov eax, dword [ebp - 0x848]
call eax
lea eax, [ebp - 0x820]
sub esp, 4
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x40c]
mov dword [esp + 0x10], 0x4f5e90
mov dword [esp + 8], 0x400
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFileEx]
mov ecx, dword [ebp - 0x844]
sub esp, 0x14
mov dword [ebp - 0x834], eax
mov edi, dword [ecx + 0x34]
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa5e
xor eax, eax
mov dword [esp + 4], str.completion_routine_called_during_WriteFileEx_n
mov ebx, dword [0x7efa10]
test ebx, ebx
sete al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], esi
mov edx, dword [ebp - 0x830]
call edx
sub esp, 0xc
mov ebx, eax
cmp eax, 0x102
jne 0x4fdd80
mov ebx, dword [ebp - 0x834]
cmp ebx, 1
sete bl
movzx ebx, bl
mov eax, 0xa6d
mov esi, 0x100
call fcn.004f6080
mov dword [esp + 8], edi
mov dword [esp + 4], str.WriteFileEx_failed__err_li_n
mov dword [esp], ebx
call fcn.004f6800
mov eax, 0xa6e
call fcn.004f6080
mov dword [esp + 4], str.completion_routine_called_but_wait_timed_out_n
xor eax, eax
mov ecx, dword [0x7efa10]
test ecx, ecx
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa6f
call fcn.004f6080
mov eax, dword [0x7efa0c]
mov dword [esp + 4], str.completion_called_with_error__lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa70
call fcn.004f6080
mov dword [esp + 4], str.completion_called_with_wrong_overlapped_pointer_n
lea eax, [ebp - 0x820]
cmp dword [0x7efa04], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov edi, dword [sym.imp.kernel32.dll_ReadFile]
lea esi, [esi]
lea eax, [ebp - 0x82c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x80c]
mov dword [esp + 8], 0x400
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x83c]
mov dword [esp], eax
call edi
sub esp, 0x14
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa76
xor eax, eax
cmp ebx, 1
sete al
mov dword [esp + 4], 0x5ec666
mov dword [esp], eax
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa78
xor eax, eax
mov dword [esp + 4], str.completion_routine_called_during_ReadFile_n
mov edx, dword [0x7efa10]
test edx, edx
sete al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x840]
mov dword [esp], eax
mov eax, dword [ebp - 0x830]
call eax
sub esp, 0xc
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0xa7b
cmp ebx, 0xc0
je 0x4fe5e0
test ebx, ebx
je 0x4fe5e0
cmp ebx, 0x102
je 0x4fe5b0
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x5ec470
mov dword [esp], 0
call fcn.004f6800
mov eax, 0xa80
call fcn.004f6080
mov dword [esp + 4], str.completion_routine_not_called_n
xor eax, eax
cmp dword [0x7efa10], 1
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa81
call fcn.004f6080
mov eax, dword [0x7efa0c]
mov dword [esp + 4], str.completion_called_with_error__lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa82
call fcn.004f6080
mov dword [esp + 4], str.completion_called_with_wrong_overlapped_pointer_n
lea eax, [ebp - 0x820]
cmp dword [0x7efa04], eax
sete al
movzx eax, al
mov dword [esp], eax
mov ebx, dword fs:[0x18]
call fcn.004f6800
lea eax, [ebp - 0x82c]
mov dword [ebp - 0x82c], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x80c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 0xffffffff
call edi
sub esp, 0x14
mov esi, eax
mov eax, 0xa87
call fcn.004f6080
xor eax, eax
test esi, esi
mov dword [esp + 4], str.ReadFile_should_fail_n
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa88
call fcn.004f6080
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], 0x5ec6d9
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebx + 0x34], 6
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa89
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], 0x5ebe16
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov esi, dword [ebp - 0x840]
lea eax, [ebp - 0x820]
mov dword [ebp - 0x818], 0
mov dword [ebp - 0x814], 0
mov dword [ebp - 0x810], esi
mov dword [ebp - 0x820], 0xffffffff
mov dword [ebp - 0x81c], 0xffffffff
mov dword [ebp - 0x82c], 0xdeadbeef
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x82c]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x80c]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call edi
sub esp, 0x14
mov esi, eax
mov eax, 0xa93
call fcn.004f6080
xor eax, eax
test esi, esi
mov dword [esp + 4], str.ReadFile_should_fail_n
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa94
call fcn.004f6080
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.expected_ERROR_IO_PENDING__got__ld_n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebx + 0x34], 0x3e5
sete al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa95
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], str.bytes__lu_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa96
call fcn.004f6080
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], str.expected_STATUS_PENDING__got__Ix_n
cmp eax, 0x103
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xa97
call fcn.004f6080
mov eax, dword [ebp - 0x81c]
mov dword [esp + 4], str.expected__1__got__Iu_n
cmp eax, 0xffffffff
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 4], 0x64
mov esi, dword [ebp - 0x840]
mov dword [esp], esi
mov ecx, dword [ebp - 0x850]
call ecx
sub esp, 8
mov ebx, eax
mov eax, 0xa9a
call fcn.004f6080
xor eax, eax
cmp ebx, 0x102
mov dword [esp + 8], ebx
sete al
mov dword [esp + 4], 0x5ec470
mov dword [esp], eax
call fcn.004f6800
lea edx, [ebp - 0x82c]
mov dword [ebp - 0x82c], 0xdeadbeef
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x825]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x83c]
mov dword [esp], edx
mov ebx, dword [ebp - 0x854]
call ebx
sub esp, 0x14
mov ebx, eax
mov eax, 0xa9e
call fcn.004f6080
mov dword [esp], ebx
mov dword [esp + 4], str.WriteFile_failed_n
call fcn.004f6800
mov eax, 0xa9f
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], str.bytes__lu_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp], esi
mov dword [esp + 4], 0x64
mov ecx, dword [ebp - 0x850]
call ecx
sub esp, 8
mov ebx, eax
mov eax, 0xaa2
call fcn.004f6080
xor eax, eax
test ebx, ebx
mov dword [esp + 8], ebx
sete al
mov dword [esp + 4], 0x5ec470
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xaa4
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], str.bytes__lu_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xaa5
call fcn.004f6080
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], str.expected_STATUS_SUCCESS__got__Ix_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0xaa6
call fcn.004f6080
mov eax, dword [ebp - 0x81c]
mov dword [esp + 4], str.expected_0__got__Iu_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
lea ecx, [ebp - 0x820]
mov dword [ebp - 0x82c], 0xdeadbeef
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x82c]
mov dword [esp + 0xc], ecx
lea ecx, [ebp - 0x80c]
mov dword [esp + 4], ecx
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call edi
sub esp, 0x14
mov ebx, eax
mov eax, 0xaab
call fcn.004f6080
mov dword [esp], ebx
mov dword [esp + 4], 0x5ec666
call fcn.004f6800
mov eax, 0xaac
call fcn.004f6080
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], str.bytes__lu_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov edx, dword [ebp - 0x83c]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], edx
call ebx
mov eax, dword [ebp - 0x838]
sub esp, 4
mov dword [esp], eax
call ebx
sub esp, 4
mov dword [esp], esi
call ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0x102
mov dword [esp + 4], 0x5ec470
mov dword [esp], 1
call fcn.004f6800
sub esi, 1
jne 0x4fdfd0
jmp 0x4fe0cd
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x5ec470
mov dword [esp], 1
call fcn.004f6800
jmp 0x4fe0cd